aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-01-18 12:16:23 +0100
committerLars Ingebrigtsen2018-01-18 12:16:30 +0100
commit70a4f9ee21820381ead2bfe5f68e6cbf1e1e2dfe (patch)
tree94a980fbd8c33fd589baf6bac113c89bc995933d
parente462308f03c9c16c47abc82d6f339ca9d18898f9 (diff)
downloademacs-70a4f9ee21820381ead2bfe5f68e6cbf1e1e2dfe.tar.gz
emacs-70a4f9ee21820381ead2bfe5f68e6cbf1e1e2dfe.zip
Bind up/down in ecomplete
* lisp/ecomplete.el (ecomplete-display-matches): Allow using up/down in addition to M-p/M-n.
-rw-r--r--lisp/ecomplete.el10
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))