comparison lisp/iswitchb.el @ 109945:c5974968dea9

Fix buffer-list rename&refresh after after killing a buffer in ido. * lisp/ido.el: Revert scar's. (ido-kill-buffer-at-head): Exit the minibuffer with ido-exit=refresh. Remember the buffers at head, rather than their name. * lisp/iswitchb.el (iswitchb-kill-buffer): Re-make the list.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 21 Aug 2010 15:35:27 +0200
parents df3df0622e73
children 515d80e174ba 376148b31b5e
comparison
equal deleted inserted replaced
109944:48114bfd2ed3 109945:c5974968dea9
1025 ;;; KILL CURRENT BUFFER 1025 ;;; KILL CURRENT BUFFER
1026 1026
1027 (defun iswitchb-kill-buffer () 1027 (defun iswitchb-kill-buffer ()
1028 "Kill the buffer at the head of `iswitchb-matches'." 1028 "Kill the buffer at the head of `iswitchb-matches'."
1029 (interactive) 1029 (interactive)
1030 (let ( (enable-recursive-minibuffers t) 1030 (let ((enable-recursive-minibuffers t)
1031 buf) 1031 buf)
1032 1032
1033 (setq buf (car iswitchb-matches)) 1033 (setq buf (car iswitchb-matches))
1034 ;; check to see if buf is non-nil. 1034 ;; check to see if buf is non-nil.
1035 (if buf 1035 (if buf
1036 (progn 1036 (progn
1040 ;; for kill-buffer which does not return t if buffer is 1040 ;; for kill-buffer which does not return t if buffer is
1041 ;; killed, so we can't rely on kill-buffer return value. 1041 ;; killed, so we can't rely on kill-buffer return value.
1042 (if (get-buffer buf) 1042 (if (get-buffer buf)
1043 ;; buffer couldn't be killed. 1043 ;; buffer couldn't be killed.
1044 (setq iswitchb-rescan t) 1044 (setq iswitchb-rescan t)
1045 ;; else buffer was killed so remove name from list. 1045 ;; Else `kill-buffer' succeeds so re-make the buffer list
1046 (setq iswitchb-buflist (delq buf iswitchb-buflist))))))) 1046 ;; taking into account packages like uniquify may rename
1047 ;; buffers
1048 (iswitchb-make-buflist iswitchb-default))))))
1047 1049
1048 ;;; VISIT CHOSEN BUFFER 1050 ;;; VISIT CHOSEN BUFFER
1049 (defun iswitchb-visit-buffer (buffer) 1051 (defun iswitchb-visit-buffer (buffer)
1050 "Visit buffer named BUFFER according to `iswitchb-method'." 1052 "Visit buffer named BUFFER according to `iswitchb-method'."
1051 (let (win newframe) 1053 (let (win newframe)