unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Using multiple minor-mode keymaps.
       [not found]   ` <5xwuwkw5sa.fsf@kfs2.cua.dk>
@ 2002-03-11  4:18     ` Tak Ota
  2002-03-11 19:05       ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Tak Ota @ 2002-03-11  4:18 UTC (permalink / raw)
  Cc: no-spam

Kim reminds me that `keymap' text property takes precedence over other
keymaps.  In table.el I have been using `local-map' text property
which I believe has been in Emacs before `keymap' text property came
around.

The edition 2.7 of the GNU Emacs Lisp Reference Manual states:

`local-map'
     You can specify a different keymap for some of the text in a
     buffer by means of the `local-map' property.  The property's value
     for the character after point, if non-`nil', is used for key
     lookup instead of the buffer's local map.  If the property value
     is a symbol, the symbol's function definition is used as the
     keymap.  *Note Active Keymaps::.

`keymap'
     The `keymap' property is similar to `local-map' but overrides the
     buffer's local map (and the map specified by the `local-map'
     property) rather than replacing it.

I now understand the difference in terms of precedence.  It sounds
like `keymap' is for overriding the `local-map' temporarily without
changing it.  But I want to know more about the purpose or recommended
use of the `keymap' text property.  Could someone enlighten me in this
area?  Thank you.

-Tak


10 Mar 2002 21:01:57 +0100: no-spam@cua.dk (Kim F. Storm) wrote:

> Tak Ota <Takaaki.Ota@am.sony.com> writes:
> 
> > 09 Mar 2002 23:35:54 +0100: no-spam@cua.dk (Kim F. Storm) wrote:
> > 
> > > Are you aware of the difference between the 'keymap and 'local-map
> > > text properties?  In 21.3, the keymap property takes precedence over
> > > all other keymaps, while local-map has lower priority that the
> > > minor-mode-keymaps (it has the same precedence as local-key-map (which
> > > is replaces)).
> > 
> > I didn't know that.  I should then use 'keymap text property instead
> > of 'local-map.  In deed, the latest elisp manual does explain the
> > relationship between the two.  Is 'keymap text property a new entry
> > from 21.3?  Thanks for the reminder.
> 
> No, it also existed before, but it had the same precedence as local-map.
> I suggested to change it to the "new order", and RMS agreed.
> 
> ++kfs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using multiple minor-mode keymaps.
  2002-03-11  4:18     ` Using multiple minor-mode keymaps Tak Ota
@ 2002-03-11 19:05       ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2002-03-11 19:05 UTC (permalink / raw)
  Cc: emacs-devel, no-spam

The `keymap' property is used for overriding just *part* of the local
map.  For most uses, `keymap' is better.  I am not sure if there is
still any good reason to use `local-map'.

I rewrote the text in the manual as follows:

@item keymap
@cindex keymap of character
@kindex keymap @r{(text property)}
The @code{keymap} property specifies an additional keymap for
commands.  The property's value for the character after point, if
non-@code{nil}, is used for key lookup before the buffer's local map.
(For mouse clicks, the @code{keymap} property of the character clicked
on is the one used.)  If the property value is a symbol, the symbol's
function definition is used as the keymap.  @xref{Active Keymaps}.

@item local-map
@kindex local-map @r{(text property)}
This property specifies a keymap to use @emph{instead of} the buffer's
local map.  If the property value is a symbol, the symbol's function
definition is used as the keymap.  For most purposes (perhaps all
purposes), the @code{keymap} is superior.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-11 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5xg039mks5.fsf@kfs2.cua.dk>
     [not found] ` <20020309.200417.107712392.Takaaki.Ota@am.sony.com>
     [not found]   ` <5xwuwkw5sa.fsf@kfs2.cua.dk>
2002-03-11  4:18     ` Using multiple minor-mode keymaps Tak Ota
2002-03-11 19:05       ` Richard Stallman

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