GNU bug report logs - #20528
25.0.50; `keymap' property to work for symbol-value, not just symbol-function

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 7 May 2015 20:15:03 UTC

Severity: wishlist

Tags: wontfix

Found in version 25.0.50

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 20528 in the body.
You can then email your comments to 20528 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#20528; Package emacs. (Thu, 07 May 2015 20:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 May 2015 20:15:04 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; `keymap' property to work for symbol-value, not just
 symbol-function
Date: Thu, 7 May 2015 13:14:24 -0700 (PDT)
The `keymap' text or overlay property can have a value that is
`keymapp', which means that it can be a list with car `keymap' etc. or a
symbol whose `symbol-function' is a keymap.

Please allow it to also be a symbol, such as `Info-mode-map', whose
`symbol-value' is a keymap.  It is used only as a keymap.  It is not
used as a function.  It is convenient to be able to reuse an existing
keymap variable to provide a map for a given portion of text.

Likewise, for property `local-map'.

(I'm guessing that I cannot change Emacs to recognize this, myself,
because it involves the C level (e.g. `key-binding' or `lookup-key').
If I'm mistaken, please point me to the Lisp code that interprets
the keymap property, looks up a key in the map and invokes its command.)


In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20528; Package emacs. (Fri, 08 May 2015 06:39:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20528 <at> debbugs.gnu.org
Subject: Re: bug#20528: 25.0.50;
 `keymap' property to work for symbol-value, not just symbol-function
Date: Fri, 08 May 2015 08:38:22 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Please allow it to also be a symbol, such as `Info-mode-map', whose
> `symbol-value' is a keymap.  It is used only as a keymap.  It is not
> used as a function.  It is convenient to be able to reuse an existing
> keymap variable to provide a map for a given portion of text.

Why can't you dereference the variable when assigning the property?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20528; Package emacs. (Fri, 08 May 2015 15:27:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 20528 <at> debbugs.gnu.org
Subject: RE: bug#20528: 25.0.50; `keymap' property to work for symbol-value,
 not just symbol-function
Date: Fri, 8 May 2015 08:25:58 -0700 (PDT)
> > Please allow it to also be a symbol, such as `Info-mode-map',
> > whose `symbol-value' is a keymap.  It is used only as a keymap.
> > It is not used as a function.  It is convenient to be able to
> > reuse an existing keymap variable to provide a map for a given
> > portion of text.
> 
> Why can't you dereference the variable when assigning the property?

Why can't you dereference the function symbol when assigning the
property? ;-)  As I said, it is used here only as a keymap, not
as a function.

But the real reason is that I want to have `C-u C-x =' show the
variable name, not the raw keymap value (after [Show]).  In my
version, clicking that name then provides a human-readable
description of the keymap (from command `describe-keymap').

Anyway, my guess about requiring C code modification was wrong.
I've done what I wanted now, locally.  You can do likewise for
Emacs, if you want.  Or not.

The descr-text.el code is here:
http://www.emacswiki.org/emacs/download/descr-text%2b.el

Command `describe-keymap' is here:
http://www.emacswiki.org/emacs/download/help-fns%2b.el

All that's needed is to add a `help-keymap' button, and to use that
in `describe-property-list' for a keymap variable.  And to have
`describe-text-sexp' use action `describe-keymap' for a keymap var. 

Then, when you click on the keymap var name from `C-u C-x =', you
get a readable description of the keymap for that `keymap' or
`local-map' property.  Properties `keymap' and `local-map' are as
important as properties such as `face' for `what-cursor-position'
output, and they too can provide useful info here, if you let them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20528; Package emacs. (Fri, 08 May 2015 15:34:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20528 <at> debbugs.gnu.org
Subject: Re: bug#20528: 25.0.50;
 `keymap' property to work for symbol-value, not just symbol-function
Date: Fri, 08 May 2015 17:33:19 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

>> > Please allow it to also be a symbol, such as `Info-mode-map',
>> > whose `symbol-value' is a keymap.  It is used only as a keymap.
>> > It is not used as a function.  It is convenient to be able to
>> > reuse an existing keymap variable to provide a map for a given
>> > portion of text.
>> 
>> Why can't you dereference the variable when assigning the property?
>
> Why can't you dereference the function symbol when assigning the
> property? ;-)

That's how lisp works, fundamentally.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20528; Package emacs. (Fri, 08 May 2015 17:53:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20528 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#20528: 25.0.50;
 `keymap' property to work for symbol-value, not just symbol-function
Date: Fri, 08 May 2015 13:51:50 -0400
> Why can't you dereference the function symbol when assigning the
> property? ;-)

When the function symbol is used, often the reason is so that it works
even if the keymap is not yet defined (e.g. the keymap is autoloaded).

> But the real reason is that I want to have `C-u C-x =' show the
> variable name, not the raw keymap value (after [Show]).  In my

Would be nice, indeed.  But I'm not sure it's worth the hassle.


        Stefan




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Sep 2021 07:23:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20528 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Sep 2021 07:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20528; Package emacs. (Sat, 04 Sep 2021 07:24:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 20528 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#20528: 25.0.50; `keymap' property to work for symbol-value,
 not just symbol-function
Date: Sat, 04 Sep 2021 09:22:40 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Why can't you dereference the function symbol when assigning the
>> property? ;-)
>
> When the function symbol is used, often the reason is so that it works
> even if the keymap is not yet defined (e.g. the keymap is autoloaded).
>
>> But the real reason is that I want to have `C-u C-x =' show the
>> variable name, not the raw keymap value (after [Show]).  In my
>
> Would be nice, indeed.  But I'm not sure it's worth the hassle.

And I think it would make things more ambiguous -- today we only look at
the symbol's function value, and if we looked at both the function value
and the, er, value value, we'd have to come up with rules for
precedence.

So I think the way it works currently is fine, and I'm closing this bug
report.

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




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

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

Previous Next


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