Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] ecomplete.el: Intercept key sequence from terminal as well.
@ 2011-09-13 12:43 Kan-Ru Chen
  2011-09-21 11:22 ` Kan-Ru Chen
  2011-09-21 11:30 ` Julien Danjou
  0 siblings, 2 replies; 5+ messages in thread
From: Kan-Ru Chen @ 2011-09-13 12:43 UTC (permalink / raw)
  To: ding; +Cc: Lars Magne Ingebrigtsen, Kan-Ru Chen

---
 lisp/ChangeLog    |    5 +++++
 lisp/ecomplete.el |    9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8b5f7e6..956f1f3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-13  Kan-Ru Chen  <kanru@kanru.info>
+
+	* ecomplete.el (ecomplete-display-matches): Intercept key sequence from
+	terminal as well.
+
 2011-09-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus.el (gnus-interactive-exit): Update defcustom spec.
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el
index 6a47b11..737c0db 100644
--- a/lisp/ecomplete.el
+++ b/lisp/ecomplete.el
@@ -123,14 +123,15 @@
 	    (message "%s" matches)
 	    nil)
 	(setq highlight (ecomplete-highlight-match-line matches line))
-	(while (not (memq (setq command (read-event highlight)) '(? return)))
+	(while (not (member (setq command (read-key-sequence-vector highlight))
+			    '([? ] [return] [?\r] [?\n] [?\C-g])))
 	  (cond
-	   ((eq command ?\M-n)
+	   ((member command '([27 ?n] [?\M-n]))
 	    (setq line (min (1+ line) max-lines)))
-	   ((eq command ?\M-p)
+	   ((member command '([27 ?p] [?\M-p]))
 	    (setq line (max (1- line) 0))))
 	  (setq highlight (ecomplete-highlight-match-line matches line)))
-	(when (eq command 'return)
+	(when (member command '([return] [?\r] [?\n]))
 	  (nth line (split-string matches "\n")))))))
 
 (defun ecomplete-highlight-match-line (matches line)
-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-21 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 12:43 [PATCH] ecomplete.el: Intercept key sequence from terminal as well Kan-Ru Chen
2011-09-21 11:22 ` Kan-Ru Chen
2011-09-21 11:30 ` Julien Danjou
2011-09-21 13:12   ` Kan-Ru Chen
2011-09-21 18:14     ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).