From 7690bdea13eadb315a9a78428ddce2e9886b4e01 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 27 Sep 2011 17:28:03 +0800 Subject: [PATCH] Accept cons cell HIST arg in ido-read-internal --- lisp/ChangeLog | 4 ++++ lisp/ido.el | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fa350161555..ec867fee08b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-09-27 Leo Liu + + * ido.el (ido-read-internal): Accept cons cell HIST arg. + 2011-09-25 Michael Albinus * net/dbus.el (dbus-unregister-object): Don't release services for diff --git a/lisp/ido.el b/lisp/ido.el index 4086000e3e9..46ac5784d0e 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1826,7 +1826,7 @@ This function also adds a hook to the minibuffer." ;; e.g. the file name may be ignored or joined with ido-current-directory, and ;; the relevant function is called (find-file, write-file, etc). -(defun ido-read-internal (item prompt history &optional default require-match initial) +(defun ido-read-internal (item prompt hist &optional default require-match initial) "Perform the `ido-read-buffer' and `ido-read-file-name' functions. Return the name of a buffer or file selected. PROMPT is the prompt to give to the user. @@ -1984,7 +1984,7 @@ If INITIAL is non-nil, it specifies the initial input string." (read-from-minibuffer (ido-make-prompt item prompt) (prog1 ido-text-init (setq ido-text-init nil)) - ido-completion-map nil history)))) + ido-completion-map nil hist)))) (ido-trace "read-from-minibuffer" ido-final-text) (if (get-buffer ido-completion-buffer) (kill-buffer ido-completion-buffer)) @@ -2155,7 +2155,12 @@ If INITIAL is non-nil, it specifies the initial input string." (t (setq done t)))))) - (add-to-history (or history 'minibuffer-history) ido-selected) + (add-to-history (cond + ((consp hist) + (or (car hist) 'minibuffer-history)) + (hist hist) + (t 'minibuffer-history)) + ido-selected) ido-selected)) (defun ido-edit-input () -- 2.39.2