all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#4393: 23.1; doc string of accessible-keymaps
@ 2009-09-10 23:31 ` Drew Adams
  2009-09-11  2:06   ` Stefan Monnier
  2009-09-11 19:30   ` bug#4393: marked as done (23.1; doc string of accessible-keymaps) Emacs bug Tracking System
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2009-09-10 23:31 UTC (permalink / raw
  To: bug-gnu-emacs

emacs -Q
 
In *scratch* type this:
(accessible-keymaps (current-global-map))
 
Put point after the sexp, and do `C-u C-x C-e'.
 
You get the eval result inserted just after the sexp. The result has a
mouse-face property (highlight).
 
Put point at the beginning of the result (just after the initial
sexp). Hit RET - the display of the result changes between full and
abbreviated.
 
An aside: it took me a while to figure out what was happening, and why
RET didn't insert a newline here. (You can't use C-j to insert a
newline in *scratch*, so I'm in the habit of hitting RET.)
 
I wonder if something shouldn't be added to the doc for C-x C-e about
this. There is nothing that prepares the user for the effect
(highlighted sexp, hijacked mouse-2 behavior, so you can no longer
yank into the sexp, hijacked RET behavior, so you cannot shorten
lines, etc.). And there should be some explanation of how to turn OFF
this wonderful highlighting and RET/mouse-2 behavior.
 
Since it seems to be C-x C-e that has this effect, it is the doc of
C-x C-e that should cover this.
 
Anyway, on to the bug...
 
Search for [f2] in the result sexp. You'll find this:
([f2] . t). That's one of the entries in the alist returned by
`accessible-keymaps'.
 
There are two other entries with cdr = t: ([24 11] . t) and
([24 54] . t). All the other entries have a keymap as cdr.
 
However, the doc string of `accessible-keymaps' says this:
 
 "Returns a list of elements of the form (KEYS . MAP),
  where the sequence KEYS starting from keymap gets you to MAP."
 
You'll note that it doesn't tell you what MAP is. But you could
presume that MAP would be a keymap, since the doc string also says,
"Find all keymaps accessible...".
 
However, (keymapp t) returns nil; `t' is not a keymap. The doc needs
to make clear what MAP is. In particular, it needs to explain that it
is not necessarily a keymap. It should perhaps explain what `t' means
as a value for MAP, or at least point you to the manual section that
explains it (which section is it?).
 
I searched the Elisp manual for some possibility of a keymap being
just `t', but I didn't find anything related to this. The manual says
clearly that a keymap is a cons whose car is `keymap' and whose cdr...
`t' is not a cons with car `keymap'. The doc for `keymapp' says,
similarly, that a keymap must be a cons with car `keymap'.
 
So at a minimum there is a doc bug here (for `accessible-keymaps', at
least). I wonder too if there isn't a code bug - is it correct for the
MAP of an entry to be `t'?
 

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 







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

* bug#4393: 23.1; doc string of accessible-keymaps
  2009-09-10 23:31 ` bug#4393: 23.1; doc string of accessible-keymaps Drew Adams
@ 2009-09-11  2:06   ` Stefan Monnier
  2009-09-11 14:23     ` Drew Adams
  2009-09-11 19:30   ` bug#4393: marked as done (23.1; doc string of accessible-keymaps) Emacs bug Tracking System
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2009-09-11  2:06 UTC (permalink / raw
  To: Drew Adams; +Cc: bug-gnu-emacs, 4393

> (accessible-keymaps (current-global-map))
[...]
> Search for [f2] in the result sexp. You'll find this:
> ([f2] . t). That's one of the entries in the alist returned by
> `accessible-keymaps'.
> There are two other entries with cdr = t: ([24 11] . t) and
> ([24 54] . t). All the other entries have a keymap as cdr.
 
It turns out that these are prefixes bound to autoloaded keymaps that
haven't yet been loaded (and they also happen to be the same keymap).
`accessible-keymaps' does not autoload keymaps.  I guess it should
return ([f2] . 2C-command) and  ([24 54] . 2C-command).


        Stefan





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

* bug#4393: 23.1; doc string of accessible-keymaps
  2009-09-11  2:06   ` Stefan Monnier
@ 2009-09-11 14:23     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2009-09-11 14:23 UTC (permalink / raw
  To: 'Stefan Monnier'; +Cc: bug-gnu-emacs, 4393

> > (accessible-keymaps (current-global-map))
> [...]
> > Search for [f2] in the result sexp. You'll find this:
> > ([f2] . t). That's one of the entries in the alist returned by
> > `accessible-keymaps'.
> > There are two other entries with cdr = t: ([24 11] . t) and
> > ([24 54] . t). All the other entries have a keymap as cdr.
>  
> It turns out that these are prefixes bound to autoloaded keymaps that
> haven't yet been loaded (and they also happen to be the same keymap).
> `accessible-keymaps' does not autoload keymaps.  I guess it should
> return ([f2] . 2C-command) and  ([24 54] . 2C-command).

OK, so if I understand right, this is not a lack of explanation in the doc of
accessible-keymaps, but is a code bug that will be fixed.







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

* bug#4393: marked as done (23.1; doc string of accessible-keymaps)
  2009-09-10 23:31 ` bug#4393: 23.1; doc string of accessible-keymaps Drew Adams
  2009-09-11  2:06   ` Stefan Monnier
@ 2009-09-11 19:30   ` Emacs bug Tracking System
  1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2009-09-11 19:30 UTC (permalink / raw
  To: Stefan Monnier

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

Your message dated Fri, 11 Sep 2009 15:21:35 -0400
with message-id <jwvd45xnva7.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#4393: 23.1; doc string of accessible-keymaps
has caused the Emacs bug report #4393,
regarding 23.1; doc string of accessible-keymaps
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4393: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4393
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5431 bytes --]

From: "Drew Adams" <drew.adams@oracle.com>
To: <bug-gnu-emacs@gnu.org>
Subject: 23.1; doc string of accessible-keymaps
Date: Thu, 10 Sep 2009 16:31:14 -0700
Message-ID: <5AEE0882D73D443C9293E91EDEB9C00B@us.oracle.com>

emacs -Q
 
In *scratch* type this:
(accessible-keymaps (current-global-map))
 
Put point after the sexp, and do `C-u C-x C-e'.
 
You get the eval result inserted just after the sexp. The result has a
mouse-face property (highlight).
 
Put point at the beginning of the result (just after the initial
sexp). Hit RET - the display of the result changes between full and
abbreviated.
 
An aside: it took me a while to figure out what was happening, and why
RET didn't insert a newline here. (You can't use C-j to insert a
newline in *scratch*, so I'm in the habit of hitting RET.)
 
I wonder if something shouldn't be added to the doc for C-x C-e about
this. There is nothing that prepares the user for the effect
(highlighted sexp, hijacked mouse-2 behavior, so you can no longer
yank into the sexp, hijacked RET behavior, so you cannot shorten
lines, etc.). And there should be some explanation of how to turn OFF
this wonderful highlighting and RET/mouse-2 behavior.
 
Since it seems to be C-x C-e that has this effect, it is the doc of
C-x C-e that should cover this.
 
Anyway, on to the bug...
 
Search for [f2] in the result sexp. You'll find this:
([f2] . t). That's one of the entries in the alist returned by
`accessible-keymaps'.
 
There are two other entries with cdr = t: ([24 11] . t) and
([24 54] . t). All the other entries have a keymap as cdr.
 
However, the doc string of `accessible-keymaps' says this:
 
 "Returns a list of elements of the form (KEYS . MAP),
  where the sequence KEYS starting from keymap gets you to MAP."
 
You'll note that it doesn't tell you what MAP is. But you could
presume that MAP would be a keymap, since the doc string also says,
"Find all keymaps accessible...".
 
However, (keymapp t) returns nil; `t' is not a keymap. The doc needs
to make clear what MAP is. In particular, it needs to explain that it
is not necessarily a keymap. It should perhaps explain what `t' means
as a value for MAP, or at least point you to the manual section that
explains it (which section is it?).
 
I searched the Elisp manual for some possibility of a keymap being
just `t', but I didn't find anything related to this. The manual says
clearly that a keymap is a cons whose car is `keymap' and whose cdr...
`t' is not a cons with car `keymap'. The doc for `keymapp' says,
similarly, that a keymap must be a cons with car `keymap'.
 
So at a minimum there is a doc bug here (for `accessible-keymaps', at
least). I wonder too if there isn't a code bug - is it correct for the
MAP of an entry to be `t'?
 

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 




[-- Attachment #3: Type: message/rfc822, Size: 3315 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Subject: Re: bug#4393: 23.1; doc string of accessible-keymaps
Date: Fri, 11 Sep 2009 15:21:35 -0400
Message-ID: <jwvd45xnva7.fsf-monnier+emacsbugreports@gnu.org>

>> > (accessible-keymaps (current-global-map))
>> [...]
>> > Search for [f2] in the result sexp. You'll find this:
>> > ([f2] . t). That's one of the entries in the alist returned by
>> > `accessible-keymaps'.
>> > There are two other entries with cdr = t: ([24 11] . t) and
>> > ([24 54] . t). All the other entries have a keymap as cdr.
>> 
>> It turns out that these are prefixes bound to autoloaded keymaps that
>> haven't yet been loaded (and they also happen to be the same keymap).
>> `accessible-keymaps' does not autoload keymaps.  I guess it should
>> return ([f2] . 2C-command) and  ([24 54] . 2C-command).

> OK, so if I understand right, this is not a lack of explanation in the doc of
> accessible-keymaps, but is a code bug that will be fixed.

Actually, I believe I fixed it yesterday with the below,


        Stefan


Index: src/keymap.c
===================================================================
RCS file: /sources/emacs/emacs/src/keymap.c,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -r1.384 -r1.385
--- src/keymap.c	11 Sep 2009 00:59:05 -0000	1.384
+++ src/keymap.c	11 Sep 2009 02:14:07 -0000	1.385
@@ -292,7 +292,7 @@
 		  goto autoload_retry;
 		}
 	      else
-	      	return Qt;
+	      	return object;
 	    }
 	}
     }

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

* bug#4393: 23.1; doc string of accessible-keymaps
       [not found] <jwvd45xnva7.fsf-monnier+emacsbugreports@gnu.org>
  2009-09-10 23:31 ` bug#4393: 23.1; doc string of accessible-keymaps Drew Adams
@ 2009-09-11 20:21 ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2009-09-11 20:21 UTC (permalink / raw
  To: 'Stefan Monnier', 4393

> Actually, I believe I fixed it yesterday with the below,

Great; thanks. Looking forward to it.

Unfortunately, this bug is also in Emacs 22, so version-agnostic code will still
need to filter with (when (keymapp x)...). FYI, it's not a problem before Emacs
22.

Thx - Drew






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

end of thread, other threads:[~2009-09-11 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <jwvd45xnva7.fsf-monnier+emacsbugreports@gnu.org>
2009-09-10 23:31 ` bug#4393: 23.1; doc string of accessible-keymaps Drew Adams
2009-09-11  2:06   ` Stefan Monnier
2009-09-11 14:23     ` Drew Adams
2009-09-11 19:30   ` bug#4393: marked as done (23.1; doc string of accessible-keymaps) Emacs bug Tracking System
2009-09-11 20:21 ` bug#4393: 23.1; doc string of accessible-keymaps Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.