help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Emacs switch-to-buffer issue.


From: Rob Kramer
Subject: CVS Emacs switch-to-buffer issue.
Date: Mon, 08 Nov 2004 03:12:50 GMT
User-agent: KNode/0.8.0

Hi,

This weekend I've been trying to figure out what's wrong with my much
beloved cycle-buffer.el on Emacs CVS. Not a trivial task for a elisp
newbie! See my original mail on the issue below.

The problem seems to boil down to a change in the switch-to-buffer
implementation somewhere along the line:

DEFUN ("switch-to-buffer", Fswitch_to_buffer, Sswitch_to_buffer, 1, 2, 
<snip>
{
  char *err;

+  if (EQ (buffer, Fwindow_buffer (selected_window)))
+    /* Basically a NOP.  Avoid signalling an error if the selected window
+       is dedicated, or a minibuffer, ...  */
+    return Fset_buffer (buffer);

  err = no_switch_window (selected_window);
  if (err) error (err);

  return switch_to_buffer_1 (buffer, norecord);
}

The buffer check is new here, and causes cycle-buffer to fail because it
depends on (switch-to-buffer (current-buffer)) to result in a 
record_buffer().

revision 1.434
date: 2003/07/15 19:32:05;  author: monnier;  state: Exp;  lines: +14 -1
(copy_overlays): Use EMACS_INT for positions.
(Fswitch_to_buffer): Don't signal an error when switching to the same
buffer in a dedicated window.


If I remove this statement, or change (switch-to-buffer (current-buffer)) in
cycle-buffer to:

    ;; force record_buffer (current-buffer)
    (setq tmpbuf (current-buffer))
    (switch-to-buffer (other-buffer) t)
    (switch-to-buffer tmpbuf)

then it works.

The elisp solution is a hack. Is there an official way to do this? Should
the test in buffer.c above do a buffer_record() before returning?

Next, to figure out why desktop.el doesn't auto-save my desktop anymore..

Cheers,

     Rob


Subject: cycle-buffer with emacs HEAD
From: Rob Kramer <robk@starhub.net.sg>
Date: Friday 29 October 2004 13:02:43
Groups:gnu.emacs.help

Hia,

I've been using cycle-buffer.el for ages as my buffer switching mechanism,
but it doesn't work quite right on CVS emacs. This is not recent, it's
never worked with post-21.3 CVS versions. It's very difficult to describe
the problem, but it comes down to cycle-buffer switching to the wrong
buffer sometimes. 

An indication of the problem is in the switcher status bar, which normally
looks something like:

    device.h devicestore.cc [Makefile] foo.cc device.cc

Where the bracketed buffer is currently selected. On CVS emacs, it looks
like:

    device.h devicestore.cc [Makefile] [] foo.cc device.cc

..and will often pick the wrong buffer, which is very annoying.

Does anyone else use cycle-buffer? The (most recent I can find) version I'm
using is at http://www.bookshelf.jp/elc/cycle-buffer.el, which is pretty
old already. 

I know almost nothing of emacs-lisp, but could pick it up if someone can
tell me where to start looking for this problem..

I'm surprised cycle-buffer seems unmaintained. Are there better ones out
there?

Cheers,

    Rob


reply via email to

[Prev in Thread] Current Thread [Next in Thread]