]> git.eshelyaron.com Git - emacs.git/commitdiff
(iswitchb-read-buffer): When selecting a match from
authorStephen Eglen <stephen@gnu.org>
Tue, 15 Sep 2009 11:38:15 +0000 (11:38 +0000)
committerStephen Eglen <stephen@gnu.org>
Tue, 15 Sep 2009 11:38:15 +0000 (11:38 +0000)
the  virtual-buffers, use the name of the buffer specified by
find-file-noselect, as the match may be a symlink.  (This was a
problem if the target and the symlink had differet names.)

lisp/ChangeLog
lisp/iswitchb.el

index 5545992e8e224245d0d0adcf0bd3565b775dd318..532c89656c13222c94004b020069d48c86c4b220 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-15  Stephen Eglen  <stephen@gnu.org>
+
+       * iswitchb.el (iswitchb-read-buffer): When selecting a match from
+       the  virtual-buffers, use the name of the buffer specified by
+       find-file-noselect, as the match may be a symlink.  (This was a
+       problem if the target and the symlink had differet names.)
+
 2009-09-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * custom.el (custom-initialize-default, custom-initialize-set): CSE.
index 802b45d23b1cdc9af54188a35c38c7faf77f8caf..8a800143bd2059a21e392fd33b6e1fba253cd66c 100644 (file)
@@ -657,9 +657,12 @@ the selection process begins.  Used by isearchb.el."
     ;; that file now and act as though that buffer had been selected.
     (if (and iswitchb-virtual-buffers
             (not (iswitchb-existing-buffer-p)))
-       (let ((virt (car iswitchb-virtual-buffers)))
-         (find-file-noselect (cdr virt))
-         (setq iswitchb-matches (list (car virt))
+       (let ((virt (car iswitchb-virtual-buffers))
+             (new-buf))
+         ;; Keep the name of the buffer returned by find-file-noselect, as 
+         ;; the buffer 'virt' could be a symlink to a file of a different name.
+         (setq new-buf (buffer-name (find-file-noselect (cdr virt))))
+         (setq iswitchb-matches (list new-buf)
                iswitchb-virtual-buffers nil)))
 
     ;; Handling the require-match must be done in a better way.