mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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:
parent
e462308f03
commit
70a4f9ee21
1 changed files with 6 additions and 4 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue