diff options
| author | Glenn Morris | 2013-10-16 14:23:15 -0400 |
|---|---|---|
| committer | Glenn Morris | 2013-10-16 14:23:15 -0400 |
| commit | 7a550bbb1a6be5a4a562e5c8aacee96014a985a9 (patch) | |
| tree | fb6348c410e970e35b86a76bb27462d7f7fa8373 | |
| parent | 0a2b8e3c26d7b8cf351b9ba337e32d18d4f63202 (diff) | |
| download | emacs-7a550bbb1a6be5a4a562e5c8aacee96014a985a9.tar.gz emacs-7a550bbb1a6be5a4a562e5c8aacee96014a985a9.zip | |
* lisp/tmm.el (tmm--history): New dynamic variable.
(tmm-prompt): Use tmm--history in place of `history'.
Fixes: debbugs:15623
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/tmm.el | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea8d936cf4c..914826db0b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * tmm.el (tmm--history): New dynamic variable. | ||
| 4 | (tmm-prompt): Use tmm--history in place of `history'. (Bug#15623) | ||
| 5 | |||
| 1 | 2013-10-16 Michael Albinus <michael.albinus@gmx.de> | 6 | 2013-10-16 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp-smb.el (tramp-smb-acl-program): New customer option. | 8 | * net/tramp-smb.el (tramp-smb-acl-program): New customer option. |
diff --git a/lisp/tmm.el b/lisp/tmm.el index 36c11a0f4b0..58c4bdeccfb 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -149,6 +149,8 @@ specify nil for this variable." | |||
| 149 | '(metadata (display-sort-function . identity)) | 149 | '(metadata (display-sort-function . identity)) |
| 150 | (complete-with-action action items string pred)))) | 150 | (complete-with-action action items string pred)))) |
| 151 | 151 | ||
| 152 | (defvar tmm--history nil) | ||
| 153 | |||
| 152 | ;;;###autoload | 154 | ;;;###autoload |
| 153 | (defun tmm-prompt (menu &optional in-popup default-item) | 155 | (defun tmm-prompt (menu &optional in-popup default-item) |
| 154 | "Text-mode emulation of calling the bindings in keymap. | 156 | "Text-mode emulation of calling the bindings in keymap. |
| @@ -167,7 +169,7 @@ Its value should be an event that has a binding in MENU." | |||
| 167 | ;; That is used for recursive calls only. | 169 | ;; That is used for recursive calls only. |
| 168 | (let ((gl-str "Menu bar") ;; The menu bar itself is not a menu keymap | 170 | (let ((gl-str "Menu bar") ;; The menu bar itself is not a menu keymap |
| 169 | ; so it doesn't have a name. | 171 | ; so it doesn't have a name. |
| 170 | tmm-km-list out history history-len tmm-table-undef tmm-c-prompt | 172 | tmm-km-list out history-len tmm-table-undef tmm-c-prompt |
| 171 | tmm-old-mb-map tmm-short-cuts | 173 | tmm-old-mb-map tmm-short-cuts |
| 172 | chosen-string choice | 174 | chosen-string choice |
| 173 | (not-menu (not (keymapp menu)))) | 175 | (not-menu (not (keymapp menu)))) |
| @@ -221,16 +223,18 @@ Its value should be an event that has a binding in MENU." | |||
| 221 | (setq index-of-default (1+ index-of-default))) | 223 | (setq index-of-default (1+ index-of-default))) |
| 222 | (setq tail (cdr tail))))) | 224 | (setq tail (cdr tail))))) |
| 223 | (let ((prompt (concat "^." (regexp-quote tmm-mid-prompt)))) | 225 | (let ((prompt (concat "^." (regexp-quote tmm-mid-prompt)))) |
| 224 | (setq history | 226 | (setq tmm--history |
| 225 | (reverse (delq nil | 227 | (reverse (delq nil |
| 226 | (mapcar | 228 | (mapcar |
| 227 | (lambda (elt) | 229 | (lambda (elt) |
| 228 | (if (string-match prompt (car elt)) | 230 | (if (string-match prompt (car elt)) |
| 229 | (car elt))) | 231 | (car elt))) |
| 230 | tmm-km-list))))) | 232 | tmm-km-list))))) |
| 231 | (setq history-len (length history)) | 233 | (setq history-len (length tmm--history)) |
| 232 | (setq history (append history history history history)) | 234 | (setq tmm--history (append tmm--history tmm--history |
| 233 | (setq tmm-c-prompt (nth (- history-len 1 index-of-default) history)) | 235 | tmm--history tmm--history)) |
| 236 | (setq tmm-c-prompt (nth (- history-len 1 index-of-default) | ||
| 237 | tmm--history)) | ||
| 234 | (setq out | 238 | (setq out |
| 235 | (if default-item | 239 | (if default-item |
| 236 | (car (nth index-of-default tmm-km-list)) | 240 | (car (nth index-of-default tmm-km-list)) |
| @@ -239,7 +243,7 @@ Its value should be an event that has a binding in MENU." | |||
| 239 | (concat gl-str | 243 | (concat gl-str |
| 240 | " (up/down to change, PgUp to menu): ") | 244 | " (up/down to change, PgUp to menu): ") |
| 241 | (tmm--completion-table tmm-km-list) nil t nil | 245 | (tmm--completion-table tmm-km-list) nil t nil |
| 242 | (cons 'history | 246 | (cons 'tmm--history |
| 243 | (- (* 2 history-len) index-of-default)))))))) | 247 | (- (* 2 history-len) index-of-default)))))))) |
| 244 | (setq choice (cdr (assoc out tmm-km-list))) | 248 | (setq choice (cdr (assoc out tmm-km-list))) |
| 245 | (and (null choice) | 249 | (and (null choice) |