diff options
| author | Stephen Eglen | 2003-11-25 14:45:32 +0000 |
|---|---|---|
| committer | Stephen Eglen | 2003-11-25 14:45:32 +0000 |
| commit | 4dddd07f26ce4fb14adeda46465809e04e2b6cef (patch) | |
| tree | 664d9e89664c0746cc60fc2e4825c8d18554cb0b | |
| parent | 00498bfc928ebe82169895fa899785dec5c808e5 (diff) | |
| download | emacs-4dddd07f26ce4fb14adeda46465809e04e2b6cef.tar.gz emacs-4dddd07f26ce4fb14adeda46465809e04e2b6cef.zip | |
iswitchb-read-buffer: check that iswitchb-exit is not 'usefirst (set
when user presses RETURN to select buffer) before running:
;; This happens for example if the buffer was chosen with the mouse.
(setq iswitchb-matches (list iswitchb-final-text)))
iswitchb-exit-minibuffer: set iswitchb-exit to 'usefirst.
These changes were made to fix the following bug reported by Markus
Rost and John Wiegley:
Evaluate:
(progn
(iswitchb-mode 1)
(get-buffer-create "12")
(get-buffer-create "1")
(iswitchb-buffer))
You get prompted in the minibuffer. Type "1". The minibuffer shows
iswitch 1{12,1}
Hit RET. You find yourself in buffer "1" instead of "12", as you
would expect from the documentation.
This bug was introduced when iswitchb-read-buffer was updated to allow
user to select items from the *Completions* buffer with the mouse.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/iswitchb.el | 7 |
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 @@ | |||
| 1 | 2003-11-25 Stephen Eglen <stephen@gnu.org> | ||
| 2 | |||
| 3 | * iswitchb.el (iswitchb-read-buffer,iswitchb-exit-minibuffer): | ||
| 4 | iswitchb-exit is set to 'usefirst when user selects buffer at head | ||
| 5 | of list using RET. (Selecting buffers at the head of the list was | ||
| 6 | broken if the substring was also a complete buffername.) | ||
| 7 | |||
| 1 | 2003-11-23 Kim F. Storm <storm@cua.dk> | 8 | 2003-11-23 Kim F. Storm <storm@cua.dk> |
| 2 | 9 | ||
| 3 | * progmodes/compile.el (grep-command, grep-use-null-device) | 10 | * 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." | |||
| 610 | nil ;require-match [handled elsewhere] | 610 | nil ;require-match [handled elsewhere] |
| 611 | nil ;initial-contents | 611 | nil ;initial-contents |
| 612 | 'iswitchb-history))) | 612 | 'iswitchb-history))) |
| 613 | (if (get-buffer iswitchb-final-text) | 613 | (if (and (not (eq iswitchb-exit 'usefirst)) |
| 614 | (get-buffer iswitchb-final-text)) | ||
| 614 | ;; This happens for example if the buffer was chosen with the mouse. | 615 | ;; This happens for example if the buffer was chosen with the mouse. |
| 615 | (setq iswitchb-matches (list iswitchb-final-text))) | 616 | (setq iswitchb-matches (list iswitchb-final-text))) |
| 616 | 617 | ||
| @@ -712,7 +713,9 @@ The result is stored in `iswitchb-common-match-string'." | |||
| 712 | (interactive) | 713 | (interactive) |
| 713 | (if (or (not iswitchb-require-match) | 714 | (if (or (not iswitchb-require-match) |
| 714 | (iswitchb-existing-buffer-p)) | 715 | (iswitchb-existing-buffer-p)) |
| 715 | (throw 'exit nil))) | 716 | (progn |
| 717 | (setq iswitchb-exit 'usefirst) | ||
| 718 | (throw 'exit nil)))) | ||
| 716 | 719 | ||
| 717 | (defun iswitchb-select-buffer-text () | 720 | (defun iswitchb-select-buffer-text () |
| 718 | "Select the buffer named by the prompt. | 721 | "Select the buffer named by the prompt. |