GNU bug report logs - #16312
24.3.50; Docstring fix for `set-transient-map' (and tangents...)

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Wed, 1 Jan 2014 03:11:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16312 in the body.
You can then email your comments to 16312 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16312; Package emacs. (Wed, 01 Jan 2014 03:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Phil Sainty <psainty <at> orcon.net.nz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 01 Jan 2014 03:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Docstring fix for `set-transient-map' (and tangents...)
Date: Wed, 01 Jan 2014 16:09:46 +1300
The docstring for `set-transient-map' states:

> Note that MAP will take precedence over the \"overriding\" maps
> `overriding-terminal-local-map' and `overriding-local-map' (and
> over the `keymap' text property).  Unlike those maps, if no match
> for a key is found in MAP, Emacs continues the normal key lookup
> sequence.

The NEWS file suggests that this info is now incorrect for the
former of those two:

> * Incompatible Lisp Changes in Emacs 24.4
>
> ** `overriding-terminal-local-map' no longer replaces the local keymaps.
> It used to disable the minor mode, major mode, and text-property keymaps,
> whereas now it simply has higher precedence.

So perhaps that docstring paragraph should now simply read:

"Note that MAP will take precedence over the \"overriding\" maps
`overriding-terminal-local-map' and `overriding-local-map' (and
over the `keymap' text property).  If no match for a key is found
in MAP, Emacs continues the normal key lookup sequence."



I also see the phrase "the keymap char property" in the docstring for
`overriding-local-map'. Should that read "the keymap text property"? Or
is this because there's a keymap Overlay property as well, and the
`get-char-property' function checks them both? (This seems likely, but
might imply that the reference to "the `keymap' text property" in
set-transient-map is insufficient, iff that also needs to cover overlay
properties?)

I'm afraid I'm not very familiar with text properties and overlays, so
I'm not sure which is the preferred term here. I would imagine that
this issue (with two types of 'keymap' properties) might crop up in
a number of places, so perhaps there's already an agreed way of
describing it for documentation purposes?

I suspect this would be less confusing were it not for the info node
"(elisp) Character Properties" which is unconnected to `get-char-property'
(instead we have `get-char-code-property' to obtain these "Character
Properties". It seems to me that this is mostly an unfortunate naming
clash with a standard Unicode term, but as such the info nodes could
probably benefit from some up-front clarifications to make the distinction
between the two types of "char property" and associated function naming
schemes clear from the outset?

Perhaps the "Character Properties" node should even be renamed to
"Character Code Properties" to better align with the function names?
This concept in Emacs sounds as if it's a super-set of the Unicode
Character Property Model, so it possibly doesn't *need* to have that
exact name?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16312; Package emacs. (Wed, 01 Jan 2014 15:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 16312 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Phil Sainty <psainty <at> orcon.net.nz>, 16312 <at> debbugs.gnu.org
Subject: RE: bug#16312: 24.3.50; Docstring fix for `set-transient-map' (and
 tangents...)
Date: Wed, 1 Jan 2014 07:54:41 -0800 (PST)
> I also see the phrase "the keymap char property" in the docstring for
> `overriding-local-map'. Should that read "the keymap text property"? Or
> is this because there's a keymap Overlay property as well, and the
> `get-char-property' function checks them both? (This seems likely, but
> might imply that the reference to "the `keymap' text property" in
> set-transient-map is insufficient, iff that also needs to cover overlay
> properties?)
> 
> I'm afraid I'm not very familiar with text properties and overlays, so
> I'm not sure which is the preferred term here. I would imagine that
> this issue (with two types of 'keymap' properties) might crop up in
> a number of places, so perhaps there's already an agreed way of
> describing it for documentation purposes?
> 
> I suspect this would be less confusing were it not for the info node
> "(elisp) Character Properties" which is unconnected to `get-char-property'
> (instead we have `get-char-code-property' to obtain these "Character
> Properties". It seems to me that this is mostly an unfortunate naming
> clash with a standard Unicode term, but as such the info nodes could
> probably benefit from some up-front clarifications to make the distinction
> between the two types of "char property" and associated function naming
> schemes clear from the outset?
> 
> Perhaps the "Character Properties" node should even be renamed to
> "Character Code Properties" to better align with the function names?
> This concept in Emacs sounds as if it's a super-set of the Unicode
> Character Property Model, so it possibly doesn't *need* to have that
> exact name?

Eli has pointed out elsewhere that "character property" properly belongs
to the sense of node "Character Properties", so that it should not be
used also to refer to both text properties and overlay properties.

IOW, `get-char-property' is misnamed.  Its name should not be taken as
a guide to documenting text & overlay properties as "character"
properties.

I too was confused about this, and had suggested updating some doc
to use "character property" to refer to both text & overlay properties.
In fact, I used it that way in my own code (doc and function names).
Based on Eli's explanation, I corrected my code in this regard.

It might even be good to rename `get-char-property' (keeping the
original name for backward compatibility, of course).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16312; Package emacs. (Thu, 02 Jan 2014 20:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 16312 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: 16312 <at> debbugs.gnu.org
Subject: Re: bug#16312: 24.3.50; Docstring fix for `set-transient-map' (and
 tangents...)
Date: Fri, 03 Jan 2014 09:36:21 +1300
On 2/01/2014 04:54, Drew Adams wrote:
> It might even be good to rename `get-char-property' (keeping the
> original name for backward compatibility, of course).

I certainly think it would be an improvement to rename *something*
here. I'm not sure what to suggest, but inconsistent naming is
generally a bad thing, and this example is definitely confusing.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16312; Package emacs. (Thu, 15 Jul 2021 05:20:01 GMT) Full text and rfc822 format available.

Message #14 received at 16312 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 16312 <at> debbugs.gnu.org
Subject: Re: bug#16312: 24.3.50; Docstring fix for `set-transient-map' (and
 tangents...)
Date: Thu, 15 Jul 2021 07:18:50 +0200
Phil Sainty <psainty <at> orcon.net.nz> writes:

> The docstring for `set-transient-map' states:
>
>> Note that MAP will take precedence over the \"overriding\" maps
>> `overriding-terminal-local-map' and `overriding-local-map' (and
>> over the `keymap' text property).  Unlike those maps, if no match
>> for a key is found in MAP, Emacs continues the normal key lookup
>> sequence.
>
> The NEWS file suggests that this info is now incorrect for the
> former of those two:
>
>> * Incompatible Lisp Changes in Emacs 24.4
>>
>> ** `overriding-terminal-local-map' no longer replaces the local keymaps.
>> It used to disable the minor mode, major mode, and text-property keymaps,
>> whereas now it simply has higher precedence.

It seems like this was fixed in:

commit ec00f20f553cdd37c1261a5a228ec762fc9b5497
Author:     Stefan Monnier <monnier <at> iro.umontreal.ca>
AuthorDate: Mon Jan 6 14:29:39 2014 -0500

> I also see the phrase "the keymap char property" in the docstring for
> `overriding-local-map'. Should that read "the keymap text property"? Or
> is this because there's a keymap Overlay property as well, and the
> `get-char-property' function checks them both?

Yup.  I've now clarified this in the doc string in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 16312 <at> debbugs.gnu.org and Phil Sainty <psainty <at> orcon.net.nz> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Jul 2021 05:20:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Aug 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 251 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.