[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set-temporary-overlay-map seems poorly named

From: Jambunathan K
Subject: Re: set-temporary-overlay-map seems poorly named
Date: Sun, 22 Dec 2013 19:49:10 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jambunathan K <address@hidden> writes:

> Chong Yidong <address@hidden> writes:
>> This function, new in Emacs 24.4, seems to have nothing to do with
>> overlays in the usual Emacs sense.  So it's a bad name.
>> How about renaming it to `set-transient-keymap'?
> How about `set-temporary-keymap'?

The following node already uses TEMP-MAP to designate this.

,---- (info "(elisp) Searching Keymaps")
| TEMP-MAP is a pseudo variable that represents the effect of a
| `set-temporary-overlay-map' call.


,----  C-h f set-temporary-overlay-map
| Normally, MAP is used only once.  If the optional argument
| KEEP-PRED is t, MAP stays active if a key from MAP is used.
| KEEP-PRED can also be a function of no arguments: if it returns
| non-nil then MAP stays active.

In essence the map is "self-destructive".  The installer ALSO tells when
the transient map goes belly up.

I believe the notion of "self-destructive" is semantically more richer
than "transient" or "temporary".


Looking at instances where `set-temporary-keymap' is used, it seems it
helps to "extend" a command to an arbitrary length.

   C-x {z}+
   C-x TAB {left or right}+
   C-x C-+ {+ or - or 0}+

It is looks as if a "common prefix" is factored out of a key sequence.
So a key sequence like


becomes "reduced" to

  A B C D

i.e., A is "factored out".

So overlay-map in effects helps to create "command local" maps or to
create "sub-commands".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]