emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r99439: iswitchb.el (iswitchb-complet


From: jwiegley
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99439: iswitchb.el (iswitchb-completions): Add bookmark files to the
Date: Wed, 03 Feb 2010 15:47:25 -0500
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99439
committer: address@hidden
branch nick: trunk
timestamp: Wed 2010-02-03 15:47:25 -0500
message:
  iswitchb.el (iswitchb-completions): Add bookmark files to the
  list of files considered for "virtual buffer" completions.
modified:
  lisp/ChangeLog
  lisp/iswitchb.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-02-03 06:16:34 +0000
+++ b/lisp/ChangeLog    2010-02-03 20:47:25 +0000
@@ -1,3 +1,8 @@
+2010-02-03  John Wiegley  <address@hidden>
+
+       * iswitchb.el (iswitchb-completions): Add bookmark files to the
+       list of files considered for "virtual buffer" completions.
+
 2010-02-03  Michael Albinus  <address@hidden>
 
        * net/ange-ftp.el (ange-ftp-insert-directory): Parse directory

=== modified file 'lisp/iswitchb.el'
--- a/lisp/iswitchb.el  2010-01-13 08:35:10 +0000
+++ b/lisp/iswitchb.el  2010-02-03 20:47:25 +0000
@@ -1274,7 +1274,7 @@
     ;; 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)
-              recentf-list)
+              (or recentf-list bookmark-alist))
       (setq iswitchb-virtual-buffers nil)
       (let ((head recentf-list) name)
        (while head
@@ -1289,15 +1289,30 @@
              (setq iswitchb-virtual-buffers
                    (cons (cons name (car head))
                          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))))
+      (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))
        (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


reply via email to

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