diff options
author | Leo Liu <sdl.web@gmail.com> | 2010-10-27 21:30:01 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-10-27 21:30:01 -0400 |
commit | 19677c71262113e3993b545259aeb2fc3c397fb7 (patch) | |
tree | 8134bf8d85abd4478cb1f5963944762b2fe0196e /lisp/iswitchb.el | |
parent | 77b143ebc1100462cd6b9be6b92db91c35eb5f5d (diff) | |
download | emacs-19677c71262113e3993b545259aeb2fc3c397fb7.tar.gz |
* lisp/iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist'
which changes the order of matches seen by users.
Fixes: debbugs:7231
Diffstat (limited to 'lisp/iswitchb.el')
-rw-r--r-- | lisp/iswitchb.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 808a23577d1..48f0edb49e0 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -1033,7 +1033,9 @@ Return the modified list with the last element prepended to it." (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 @@ Return the modified list with the last element prepended to it." (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) |