diff options
| author | Kan-Ru Chen | 2011-09-21 12:23:49 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-09-21 12:23:49 +0000 |
| commit | e233ce558d12fdf9e0e69ea30c4558ec7477fea4 (patch) | |
| tree | 5eb344397d65448c3d58260b9b9d634941b11c60 | |
| parent | a7b88dc6d7f98eb036dd6ed7991e20bc0b163fc8 (diff) | |
| download | emacs-e233ce558d12fdf9e0e69ea30c4558ec7477fea4.tar.gz emacs-e233ce558d12fdf9e0e69ea30c4558ec7477fea4.zip | |
ecomplete.el (ecomplete-display-matches): Intercept key sequence from terminal as well.
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/ecomplete.el | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f3a6024069e..2487f21c151 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-09-13 Kan-Ru Chen <kanru@kanru.info> | ||
| 2 | |||
| 3 | * ecomplete.el (ecomplete-display-matches): Intercept key sequence from | ||
| 4 | terminal as well. | ||
| 5 | |||
| 1 | 2011-09-21 Katsumi Yamaoka <yamaoka@jpl.org> | 6 | 2011-09-21 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 7 | ||
| 3 | * mm-view.el (mm-display-inline-fontify): Don't run doc-view-mode | 8 | * mm-view.el (mm-display-inline-fontify): Don't run doc-view-mode |
diff --git a/lisp/gnus/ecomplete.el b/lisp/gnus/ecomplete.el index 6a47b119f10..737c0dba1d9 100644 --- a/lisp/gnus/ecomplete.el +++ b/lisp/gnus/ecomplete.el | |||
| @@ -123,14 +123,15 @@ | |||
| 123 | (message "%s" matches) | 123 | (message "%s" matches) |
| 124 | nil) | 124 | nil) |
| 125 | (setq highlight (ecomplete-highlight-match-line matches line)) | 125 | (setq highlight (ecomplete-highlight-match-line matches line)) |
| 126 | (while (not (memq (setq command (read-event highlight)) '(? return))) | 126 | (while (not (member (setq command (read-key-sequence-vector highlight)) |
| 127 | '([? ] [return] [?\r] [?\n] [?\C-g]))) | ||
| 127 | (cond | 128 | (cond |
| 128 | ((eq command ?\M-n) | 129 | ((member command '([27 ?n] [?\M-n])) |
| 129 | (setq line (min (1+ line) max-lines))) | 130 | (setq line (min (1+ line) max-lines))) |
| 130 | ((eq command ?\M-p) | 131 | ((member command '([27 ?p] [?\M-p])) |
| 131 | (setq line (max (1- line) 0)))) | 132 | (setq line (max (1- line) 0)))) |
| 132 | (setq highlight (ecomplete-highlight-match-line matches line))) | 133 | (setq highlight (ecomplete-highlight-match-line matches line))) |
| 133 | (when (eq command 'return) | 134 | (when (member command '([return] [?\r] [?\n])) |
| 134 | (nth line (split-string matches "\n"))))))) | 135 | (nth line (split-string matches "\n"))))))) |
| 135 | 136 | ||
| 136 | (defun ecomplete-highlight-match-line (matches line) | 137 | (defun ecomplete-highlight-match-line (matches line) |