diff options
| -rw-r--r-- | lisp/ecomplete.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el index 2197d9512de..3f0d21c2305 100644 --- a/lisp/ecomplete.el +++ b/lisp/ecomplete.el | |||
| @@ -168,13 +168,15 @@ matches." | |||
| 168 | nil) | 168 | nil) |
| 169 | (setq highlight (ecomplete-highlight-match-line matches line)) | 169 | (setq highlight (ecomplete-highlight-match-line matches line)) |
| 170 | (let ((local-map (make-sparse-keymap)) | 170 | (let ((local-map (make-sparse-keymap)) |
| 171 | (prev-func (lambda () (setq line (max (1- line) 0)))) | ||
| 172 | (next-func (lambda () (setq line (min (1+ line) max-lines)))) | ||
| 171 | selected) | 173 | selected) |
| 172 | (define-key local-map (kbd "RET") | 174 | (define-key local-map (kbd "RET") |
| 173 | (lambda () (setq selected (nth line (split-string matches "\n"))))) | 175 | (lambda () (setq selected (nth line (split-string matches "\n"))))) |
| 174 | (define-key local-map (kbd "M-n") | 176 | (define-key local-map (kbd "M-n") next-func) |
| 175 | (lambda () (setq line (min (1+ line) max-lines)))) | 177 | (define-key local-map (kbd "<down>") next-func) |
| 176 | (define-key local-map (kbd "M-p") | 178 | (define-key local-map (kbd "M-p") prev-func) |
| 177 | (lambda () (setq line (max (1- line) 0)))) | 179 | (define-key local-map (kbd "<up>") prev-func) |
| 178 | (let ((overriding-local-map local-map)) | 180 | (let ((overriding-local-map local-map)) |
| 179 | (while (and (null selected) | 181 | (while (and (null selected) |
| 180 | (setq command (read-key-sequence highlight)) | 182 | (setq command (read-key-sequence highlight)) |