From 53f9bb3fb4c2e5e4aeefd26b82044c26e9b9fd25 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Fri, 18 Nov 2011 19:37:31 +0100 Subject: [PATCH] * anything-config.el Add input history to *M-x and *apt. (anything-M-x-input-history, anything-c-apt-input-history): new. (anything-M-x): Add input hist. (anything-apt): same. --- anything-config.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/anything-config.el b/anything-config.el index e65e781..d6bc3b7 100644 --- a/anything-config.el +++ b/anything-config.el @@ -5803,6 +5803,8 @@ source.") ;; Documentation of commands available without quitting, ;; Show keybindings of commands. ;; Show history. +(defvar anything-M-x-input-history nil) + (defun* anything-M-x-get-major-mode-command-alist (mode-map) "Return alist of MODE-MAP." (loop for key being the key-seqs of mode-map using (key-bindings com) @@ -8921,7 +8923,7 @@ Only math* symbols are collected." (defvar anything-c-apt-show-command "apt-cache show '%s'") (defvar anything-c-apt-installed-packages nil) (defvar anything-c-apt-all-packages nil) - +(defvar anything-c-apt-input-history nil) (defun anything-c-apt-refresh () "Refresh installed candidates list." @@ -11895,6 +11897,7 @@ It is `anything' replacement of regular `M-x' `execute-extended-command'." (candidates-in-buffer) (action . identity))) :resume 'noresume + :history 'anything-M-x-input-history :buffer "*anything M-x*") (keyboard-quit))) (sym-com (intern command))) @@ -12095,15 +12098,16 @@ See also `anything-create--actions'." (anything-other-buffer 'anything-c-source-time-world "*anything world time*")) ;;;###autoload -(defun anything-apt (arg query) +(defun anything-apt (arg) "Preconfigured `anything' : frontend of APT package manager. With a prefix arg reload cache." - (interactive "P\nsSearch Package: ") - (when arg - (setq anything-c-apt-installed-packages nil) - (setq anything-c-apt-all-packages nil)) - (anything-1 :sources 'anything-c-source-apt - :prompt "Search Package: " :input query)) + (interactive "P") + (let ((query (read-string "Search Package: " nil 'anything-c-apt-input-history))) + (when arg (anything-c-apt-refresh)) + (anything-1 :sources 'anything-c-source-apt + :prompt "Search Package: " + :input query + :history 'anything-c-apt-input-history))) ;;;###autoload (defun anything-esh-pcomplete () -- 2.11.4.GIT