diff options
| author | Stefan Monnier | 2011-05-02 22:52:52 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-02 22:52:52 -0300 |
| commit | 1bcace585fbe6d1c6a6c879de861bb2539a29832 (patch) | |
| tree | 0dc3474c25dd3658277c226f0c57a7d1ba8158ad /lisp | |
| parent | 52d3c2d04d2709030f251eda950a72ee11f1b030 (diff) | |
| download | emacs-1bcace585fbe6d1c6a6c879de861bb2539a29832.tar.gz emacs-1bcace585fbe6d1c6a6c879de861bb2539a29832.zip | |
* lisp/simple.el (minibuffer-local-shell-command-map): Use completion-at-point.
(minibuffer-complete-shell-command): Remove.
(read-shell-command): Setup completion vars here instead.
(read-expression-map): Bind TAB to symbol completion.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 24 |
2 files changed, 19 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba3b7b62a98..63fef4f8069 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-05-03 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2011-05-03 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * simple.el (minibuffer-complete-shell-command): Remove. | ||
| 4 | (minibuffer-local-shell-command-map): Use completion-at-point. | ||
| 5 | (read-shell-command): Setup completion vars here instead. | ||
| 6 | (read-expression-map): Bind TAB to symbol completion. | ||
| 7 | |||
| 3 | * textmodes/ispell.el (lookup-words): Use with-temp-buffer; signal | 8 | * textmodes/ispell.el (lookup-words): Use with-temp-buffer; signal |
| 4 | error directly rather via storing it into `results'. | 9 | error directly rather via storing it into `results'. |
| 5 | 10 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 3cfc579aad0..9fd221819c5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1154,6 +1154,9 @@ in *Help* buffer. See also the command `describe-char'." | |||
| 1154 | ;; Initialize read-expression-map. It is defined at C level. | 1154 | ;; Initialize read-expression-map. It is defined at C level. |
| 1155 | (let ((m (make-sparse-keymap))) | 1155 | (let ((m (make-sparse-keymap))) |
| 1156 | (define-key m "\M-\t" 'lisp-complete-symbol) | 1156 | (define-key m "\M-\t" 'lisp-complete-symbol) |
| 1157 | ;; Might as well bind TAB to completion, since inserting a TAB char is much | ||
| 1158 | ;; too rarely useful. | ||
| 1159 | (define-key m "\t" 'lisp-complete-symbol) | ||
| 1157 | (set-keymap-parent m minibuffer-local-map) | 1160 | (set-keymap-parent m minibuffer-local-map) |
| 1158 | (setq read-expression-map m)) | 1161 | (setq read-expression-map m)) |
| 1159 | 1162 | ||
| @@ -2168,19 +2171,10 @@ to the end of the list of defaults just after the default value." | |||
| 2168 | (defvar shell-file-name-chars) | 2171 | (defvar shell-file-name-chars) |
| 2169 | (defvar shell-file-name-quote-list) | 2172 | (defvar shell-file-name-quote-list) |
| 2170 | 2173 | ||
| 2171 | (defun minibuffer-complete-shell-command () | ||
| 2172 | "Dynamically complete shell command at point." | ||
| 2173 | (interactive) | ||
| 2174 | (require 'shell) | ||
| 2175 | (let ((comint-delimiter-argument-list shell-delimiter-argument-list) | ||
| 2176 | (comint-file-name-chars shell-file-name-chars) | ||
| 2177 | (comint-file-name-quote-list shell-file-name-quote-list)) | ||
| 2178 | (run-hook-with-args-until-success 'shell-dynamic-complete-functions))) | ||
| 2179 | |||
| 2180 | (defvar minibuffer-local-shell-command-map | 2174 | (defvar minibuffer-local-shell-command-map |
| 2181 | (let ((map (make-sparse-keymap))) | 2175 | (let ((map (make-sparse-keymap))) |
| 2182 | (set-keymap-parent map minibuffer-local-map) | 2176 | (set-keymap-parent map minibuffer-local-map) |
| 2183 | (define-key map "\t" 'minibuffer-complete-shell-command) | 2177 | (define-key map "\t" 'completion-at-point) |
| 2184 | map) | 2178 | map) |
| 2185 | "Keymap used for completing shell commands in minibuffer.") | 2179 | "Keymap used for completing shell commands in minibuffer.") |
| 2186 | 2180 | ||
| @@ -2189,8 +2183,18 @@ to the end of the list of defaults just after the default value." | |||
| 2189 | The arguments are the same as the ones of `read-from-minibuffer', | 2183 | The arguments are the same as the ones of `read-from-minibuffer', |
| 2190 | except READ and KEYMAP are missing and HIST defaults | 2184 | except READ and KEYMAP are missing and HIST defaults |
| 2191 | to `shell-command-history'." | 2185 | to `shell-command-history'." |
| 2186 | (require 'shell) | ||
| 2192 | (minibuffer-with-setup-hook | 2187 | (minibuffer-with-setup-hook |
| 2193 | (lambda () | 2188 | (lambda () |
| 2189 | (set (make-local-variable 'comint-delimiter-argument-list) | ||
| 2190 | shell-delimiter-argument-list) | ||
| 2191 | (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) | ||
| 2192 | (set (make-local-variable 'comint-file-name-quote-list) | ||
| 2193 | shell-file-name-quote-list) | ||
| 2194 | (set (make-local-variable 'comint-dynamic-complete-functions) | ||
| 2195 | shell-dynamic-complete-functions) | ||
| 2196 | (add-hook 'completion-at-point-functions | ||
| 2197 | 'comint-completion-at-point nil 'local) | ||
| 2194 | (set (make-local-variable 'minibuffer-default-add-function) | 2198 | (set (make-local-variable 'minibuffer-default-add-function) |
| 2195 | 'minibuffer-default-add-shell-commands)) | 2199 | 'minibuffer-default-add-shell-commands)) |
| 2196 | (apply 'read-from-minibuffer prompt initial-contents | 2200 | (apply 'read-from-minibuffer prompt initial-contents |