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

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

bug#1121: 23.0.60; `buffer-list' returns buffers in wrong order


From: Drew Adams
Subject: bug#1121: 23.0.60; `buffer-list' returns buffers in wrong order
Date: Fri, 10 Oct 2008 08:36:44 -0700

>  > Yes, I get the same result as you do:
>  >
>  > (#<buffer  *Minibuf-1*> #<buffer  *Minibuf-2*> #<buffer buf002.txt>
>  > #<buffer buf001.txt> #<buffer *scratch*> #<buffer  
> *Minibuf-0*> ...)
> 
> I checked in a fix.  Could you please try whether it changes anything?
> Drew.  Could you try the attached patch?

Hi Martin; thanks for working on this.
I put the following in a file foo.el:

---------8<----------------------
(defun pop-to-buffer (buffer-or-name &optional other-window norecord)
  (let ((buffer
         (if (null buffer-or-name) (other-buffer (current-buffer))
           (or (get-buffer buffer-or-name)
               (let ((buf (get-buffer-create buffer-or-name)))
                 (set-buffer-major-mode buf)
                 buf))))
        (old-window (selected-window))
        (old-frame (selected-frame))
        new-window new-frame)
    (set-buffer buffer)
    ;; REMOVED norecord <===================
    (setq new-window (display-buffer buffer other-window))
    (unless (eq new-window old-window)
      ;; `display-buffer' has chosen another window, select it.
      ;; ADDED norecord <===================
      (select-window new-window norecord)
      (setq new-frame (window-frame new-window))
      (unless (eq new-frame old-frame)
        ;; `display-buffer' has chosen another frame, make sure it gets
        ;; input focus and is risen.
        (select-frame-set-input-focus new-frame)))
    buffer))

(setq enable-recursive-minibuffers t)
(find-file "c:/dir/buf001.txt")
(find-file-other-frame "c:/dir/buf002.txt")
(switch-to-buffer-other-frame "buf001.txt")
---------8<----------------------

I did emacs -Q, C-x C-f foo.el

I did M-x M-: (buffer-list) in buffer buf001.txt.

I got this (same as before):

(#<buffer  *Minibuf-1*> #<buffer  *Minibuf-2*> #<buffer buf002.txt> #<buffer
buf001.txt> #<buffer testcase.el> #<buffer drews-lisp-20> #<buffer  *tip*>
#<buffer *scratch*> #<buffer  *Minibuf-0*> #<buffer *Messages*> #<buffer
*code-conversion-work*> #<buffer  *Echo Area 0*> ...)

IOW, there was no change; the problem is as before. Did it work for you?

Let me know if I'm not testing it correctly.








reply via email to

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