emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102132: * lisp/iswitchb.el (iswitchb


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102132: * lisp/iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist'
Date: Wed, 27 Oct 2010 21:30:01 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102132
author: Leo <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2010-10-27 21:30:01 -0400
message:
  * lisp/iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist'
  which changes the order of matches seen by users.
modified:
  lisp/ChangeLog
  lisp/iswitchb.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-10-28 01:10:22 +0000
+++ b/lisp/ChangeLog    2010-10-28 01:30:01 +0000
@@ -1,4 +1,9 @@
-2010-10-28  Jes Bodi Klinke  <address@hidden>
+2010-10-28  Leo  <address@hidden>
+
+       * iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist'
+       which changes the order of matches seen by users (bug#7231).
+
+2010-10-28  Jes Bodi Klinke  <address@hidden>  (tiny change)
 
        * progmodes/compile.el (compilation-mode-font-lock-keywords):
        Don't confuse -omega as "-o mega".

=== modified file 'lisp/iswitchb.el'
--- a/lisp/iswitchb.el  2010-10-02 02:46:13 +0000
+++ b/lisp/iswitchb.el  2010-10-28 01:30:01 +0000
@@ -1033,7 +1033,9 @@
     (setq buf (car iswitchb-matches))
     ;; check to see if buf is non-nil.
     (if buf
-       (progn
+       (let ((bufobjs (mapcar (lambda (name)
+                                (or (get-buffer name) name))
+                              iswitchb-buflist)))
          (kill-buffer buf)
 
          ;; Check if buffer exists.  XEmacs gnuserv.el makes alias
@@ -1044,8 +1046,13 @@
              (setq iswitchb-rescan t)
            ;; Else `kill-buffer' succeeds so re-make the buffer list
            ;; taking into account packages like uniquify may rename
-           ;; buffers
-           (iswitchb-make-buflist iswitchb-default))))))
+           ;; buffers, and try to preserve the ordering of buffers.
+           (setq iswitchb-buflist
+                 (delq nil (mapcar (lambda (b)
+                                     (if (bufferp b)
+                                         (buffer-name b)
+                                       b))
+                                   bufobjs))))))))
 
 ;;; VISIT CHOSEN BUFFER
 (defun iswitchb-visit-buffer (buffer)


reply via email to

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