unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: storm@cua.dk, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Function for deleting a key binding in a sparse keymap
Date: Wed, 14 Dec 2005 01:50:41 +0100	[thread overview]
Message-ID: <439F6C61.4040807@student.lu.se> (raw)
In-Reply-To: <E1EmEHr-0000yu-2m@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

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.

[-- Attachment #2: finding-keymap.texi --]
[-- Type: text/plain, Size: 1652 bytes --]

@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).

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-12-14  0:50 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08  9:32 Function for deleting a key binding in a sparse keymap LENNART BORGMAN
2005-12-08 14:24 ` Kim F. Storm
2005-12-08 15:03   ` Lennart Borgman
2005-12-08 16:53 ` Stefan Monnier
2005-12-08 18:36   ` Lennart Borgman
2005-12-08 18:56     ` Stefan Monnier
2005-12-08 23:59       ` Lennart Borgman
2005-12-09 11:24         ` Kim F. Storm
2005-12-09 15:03         ` Richard M. Stallman
2005-12-09 20:12           ` Lennart Borgman
2005-12-10  4:13             ` Richard M. Stallman
2005-12-10 23:45               ` Lennart Borgman
2005-12-11  1:12                 ` Stefan Monnier
2005-12-11  2:16                   ` Lennart Borgman
2005-12-11  8:14                     ` Stefan Monnier
2005-12-11 16:49                     ` Richard M. Stallman
2005-12-11 16:49                 ` Richard M. Stallman
2005-12-12  1:41                   ` Lennart Borgman
2005-12-12 15:52                     ` Stefan Monnier
2005-12-12 17:02                       ` Lennart Borgman
2005-12-13 15:52                         ` Stefan Monnier
2005-12-12 16:18                     ` Richard M. Stallman
2005-12-12 19:09                       ` Lennart Borgman
2005-12-13 17:50                         ` Richard M. Stallman
2005-12-14  0:50                           ` Lennart Borgman [this message]
2005-12-14 20:02                             ` Richard M. Stallman
2005-12-10 23:40             ` Kim F. Storm
2005-12-11  0:29               ` Lennart Borgman
2005-12-11  0:54                 ` Lennart Borgman
2005-12-11 16:49                   ` Richard M. Stallman
2005-12-08 23:14     ` Function for deleting a key binding in a sparse keymap - bug in menus? Lennart Borgman
  -- strict thread matches above, loose matches on Subject: below --
2005-12-04 23:58 Function for deleting a key binding in a sparse keymap Lennart Borgman
2005-12-05 16:38 ` Richard M. Stallman
2005-12-05 16:55   ` Lennart Borgman
2005-12-06 16:42     ` Richard M. Stallman
2005-12-06 17:04       ` Lennart Borgman
2005-12-06 21:26         ` Stefan Monnier
2005-12-06 22:18           ` Lennart Borgman
2005-12-06 22:28             ` Stefan Monnier
2005-12-06 23:01               ` Lennart Borgman
2005-12-07  1:56                 ` Stefan Monnier
2005-12-07  9:56                   ` Lennart Borgman
2005-12-07 10:13                   ` Lennart Borgman
2005-12-07 14:33                     ` Lennart Borgman
2005-12-08  9:10                       ` Kim F. Storm
2005-12-07 17:06         ` Richard M. Stallman
2005-12-07 17:12           ` Lennart Borgman
2005-12-05 19:42 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439F6C61.4040807@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).