From: Richard M. Stallman Date: Thu, 24 Jul 1997 03:36:42 +0000 (+0000) Subject: (iswitchb-get-bufname): Only add buffer of current X-Git-Tag: emacs-20.1~1018 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae5ac7d044747ee1133d35530dde01c7cb0fad34;p=emacs.git (iswitchb-get-bufname): Only add buffer of current window if it is not already in list. --- 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