I've tried using http://www.emacswiki.org/cgi-bin/wiki/CycleBuffer
package and noticed that it does not function correctly on Emacs 22.

The above package uses (switch-to-buffer <buffer> t) when fast
forwarding thru all buffers, in order to avoid recording all the
buffers that user quickly flips thru as recent. Then once user had
selected the buffer they want, it does (switch-to-buffer
(current-buffer)). Under Emacs 21 that moves the buffer to the head of
the buffer list, but under Emacs 22 it fails to do so.

Here is a simple test case from scratch buffer

;; evaluate below first to create 2 buffers
(progn
  (find-file "buffer1")
  (find-file "buffer2"))

;; Switch back to *scratch* buffer and evaluate below form:
;; Under Emacs 21 the form returns buffer1, and under Emacs 22
;; the form returns *scratch*
(progn
  (switch-to-buffer (get-buffer "buffer1") t)
  (switch-to-buffer (get-buffer "buffer1"))
  (car (buffer-list)))
 
The following patch fixes the problem

-----------------------------------------------
Index: buffer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.507
diff -u -r1.507 buffer.c
--- buffer.c    22 Aug 2006 09:25:59 -0000      1.507
+++ buffer.c    24 Aug 2006 02:44:03 -0000
@@ -1683,7 +1683,8 @@
 {
   char *err;
 
-  if (EQ (buffer, Fwindow_buffer (selected_window)))
+  if (EQ (buffer, Fwindow_buffer (selected_window))
+      && (! NILP (norecord) || EQ (buffer, XCDR (XCAR (Vbuffer_alist)))))
     /* Basically a NOP.  Avoid signalling an error if the selected window
        is dedicated, or a minibuffer, ...  */
     return Fset_buffer (buffer);
-----------------------------------------------

Regards,
  Max


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to