]> code.delx.au - gnu-emacs/blobdiff - lisp/iswitchb.el
(gdb-mouse-toggle-breakpoint-margin)
[gnu-emacs] / lisp / iswitchb.el
index ee06db6f78f3777de1f792ae7f8eb3e81f85aedf..081897a89b3bb935de2ff6386d5cda0a4cdbd4a9 100644 (file)
@@ -1027,8 +1027,8 @@ Return the modified list with the last element prepended to it."
 (defun iswitchb-kill-buffer ()
   "Kill the buffer at the head of `iswitchb-matches'."
   (interactive)
-  (let ( (enable-recursive-minibuffers t)
-        buf)
+  (let ((enable-recursive-minibuffers t)
+        buf)
 
     (setq buf (car iswitchb-matches))
     ;; check to see if buf is non-nil.
@@ -1042,8 +1042,10 @@ Return the modified list with the last element prepended to it."
          (if (get-buffer buf)
              ;; buffer couldn't be killed.
              (setq iswitchb-rescan t)
-           ;; else buffer was killed so remove name from list.
-           (setq iswitchb-buflist  (delq buf iswitchb-buflist)))))))
+           ;; Else `kill-buffer' succeeds so re-make the buffer list
+           ;; taking into account packages like uniquify may rename
+           ;; buffers
+           (iswitchb-make-buflist iswitchb-default))))))
 
 ;;; VISIT CHOSEN BUFFER
 (defun iswitchb-visit-buffer (buffer)
@@ -1274,7 +1276,7 @@ Modified from `icomplete-completions'."
     ;; consult the list of past visited files, to see if we can find
     ;; the file which the user might thought was still open.
     (when (and iswitchb-use-virtual-buffers (null comps)
-              (or recentf-list bookmark-alist))
+              recentf-list)
       (setq iswitchb-virtual-buffers nil)
       (let ((head recentf-list) name)
        (while head
@@ -1289,30 +1291,15 @@ Modified from `icomplete-completions'."
              (setq iswitchb-virtual-buffers
                    (cons (cons name (car head))
                          iswitchb-virtual-buffers)))
-         (setq head (cdr head))))
-      (let ((head bookmark-alist) name path)
-       (while head
-         (if (and (setq path (cdr (assq 'filename (cdar head))))
-                  (setq name (file-name-nondirectory path))
-                  (string-match (if iswitchb-regexp
-                                    iswitchb-text
-                                  (regexp-quote iswitchb-text)) name)
-                  (null (get-file-buffer path))
-                  (not (assoc name iswitchb-virtual-buffers))
-                  (not (iswitchb-ignore-buffername-p name))
-                  (file-exists-p path))
-             (setq iswitchb-virtual-buffers
-                   (cons (cons name path)
-                         iswitchb-virtual-buffers)))
-         (setq head (cdr head))))
-      (setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
-           comps (mapcar 'car iswitchb-virtual-buffers))
+         (setq head (cdr head)))
+       (setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
+             comps (mapcar 'car iswitchb-virtual-buffers))
        (let ((comp comps))
          (while comp
            (put-text-property 0 (length (car comp))
                               'face 'iswitchb-virtual-matches
                               (car comp))
-           (setq comp (cdr comp)))))
+           (setq comp (cdr comp))))))
 
     (cond ((null comps) (format " %sNo match%s"
                                open-bracket-determined