aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2011-03-22 01:48:36 +0800
committerLeo Liu2011-03-22 01:48:36 +0800
commitaf896da66a50ca020c8cb8293c4bf5ddfb0cb448 (patch)
tree415164243e8ab205d4ac02b14f1e6c61efad4590
parent78f64af0ae54388453ad80171e6a1691818299af (diff)
downloademacs-af896da66a50ca020c8cb8293c4bf5ddfb0cb448.tar.gz
emacs-af896da66a50ca020c8cb8293c4bf5ddfb0cb448.zip
Fix history adding in ido-read-internal
Assume, for example, the head of matches is "RSS" and user input is "rs". If the user hit RET, "RSS" is selected but "rs" is added to the history. This commit fixes this inconsistency.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/ido.el5
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5c119c37323..a52abe07b1f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-03-21 Leo Liu <sdl.web@gmail.com>
2
3 * ido.el (ido-read-internal): Add ido-selected to history instead
4 of user input.
5
12011-03-21 Stefan Monnier <monnier@iro.umontreal.ca> 62011-03-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * subr.el (deferred-action-list, deferred-action-function): 8 * subr.el (deferred-action-list, deferred-action-function):
diff --git a/lisp/ido.el b/lisp/ido.el
index 2a5c7cf2f0e..df7516993b7 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1978,7 +1978,9 @@ If INITIAL is non-nil, it specifies the initial input string."
1978 (ido-completing-read t) 1978 (ido-completing-read t)
1979 (ido-require-match require-match) 1979 (ido-require-match require-match)
1980 (ido-use-mycompletion-depth (1+ (minibuffer-depth))) 1980 (ido-use-mycompletion-depth (1+ (minibuffer-depth)))
1981 (show-paren-mode nil)) 1981 (show-paren-mode nil)
1982 ;; Postpone history adding till later
1983 (history-add-new-input nil))
1982 ;; prompt the user for the file name 1984 ;; prompt the user for the file name
1983 (setq ido-exit nil) 1985 (setq ido-exit nil)
1984 (setq ido-final-text 1986 (setq ido-final-text
@@ -2158,6 +2160,7 @@ If INITIAL is non-nil, it specifies the initial input string."
2158 2160
2159 (t 2161 (t
2160 (setq done t)))))) 2162 (setq done t))))))
2163 (and history (add-to-history history ido-selected))
2161 ido-selected)) 2164 ido-selected))
2162 2165
2163(defun ido-edit-input () 2166(defun ido-edit-input ()