From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier 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 21:01:40 -0400 Message-ID: References: <83zkghm33t.fsf@gnu.org> <83hb20b4g8.fsf@gnu.org> <87397q8sa0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1335488528 31558 80.91.229.3 (27 Apr 2012 01:02:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2012 01:02:08 +0000 (UTC) Cc: 9922@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 27 03:02:07 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 1SNZZW-0002UD-Mh for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2012 03:02:06 +0200 Original-Received: from localhost ([::1]:55460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNZZW-0003OR-32 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2012 21:02:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNZZT-0003OE-9f for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 21:02:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNZZR-0003o8-Gt for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 21:02:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNZZR-0003ny-DS for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 21:02:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SNZaP-0003M9-SB for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2012 21:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Apr 2012 01:03:01 +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.133548857012882 (code B ref 9922); Fri, 27 Apr 2012 01:03:01 +0000 Original-Received: (at 9922) by debbugs.gnu.org; 27 Apr 2012 01:02:50 +0000 Original-Received: from localhost ([127.0.0.1]:54845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SNZaD-0003Li-RV for submit@debbugs.gnu.org; Thu, 26 Apr 2012 21:02:50 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:43684) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SNZaC-0003LW-Dp for 9922@debbugs.gnu.org; Thu, 26 Apr 2012 21:02:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjIKACxOgk/O+LN8/2dsb2JhbABDtheCDAOBDIEIggkBAQQBViMFCwsOJhIUGA0kiBwFtjKLYYR5BKRFgV2DAw X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="176972509" Original-Received: from 206-248-179-124.dsl.teksavvy.com (HELO pastel.home) ([206.248.179.124]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 Apr 2012 21:01:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 64CF859005; Thu, 26 Apr 2012 21:01:40 -0400 (EDT) In-Reply-To: <87397q8sa0.fsf@gnu.org> (Chong Yidong's message of "Thu, 26 Apr 2012 22:46:47 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (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:59541 Archived-At: > 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)