changeset 18928:fff55212f6a7

(iswitchb-get-bufname): Only add buffer of current window if it is not already in list.
author Richard M. Stallman <rms@gnu.org>
date Thu, 24 Jul 1997 03:36:42 +0000
parents 45fd6af9ccde
children 073e0019f9d9
files lisp/iswitchb.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/iswitchb.el	Wed Jul 23 21:41:47 1997 +0000
+++ b/lisp/iswitchb.el	Thu Jul 24 03:36:42 1997 +0000
@@ -697,9 +697,13 @@
 
 (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