]> git.eshelyaron.com Git - emacs.git/commitdiff
Bind up/down in ecomplete
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 18 Jan 2018 11:16:23 +0000 (12:16 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 18 Jan 2018 11:16:30 +0000 (12:16 +0100)
* lisp/ecomplete.el (ecomplete-display-matches): Allow using
up/down in addition to M-p/M-n.

lisp/ecomplete.el

index 2197d9512de0fc2b243c00ce5425c31bef9ea7f9..3f0d21c2305e856f5e6a27b1a2143319c4adf745 100644 (file)
@@ -168,13 +168,15 @@ matches."
            nil)
        (setq highlight (ecomplete-highlight-match-line matches line))
        (let ((local-map (make-sparse-keymap))
+              (prev-func (lambda () (setq line (max (1- line) 0))))
+              (next-func (lambda () (setq line (min (1+ line) max-lines))))
              selected)
          (define-key local-map (kbd "RET")
            (lambda () (setq selected (nth line (split-string matches "\n")))))
-         (define-key local-map (kbd "M-n")
-           (lambda () (setq line (min (1+ line) max-lines))))
-         (define-key local-map (kbd "M-p")
-           (lambda () (setq line (max (1- line) 0))))
+         (define-key local-map (kbd "M-n") next-func)
+         (define-key local-map (kbd "<down>") next-func)
+         (define-key local-map (kbd "M-p") prev-func)
+         (define-key local-map (kbd "<up>") prev-func)
          (let ((overriding-local-map local-map))
            (while (and (null selected)
                        (setq command (read-key-sequence highlight))