From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79966 Path: news.gmane.org!not-for-mail From: Kan-Ru Chen Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] ecomplete.el: Intercept key sequence from terminal as well. Date: Wed, 21 Sep 2011 19:22:01 +0800 Message-ID: <87k4922l9i.fsf@isil.kanru.info> References: <1315917809-9724-1-git-send-email-kanru@kanru.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316604196 30158 80.91.229.12 (21 Sep 2011 11:23:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2011 11:23:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28261@lists.math.uh.edu Wed Sep 21 13:23:12 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R6KtT-0002jN-Lj for ding-account@gmane.org; Wed, 21 Sep 2011 13:23:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1R6Ksk-0007DD-2o; Wed, 21 Sep 2011 06:22:26 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1R6Ksi-0007D3-VX for ding@lists.math.uh.edu; Wed, 21 Sep 2011 06:22:24 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1R6Kse-0008DV-3G for ding@lists.math.uh.edu; Wed, 21 Sep 2011 06:22:24 -0500 Original-Received: from mail-yi0-f44.google.com ([209.85.218.44]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1R6Ksc-000812-I9 for ding@gnus.org; Wed, 21 Sep 2011 13:22:18 +0200 Original-Received: by yic13 with SMTP id 13so1225639yic.17 for ; Wed, 21 Sep 2011 04:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:in-reply-to:date:message-id:references :user-agent:mime-version:content-type; bh=Fn9S/NXqFsJZseXM5552Wfgu3TVOrZ5wSXPp/0ru61A=; b=wJQbil5nfNa2b7ZxtW5+7xVE8eMe0lpxJYxCUJGG2bbdwV05lIKBkrQaeSJh20tnXN uqzgyDHLqr4SZQJ80feRTkVNbi0GTVQJprK3xyxcmr+uUub/G8TzPFBHAhc0L691WZ66 fo7tJhzp554VoTCEiwk0Ze4nOmjqZUt/GrLAA= Original-Received: by 10.236.165.99 with SMTP id d63mr4165080yhl.86.1316604132698; Wed, 21 Sep 2011 04:22:12 -0700 (PDT) Original-Received: from isil.kanru.info ([61.57.131.211]) by mx.google.com with ESMTPS id y79sm6190109yhg.23.2011.09.21.04.22.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 04:22:10 -0700 (PDT) Original-Received: from localhost ([127.0.0.1] helo=isil.kanru.info) by isil.kanru.info with esmtp (Exim 4.76) (envelope-from ) id 1R6KsR-0002XH-9c for ding@gnus.org; Wed, 21 Sep 2011 19:22:07 +0800 In-Reply-To: <1315917809-9724-1-git-send-email-kanru@kanru.info> (Kan-Ru Chen's message of "Tue, 13 Sep 2011 20:43:29 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79966 Archived-At: ping? Kan-Ru Chen writes: > --- > 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 > + > + * ecomplete.el (ecomplete-display-matches): Intercept key sequence from > + terminal as well. > + > 2011-09-12 Lars Magne Ingebrigtsen > > * 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) -- Kanru