summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2011-03-22 01:48:36 +0800
committerLeo Liu <sdl.web@gmail.com>2011-03-22 01:48:36 +0800
commitaf896da66a50ca020c8cb8293c4bf5ddfb0cb448 (patch)
tree415164243e8ab205d4ac02b14f1e6c61efad4590 /lisp
parent78f64af0ae54388453ad80171e6a1691818299af (diff)
downloademacs-af896da66a50ca020c8cb8293c4bf5ddfb0cb448.tar.gz
emacs-af896da66a50ca020c8cb8293c4bf5ddfb0cb448.tar.bz2
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.
Diffstat (limited to 'lisp')
-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 @@
+2011-03-21 Leo Liu <sdl.web@gmail.com>
+
+ * ido.el (ido-read-internal): Add ido-selected to history instead
+ of user input.
+
2011-03-21 Stefan Monnier <monnier@iro.umontreal.ca>
* 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."
(ido-completing-read t)
(ido-require-match require-match)
(ido-use-mycompletion-depth (1+ (minibuffer-depth)))
- (show-paren-mode nil))
+ (show-paren-mode nil)
+ ;; Postpone history adding till later
+ (history-add-new-input nil))
;; prompt the user for the file name
(setq ido-exit nil)
(setq ido-final-text
@@ -2158,6 +2160,7 @@ If INITIAL is non-nil, it specifies the initial input string."
(t
(setq done t))))))
+ (and history (add-to-history history ido-selected))
ido-selected))
(defun ido-edit-input ()