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: Sun, 11 Dec 2005 03:16:58 +0100 Message-ID: <439B8C1A.1050607@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> <87d5k478le.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080206080906030305030300" X-Trace: sea.gmane.org 1134267533 28775 80.91.229.2 (11 Dec 2005 02:18:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2005 02:18:53 +0000 (UTC) Cc: storm@cua.dk, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 03:18:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElGm4-00036c-Tv for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2005 03:17:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElGmU-0006TN-GX for ged-emacs-devel@m.gmane.org; Sat, 10 Dec 2005 21:17:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ElGmJ-0006TD-0a for emacs-devel@gnu.org; Sat, 10 Dec 2005 21:17:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ElGmI-0006Sz-0p for emacs-devel@gnu.org; Sat, 10 Dec 2005 21:17:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElGmH-0006Sw-Pp for emacs-devel@gnu.org; Sat, 10 Dec 2005 21:17:29 -0500 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ElGnj-0004mf-Qh; Sat, 10 Dec 2005 21:19:00 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.060.1) id 4396EEA4000FA672; Sun, 11 Dec 2005 03:16:59 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: Stefan Monnier In-Reply-To: <87d5k478le.fsf-monnier+emacs@gnu.org> 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:47424 Archived-At: This is a multi-part message in MIME format. --------------080206080906030305030300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Stefan Monnier wrote: >As Kim noticed, this is wrong: this translation is applied at the very end >by the "self-insertion" function (and only if the function was correctly >fixed to take this table into account). > > Thanks, I have already moved it. >Actually, minibuffer-local-map is nothing more than the keymap used as "local >keymap" in the minibuffers. So it shouldn't be in this list. > > Then maybe it should be placed in the item about "local keymap"? >Actually the above two are mutually exclusive: if a `local-map' property is >found, it's used instead of the local keymap. > > Thanks, I have change that. >This also applies to non-ASCII sequences. But it only applies if no binding >was found yet. > > Ok, I have changed that. But then I think the doc string for function-key-map is wrong. >Actually key-translation-map is different because it applies even if the >untranslated sequence already had a binding. Also those mappings are not >repeated. > > I did not notice that it could override keymaps. Would it be correct to place this item as the FIRST-MAP in the list, before special-event-map? I placed it there now. --------------080206080906030305030300 Content-Type: text/plain; name="finding-keymap.texi" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="finding-keymap.texi" @subsection Finding the keymap to use The list below describes step by step how Emacs finds a keymap from a given key sequence. As soon as a hit is found in any keymap (see @ref{Key Lookup}) then if the keymap entry is a function the search is over. However if the keymap entry is a variable symbol or a string then Emacs restarts with the variable symbol value or the string from FIRST-MAP. The keymap entry could also be a keymap. In that case the next event is looked up in that keymap. (But what happens if there is no hit there, I can not find any documentation on this???) @noindent @emph{Note 1:} When Emacs finally find a function symbol through this process it also checks for command remapping. This just replaces the function symbol with another. It is not recursive. @noindent @emph{Note 2:} Characters that are bound to @code{self-insert-command} are translated according to @code{translation-table-for-input} before insertion. @noindent @emph{Note 3:} You may find the function @code{current-active-maps} useful when looking into this. @table @asis @item START-HERE: First apply @code{extra-keyboard-modifiers} mask to each keyboard character read. @end table @itemize @bullet @item Each character read from the keyboard may be translated according to @code{keyboard-translate-table}. @item Translate meta characters according to @code{meta-prefix-char} to a two character sequence. @example For example, this normally maps M-x into ESC x. @end example @end itemize @table @asis @item FIRST-MAP: The key sequence is first searched for in @code{key-translation-map} which transforms it to a new key sequences if there is a hit. @end table @itemize @bullet @item Look in @code{special-event-map}. @example For example, this is where the @code{delete-frame} event is handled. @end example @item If overriding-terminal-local-map look in this. Then go to GLOBAL. @example This is for example used by @code{Incremental Search}. @end example @item If overriding-local-map look in this. Then go to GLOBAL. @item Is there a "keymap" property of the text or overlay at point? @item Look for minor mode keymaps in @code{emulation-mode-map-alists}. @example For example, this is used by @code{cua-mode} and @code{viper}. @end example @item Look for minor mode keymaps in @code{minor-mode-overriding-map-alist} @item Look for minor mode keymaps in @code{minor-mode-map-alist}. @item Is there a @code{local-map} property of the text or overlay at point? Otherwise is there a "local keymap" (those are for major modes)? In the minibuffer some special maps are used. If using @code{read-from-minibuffer} (directly or indirectly) then look in the keymap given as parameter then look in this. Otherwise look in @code{minibuffer-local-map}. If using @code{read-no-blanks-input} to read from minibuffer then look in @code{minibuffer-local-ns-map} first and then @code{minibuffer-local-map}. @end itemize @table @asis @item GLOBAL: Look in the "current global keymap". (This is returned by @code{current-global-map} and may be different from @code{global-map}, see @code{use-global-map}.) @end table @itemize @bullet @item Look in @code{function-key-map}. This map transforms to a new key sequences. @example This is for example used when running Emacs on a VT-100 terminal. Such terminal sends ASCII key sequences for function keys which are translated into a more general format Emacs uses. For example the sequence @code{ESC O P} is translated to [f1]. @end example @item If any transformation was made by @code{function-key-map} then take the new sequence and go back to FIRST-MAP. @end itemize --------------080206080906030305030300 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 --------------080206080906030305030300--