From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame Date: Thu, 26 Apr 2012 22:46:47 +0800 Message-ID: <87397q8sa0.fsf@gnu.org> References: <83zkghm33t.fsf@gnu.org> <83hb20b4g8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1335451643 12296 80.91.229.3 (26 Apr 2012 14:47:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2012 14:47:23 +0000 (UTC) Cc: 9922@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 26 16:47:21 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SNPyZ-0007Sp-DV for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2012 16:47:19 +0200 Original-Received: from localhost ([::1]:41509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNPyY-0007Lu-P3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2012 10:47:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNPyS-0007LC-OJ for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 10:47:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNPyK-0003Xv-44 for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 10:47:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNPyK-0003Xr-15 for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 10:47:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SNPzG-0000m9-Fx for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 10:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Apr 2012 14:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9922 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9922-submit@debbugs.gnu.org id=B9922.13354516792971 (code B ref 9922); Thu, 26 Apr 2012 14:48:02 +0000 Original-Received: (at 9922) by debbugs.gnu.org; 26 Apr 2012 14:47:59 +0000 Original-Received: from localhost ([127.0.0.1]:54372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SNPzC-0000ls-Up for submit@debbugs.gnu.org; Thu, 26 Apr 2012 10:47:59 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:48910 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SNPz9-0000lk-J1 for 9922@debbugs.gnu.org; Thu, 26 Apr 2012 10:47:56 -0400 Original-Received: from bb116-14-12-6.singnet.com.sg ([116.14.12.6]:49226 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SNPyB-0002ta-2O; Thu, 26 Apr 2012 10:46:56 -0400 In-Reply-To: <83hb20b4g8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Nov 2011 15:57:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59519 Archived-At: Eli Zaretskii 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)