diff options
| author | Stefan Monnier | 2008-04-14 18:11:52 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-14 18:11:52 +0000 |
| commit | d8e1753cfd4ab293f45b565bc81dabbb7b61da1a (patch) | |
| tree | e172fc74db2dc1466f9d456f073715e207572783 | |
| parent | 30b775ff5d957e00a4151efaa7814bfb3181fe18 (diff) | |
| download | emacs-d8e1753cfd4ab293f45b565bc81dabbb7b61da1a.tar.gz emacs-d8e1753cfd4ab293f45b565bc81dabbb7b61da1a.zip | |
(file-cache-completions-keymap): Move init from
file-cache-completion-setup-function into declaration.
(file-cache-minibuffer-complete): Simplify.
(file-cache-completion-setup-function): Use standard-output,
preserve current-buffer.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/filecache.el | 32 |
2 files changed, 17 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ed590f9c3e6..9b26b793005 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2008-04-14 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-04-14 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * filecache.el (file-cache-completions-keymap): Move init from | ||
| 4 | file-cache-completion-setup-function into declaration. | ||
| 5 | (file-cache-minibuffer-complete): Simplify. | ||
| 6 | (file-cache-completion-setup-function): Use standard-output, | ||
| 7 | preserve current-buffer. | ||
| 8 | |||
| 3 | * vc.el (vc-status-update): Fix typo. | 9 | * vc.el (vc-status-update): Fix typo. |
| 4 | (vc-status-update): Set needs-update. | 10 | (vc-status-update): Set needs-update. |
| 5 | (vc-status-refresh): η-reduce. | 11 | (vc-status-refresh): η-reduce. |
diff --git a/lisp/filecache.el b/lisp/filecache.el index d3336abaac4..7e1d39a9ad3 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el | |||
| @@ -259,7 +259,12 @@ Defaults to nil on DOS and Windows, and t on other systems." | |||
| 259 | (defvar file-cache-alist nil | 259 | (defvar file-cache-alist nil |
| 260 | "Internal data structure to hold cache of file names.") | 260 | "Internal data structure to hold cache of file names.") |
| 261 | 261 | ||
| 262 | (defvar file-cache-completions-keymap nil | 262 | (defvar file-cache-completions-keymap |
| 263 | (let ((map (make-sparse-keymap))) | ||
| 264 | (set-keymap-parent map completion-list-mode-map) | ||
| 265 | (define-key map [mouse-2] 'file-cache-mouse-choose-completion) | ||
| 266 | (define-key map "\C-m" 'file-cache-choose-completion) | ||
| 267 | map) | ||
| 263 | "Keymap for file cache completions buffer.") | 268 | "Keymap for file cache completions buffer.") |
| 264 | 269 | ||
| 265 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 270 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -609,14 +614,10 @@ the name is considered already unique; only the second substitution | |||
| 609 | (substring completion-string (length string))) | 614 | (substring completion-string (length string))) |
| 610 | ;; Add our own setup function to the Completions Buffer | 615 | ;; Add our own setup function to the Completions Buffer |
| 611 | (let ((completion-setup-hook | 616 | (let ((completion-setup-hook |
| 612 | (reverse | 617 | (append completion-setup-hook |
| 613 | (append (list 'file-cache-completion-setup-function) | 618 | (list 'file-cache-completion-setup-function)))) |
| 614 | completion-setup-hook))) | ||
| 615 | ) | ||
| 616 | (with-output-to-temp-buffer file-cache-completions-buffer | 619 | (with-output-to-temp-buffer file-cache-completions-buffer |
| 617 | (display-completion-list completion-list string)) | 620 | (display-completion-list completion-list string)))) |
| 618 | ) | ||
| 619 | ) | ||
| 620 | (setq file-cache-string (file-cache-file-name completion-string)) | 621 | (setq file-cache-string (file-cache-file-name completion-string)) |
| 621 | (if (string= file-cache-string (minibuffer-contents)) | 622 | (if (string= file-cache-string (minibuffer-contents)) |
| 622 | (file-cache-temp-minibuffer-message | 623 | (file-cache-temp-minibuffer-message |
| @@ -653,19 +654,8 @@ the name is considered already unique; only the second substitution | |||
| 653 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 654 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 654 | 655 | ||
| 655 | (defun file-cache-completion-setup-function () | 656 | (defun file-cache-completion-setup-function () |
| 656 | (set-buffer file-cache-completions-buffer) | 657 | (with-current-buffer standard-output ;; i.e. file-cache-completions-buffer |
| 657 | 658 | (use-local-map file-cache-completions-keymap))) | |
| 658 | (if file-cache-completions-keymap | ||
| 659 | nil | ||
| 660 | (setq file-cache-completions-keymap | ||
| 661 | (copy-keymap completion-list-mode-map)) | ||
| 662 | (define-key file-cache-completions-keymap [mouse-2] | ||
| 663 | 'file-cache-mouse-choose-completion) | ||
| 664 | (define-key file-cache-completions-keymap "\C-m" | ||
| 665 | 'file-cache-choose-completion)) | ||
| 666 | |||
| 667 | (use-local-map file-cache-completions-keymap) | ||
| 668 | ) | ||
| 669 | 659 | ||
| 670 | (defun file-cache-choose-completion () | 660 | (defun file-cache-choose-completion () |
| 671 | "Choose a completion in the `*Completions*' buffer." | 661 | "Choose a completion in the `*Completions*' buffer." |