unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
@ 2011-10-31 18:24 Eli Zaretskii
  2011-11-19 13:57 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2011-10-31 18:24 UTC (permalink / raw)
  To: 9922

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

 emacs -Q
 C-h i
 C-x 5 b RET
 
Now switch to the frame that shows the "*info*" buffer and type

 M-: (y-or-n-p "Foo?") RET

After you hit RET, Emacs prompts in the minibuffer, and the tool bar
on the frame that shows "*scratch*" suddenly shows button
configuration of the Info mode!  It returns to its correct
configuration once you exit the minibuffer.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
d:/gnu/bzr/emacs/trunk/etc/DEBUG.


In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600)
 of 2011-10-31 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1255
  default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-h i <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <right> <right> <return> <next> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <right> <right> 
<right> <return> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <next> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <left> <left> <left> <left> <left> 
<left> <return> l C-x 5 b <return> <help-echo> <help-echo> 
<switch-frame> M-x r e v e r t - b <tab> <return> y 
M-x r e p o r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Composing main Info directory...done
Revert info buffer? (y or n)  y
Reverted d:/usr/emacs/info/emacs

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug info easymenu time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
multi-tty emacs)





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

* bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
  2011-10-31 18:24 bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame Eli Zaretskii
@ 2011-11-19 13:57 ` Eli Zaretskii
  2012-04-26 14:46   ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2011-11-19 13:57 UTC (permalink / raw)
  To: 9922

> Date: Mon, 31 Oct 2011 20:24:06 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
>  emacs -Q
>  C-h i
>  C-x 5 b RET
>  
> Now switch to the frame that shows the "*info*" buffer and type
> 
>  M-: (y-or-n-p "Foo?") RET
> 
> After you hit RET, Emacs prompts in the minibuffer, and the tool bar
> on the frame that shows "*scratch*" suddenly shows button
> configuration of the Info mode!  It returns to its correct
> configuration once you exit the minibuffer.

First, this is a regression: Emacs 23.3 does not exhibit this
behavior.

Second, the problem seems to be caused by this fragment from
subr.el:read-key:

	  (use-global-map
           (let ((map (make-sparse-keymap)))
             ;; Don't hide the menu-bar and tool-bar entries.
             (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
             (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
             map))

This seems as if it actually intends to produce the buggy behavior.
Curiously, the same code exists in Emacs 23.3, but the tool bars on
the other frames are not affected in Emacs 23.3.  I couldn't find the
change in Emacs 24 that are responsible for the different behavior.





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

* bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
  2011-11-19 13:57 ` Eli Zaretskii
@ 2012-04-26 14:46   ` Chong Yidong
  2012-04-26 15:09     ` Eli Zaretskii
  2012-04-27  1:01     ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Chong Yidong @ 2012-04-26 14:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9922

Eli Zaretskii <eliz@gnu.org> writes:

>>  emacs -Q
>>  C-h i
>>  C-x 5 b RET
>>  
>> Now switch to the frame that shows the "*info*" buffer and type
>> 
>>  M-: (y-or-n-p "Foo?") RET
>> 
>> After you hit RET, Emacs prompts in the minibuffer, and the tool bar
>> on the frame that shows "*scratch*" suddenly shows button
>> configuration of the Info mode!

> the problem seems to be caused by this fragment from subr.el:read-key:
>
> 	  (use-global-map
>            (let ((map (make-sparse-keymap)))
>              ;; Don't hide the menu-bar and tool-bar entries.
>              (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
>              (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
>              map))

The above `lookup-key' call returns the tool bar map generated by
evaluating `tool-bar-make-keymap' (which is the :filter function for the
menu item bound to [tool-bar]).  The value returned by that function is
frame- and buffer-specific, but because it gets applied to the
replacement global map, it takes effect in all frames.

Unfortunately, currently we don't have a way to tell `lookup-key' to
just return the menu item without evaluating :filter functions.  The
following hack would work around this for 24.1, though it's a bit
black-magicky.

Stefan, AFAICT think you wrote the code in question.  Opinions?


=== modified file 'lisp/subr.el'
*** lisp/subr.el	2012-04-19 06:04:05 +0000
--- lisp/subr.el	2012-04-26 14:40:59 +0000
***************
*** 2019,2025 ****
             (let ((map (make-sparse-keymap)))
               ;; Don't hide the menu-bar and tool-bar entries.
               (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
!              (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
               map))
  	  (aref	(catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
        (cancel-timer timer)
--- 2019,2027 ----
             (let ((map (make-sparse-keymap)))
               ;; Don't hide the menu-bar and tool-bar entries.
               (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
!              (define-key map [tool-bar]
! 	       (or (cdr (assq 'tool-bar global-map))
! 		   (lookup-key global-map [tool-bar])))
               map))
  	  (aref	(catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
        (cancel-timer timer)






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

* bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
  2012-04-26 14:46   ` Chong Yidong
@ 2012-04-26 15:09     ` Eli Zaretskii
  2012-04-27  1:01     ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2012-04-26 15:09 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 9922

> From: Chong Yidong <cyd@gnu.org>
> Cc: 9922@debbugs.gnu.org
> Date: Thu, 26 Apr 2012 22:46:47 +0800
> 
> The following hack would work around this for 24.1

It does, thanks.





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

* bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
  2012-04-26 14:46   ` Chong Yidong
  2012-04-26 15:09     ` Eli Zaretskii
@ 2012-04-27  1:01     ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2012-04-27  1:01 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 9922

> Unfortunately, currently we don't have a way to tell `lookup-key' to
> just return the menu item without evaluating :filter functions.  The
> following hack would work around this for 24.1, though it's a bit
> black-magicky.
> Stefan, AFAICT think you wrote the code in question.  Opinions?

I think it's an OK workaround, tho it needs a comment like "lookup-key
without running :filters".

A better approach might be to provide a lookup-key which doesn't
run :filters.  Tho semantically, this is a murky area: without running
the filter we can't know whether the binding is nil, a keymap, or
something else, so we can't know whether it hides (or merges with)
other bindings in parent keymaps.  IOW, such a function should probably
return a list of "raw unreduced bindings".


        Stefan


> === modified file 'lisp/subr.el'
> *** lisp/subr.el	2012-04-19 06:04:05 +0000
> --- lisp/subr.el	2012-04-26 14:40:59 +0000
> ***************
> *** 2019,2025 ****
>              (let ((map (make-sparse-keymap)))
>                ;; Don't hide the menu-bar and tool-bar entries.
>                (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
> !              (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
>                map))
>   	  (aref	(catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
>         (cancel-timer timer)
> --- 2019,2027 ----
>              (let ((map (make-sparse-keymap)))
>                ;; Don't hide the menu-bar and tool-bar entries.
>                (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
> !              (define-key map [tool-bar]
> ! 	       (or (cdr (assq 'tool-bar global-map))
> ! 		   (lookup-key global-map [tool-bar])))
>                map))
>   	  (aref	(catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
>         (cancel-timer timer)








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

end of thread, other threads:[~2012-04-27  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-31 18:24 bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame Eli Zaretskii
2011-11-19 13:57 ` Eli Zaretskii
2012-04-26 14:46   ` Chong Yidong
2012-04-26 15:09     ` Eli Zaretskii
2012-04-27  1:01     ` Stefan Monnier

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