summaryrefslogtreecommitdiff
path: root/lisp/iswitchb.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-24 03:36:42 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-24 03:36:42 +0000
commitae5ac7d044747ee1133d35530dde01c7cb0fad34 (patch)
tree1eef9c4e723b4d62f8c266f241bae98068785058 /lisp/iswitchb.el
parent2c9210580bed526041b28f62b396122651fbf336 (diff)
downloademacs-ae5ac7d044747ee1133d35530dde01c7cb0fad34.tar.gz
(iswitchb-get-bufname): Only add buffer of current
window if it is not already in list.
Diffstat (limited to 'lisp/iswitchb.el')
-rw-r--r--lisp/iswitchb.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 4aa3803ea2a..9f184661442 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -697,9 +697,13 @@ current frame, rather than all frames, regardless of value of
(defun iswitchb-get-bufname (win)
"Used by `iswitchb-get-buffers-in-frames' to walk through all windows."
- (setq iswitchb-bufs-in-frame
- (cons (buffer-name (window-buffer win))
- iswitchb-bufs-in-frame)))
+ (let ((buf (buffer-name (window-buffer win))))
+ (if (not (member buf iswitchb-bufs-in-frame))
+ ;; Only add buf if it is not already in list.
+ ;; This prevents same buf in two different windows being
+ ;; put into the list twice.
+ (setq iswitchb-bufs-in-frame
+ (cons buf iswitchb-bufs-in-frame)))))
;;; FIND MATCHING BUFFERS