summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/iswitchb.el7
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6ed8101077d..4eaab18202c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2003-11-25 Stephen Eglen <stephen@gnu.org>
+
+ * iswitchb.el (iswitchb-read-buffer,iswitchb-exit-minibuffer):
+ iswitchb-exit is set to 'usefirst when user selects buffer at head
+ of list using RET. (Selecting buffers at the head of the list was
+ broken if the substring was also a complete buffername.)
+
2003-11-23 Kim F. Storm <storm@cua.dk>
* progmodes/compile.el (grep-command, grep-use-null-device)
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index d8f2a5cb214..51797da5605 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -610,7 +610,8 @@ If REQUIRE-MATCH is non-nil, an existing-buffer must be selected."
nil ;require-match [handled elsewhere]
nil ;initial-contents
'iswitchb-history)))
- (if (get-buffer iswitchb-final-text)
+ (if (and (not (eq iswitchb-exit 'usefirst))
+ (get-buffer iswitchb-final-text))
;; This happens for example if the buffer was chosen with the mouse.
(setq iswitchb-matches (list iswitchb-final-text)))
@@ -712,7 +713,9 @@ The result is stored in `iswitchb-common-match-string'."
(interactive)
(if (or (not iswitchb-require-match)
(iswitchb-existing-buffer-p))
- (throw 'exit nil)))
+ (progn
+ (setq iswitchb-exit 'usefirst)
+ (throw 'exit nil))))
(defun iswitchb-select-buffer-text ()
"Select the buffer named by the prompt.