Bind up/down in ecomplete
* lisp/ecomplete.el (ecomplete-display-matches): Allow using up/down in addition to M-p/M-n.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user