From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: identifying meta-key bound functions from last-command-char? Date: Tue, 26 Feb 2008 11:21:18 +0900 Message-ID: References: <2cd46e7f0802251630h2cc2ae5di1d77ed3b87611416@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1203992536 17362 80.91.229.12 (26 Feb 2008 02:22:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2008 02:22:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Ken Manheimer" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 26 03:22:41 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JTpSl-0003Kb-Bb for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2008 03:22:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTpSF-0004jX-Dh for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2008 21:22:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTpRq-0004a4-S2 for emacs-devel@gnu.org; Mon, 25 Feb 2008 21:21:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTpRp-0004Z4-7o for emacs-devel@gnu.org; Mon, 25 Feb 2008 21:21:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTpRp-0004Z0-2s for emacs-devel@gnu.org; Mon, 25 Feb 2008 21:21:37 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTpRo-0005MV-HD for emacs-devel@gnu.org; Mon, 25 Feb 2008 21:21:37 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m1Q2LW0j011519; Tue, 26 Feb 2008 11:21:32 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m1Q2LWrp017872; Tue, 26 Feb 2008 11:21:32 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id m1Q2LIed027012; Tue, 26 Feb 2008 11:21:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1JTpRW-0001Vv-Ty; Tue, 26 Feb 2008 11:21:18 +0900 In-reply-to: <2cd46e7f0802251630h2cc2ae5di1d77ed3b87611416@mail.gmail.com> (ken.manheimer@gmail.com) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90458 Archived-At: In article <2cd46e7f0802251630h2cc2ae5di1d77ed3b87611416@mail.gmail.com>, "Ken Manheimer" writes: > [1 ] > in a recent emacs build a technique i've been using to deliberately fetch > key bindings according to the last-command-char is failing for meta-modified > keys. the problem is that, for meta-modified keys, > (characterp last-command-char) => nil > this breaks an approach like: > (key-binding (char-to-string last-command-char)) > i need some way to fetch bindings according to last-command-char for a > special key handler that i use in overlays and, (for example) in > allout.elallout-hotspot-key-handler, a pre-command-hook function. > though probably > overly complicated, it has worked through the released emacs 22. in the > recent cvs build (23.0.60), i get an error: > wrong-type-argument characterp 134217760 > (that's for "\M- " meta space, but the same things happens for other meta > keys.) i'm failing to figure out how to translate the meta-modified key to > something that i can use for key-binding, and presume i'm missing something > obvious. can someone steer me in the right direction? Unfortunately, I think Emacs doesn't have a clear view about how to handle an integer which contains a character code and meta-modifier masks. Is it a character or not? I think it's not a character but an event object, so the above code should be: (key-binding (vector last-command-char)) The related problem is when to change, for instance, (' ' | CTRL_MASK) to '\0'. Now Emacs signals an error when we type C-q C-SPC. --- Kenichi Handa handa@ni.aist.go.jp