]> code.delx.au - gnu-emacs/blobdiff - lisp/iswitchb.el
Merge from emacs-23
[gnu-emacs] / lisp / iswitchb.el
index a9db65d0cc8f914f14f85500ada1a3d4e8fb59f1..a6b2521dac803daaf12c678933afd7a3dbdd4436 100644 (file)
@@ -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)
@@ -1119,19 +1126,6 @@ If BUFFER is visible in the current frame, return nil."
       (get-buffer-window buffer 0) ; better than 'visible
       )))
 
-(defun iswitchb-default-keybindings ()
-  "Set up default keybindings for `iswitchb-buffer'.
-Call this function to override the normal bindings.  This function also
-adds a hook to the minibuffer."
-  (interactive)
-  (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)
-  (global-set-key "\C-xb" 'iswitchb-buffer)
-  (global-set-key "\C-x4b" 'iswitchb-buffer-other-window)
-  (global-set-key "\C-x4\C-o" 'iswitchb-display-buffer)
-  (global-set-key "\C-x5b" 'iswitchb-buffer-other-frame))
-
-(make-obsolete 'iswitchb-default-keybindings 'iswitchb-mode "21.1")
-
 (defun iswitchb-buffer ()
   "Switch to another buffer.