From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Function for deleting a key binding in a sparse keymap Date: Wed, 14 Dec 2005 01:50:41 +0100 Message-ID: <439F6C61.4040807@student.lu.se> References: <3cc04a73cc1b1a.3cc1b1a3cc04a7@net.lu.se> <43987D21.4070200@student.lu.se> <4398C8F2.8060301@student.lu.se> <4399E538.2080909@student.lu.se> <439B688C.1090207@student.lu.se> <439CD53C.1070500@student.lu.se> <439DCAEA.5080204@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040407060805040203070508" X-Trace: sea.gmane.org 1134521573 7317 80.91.229.2 (14 Dec 2005 00:52:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2005 00:52:53 +0000 (UTC) Cc: storm@cua.dk, monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 01:52:51 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmKrh-0008IV-Lv for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2005 01:51:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmKsG-0000kK-BE for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 19:52:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmKra-0000jK-Mk for emacs-devel@gnu.org; Tue, 13 Dec 2005 19:51:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmKrY-0000iw-Ty for emacs-devel@gnu.org; Tue, 13 Dec 2005 19:51:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmKrY-0000it-HJ for emacs-devel@gnu.org; Tue, 13 Dec 2005 19:51:20 -0500 Original-Received: from [81.228.8.164] (helo=pne-smtpout2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EmKtW-00021M-8U; Tue, 13 Dec 2005 19:53:22 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout2-sn2.hy.skanova.net (7.2.069.1) id 439F230D00011469; Wed, 14 Dec 2005 01:50:42 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: rms@gnu.org In-Reply-To: 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 X-Broken-Reverse-DNS: no host name found for IP address 199.232.75.2 Xref: news.gmane.org gmane.emacs.devel:47661 Archived-At: This is a multi-part message in MIME format. --------------040407060805040203070508 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Richard M. Stallman wrote: >I don't think that belongs in this node. These things should be >documented elsewhere. What is needed here is a brief statement that >key lookup is separate from key input, with mention of >read-key-sequence, and an xref. > > I have made a much shorter version. > The keymap entry could also be a keymap. In that case the next event > is looked up in that keymap. > > (@strong{But what happens if there is no hit there, I can not find any > documentation on this???}) > >The question is not clear. "No hit there"--where is "there"? > > It was just a silly misunderstanding of me. I have removed it. > @noindent > @strong{Remark 2:} Characters that are bound to > @code{self-insert-command} are translated according to > @code{translation-table-for-input} before insertion. > >How self-insert-command works is not part of this topic. >It might be desirable to add this info somewhere else, >but here it does not belong. > > I think a link to the place wher translation-table-for-input is explained would be good. BTW it would be easier to understand the purpose of this variable if it was named translation-table-for-insert. Is not that what it is? I kept the remark in the code but think it should be replaced with that link. > @noindent > @strong{Remark 3:} You may find the function > @code{current-active-maps} useful when looking into this. > >Such vagueness is unhelpful. Please say what the function does. >Then add an xref to it. > I have rewritten it but I do not know how to make an xref to it. I pretty much like the version I have attached now. --------------040407060805040203070508 Content-Type: text/plain; name="finding-keymap.texi" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="finding-keymap.texi" @subsection Finding the keymap and its entry to use After translation of the input events (@pxref{Translating Input}) Emacs looks in the active keymaps. As soon as a match is found (@pxref{Key Lookup}) and the keymap entry is a function the search is over. However if the keymap entry is a variable symbol or a string then Emacs replaces the input key sequences with the variable symbol value or the string and restarts searching in the active keymaps. Here is a pseudo-Lisp description of the order in which the active keymaps are searched: @lisp (or (if overriding-terminal-local-map (@var{find-in} overriding-terminal-local-map) (if overriding-local-map (@var{find-in} overriding-local-map) (or (@var{find-in} (get-text-property (point) 'keymap)) (@var{find-in-any} emulation-mode-map-alists) (@var{find-in-any} minor-mode-overriding-map-alist) (@var{find-in-any} minor-mode-map-alist) (@var{find-in} (get-text-property (point) 'local-map)) (@var{find-in} (current-local-map))))) (@var{find-in} (current-global-map))) @end lisp @noindent The @var{find-in} and @var{find-in-any} are pseudo functions that searches in one keymap respectively an alist of keymaps. @noindent @strong{Remark 1:} The finally found function may be remapped (@pxref{Remapping Commands}). @noindent @strong{Remark 2:} Characters that are bound to @code{self-insert-command} are translated according to @code{translation-table-for-input} before insertion. @noindent @strong{Remark 3:} @code{current-active-maps} returns a list of the currently active keymaps at (point). --------------040407060805040203070508 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------040407060805040203070508--