From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#9730: 24.0.50; `M-o' should not be _invoked_ in `global-set-key' Date: Sun, 01 May 2016 21:13:37 +0200 Message-ID: <87zis9y4ke.fsf@gnus.org> References: <21C894E121B94123B84E10A93BF877D5@us.oracle.com> <87bn4unf0z.fsf@gnus.org> <874malnbnk.fsf@gnus.org> <87fuu5vqdu.fsf@ulb.ac.be> <87h9ellvb6.fsf@gnus.org> <87d1p9vo41.fsf@ulb.ac.be> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462130087 2290 80.91.229.3 (1 May 2016 19:14:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 May 2016 19:14:47 +0000 (UTC) Cc: 9730@debbugs.gnu.org, Stefan Monnier To: Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 01 21:14:36 2016 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 1awwp8-0000Z4-Us for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 May 2016 21:14:35 +0200 Original-Received: from localhost ([::1]:34041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awwp1-0001Ff-OZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 May 2016 15:14:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awwor-0000zI-C3 for bug-gnu-emacs@gnu.org; Sun, 01 May 2016 15:14:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awwof-0002GE-GM for bug-gnu-emacs@gnu.org; Sun, 01 May 2016 15:14:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awwof-0002Ez-Ci for bug-gnu-emacs@gnu.org; Sun, 01 May 2016 15:14:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1awwob-0004Ew-SI for bug-gnu-emacs@gnu.org; Sun, 01 May 2016 15:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 19:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9730-submit@debbugs.gnu.org id=B9730.146213003316278 (code B ref 9730); Sun, 01 May 2016 19:14:01 +0000 Original-Received: (at 9730) by debbugs.gnu.org; 1 May 2016 19:13:53 +0000 Original-Received: from localhost ([127.0.0.1]:60992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awwoP-0004EQ-OX for submit@debbugs.gnu.org; Sun, 01 May 2016 15:13:53 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:40675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awwoL-0004EE-Bz for 9730@debbugs.gnu.org; Sun, 01 May 2016 15:13:48 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1awwoD-0001Ud-Vd; Sun, 01 May 2016 21:13:41 +0200 In-Reply-To: <87d1p9vo41.fsf@ulb.ac.be> (Nicolas Richard's message of "Thu, 28 Apr 2016 15:50:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:117536 Archived-At: Nicolas Richard writes: > Lars Ingebrigtsen writes: > > [...] > >>>> Stefan Monnier writes: >>>>> It's the "kind of menu" that gets displayed in the minibuffer when you >>>>> hit M-o. > > [...] > >> but what's the code that ends up calling `message'? > > I think it's in keyboard.c, where read_char_minibuf_menu_prompt does: > > message3_nolog (apply1 (intern ("concat"), Fnreverse (menu_strings))); Aha. The menu stuff seems to be controlled by the `menu-prompting' variable, so I though `global-set-key' could just bind that variable. And that seems to work. I've now applied a patch to the trunk that seems to do the right thing. diff --git a/lisp/subr.el b/lisp/subr.el index 5f8d830..afc86a7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -849,7 +849,12 @@ global-set-key Note that if KEY has a local binding in the current buffer, that local binding will continue to shadow any global binding that you make with this function." - (interactive "KSet key globally: \nCSet key %s to command: ") + (interactive + (let* ((menu-prompting nil) + (key (read-key-sequence "Set key globally: "))) + (list key + (read-command (format "Set key %s to command: " + (key-description key)))))) (or (vectorp key) (stringp key) (signal 'wrong-type-argument (list 'arrayp key))) (define-key (current-global-map) key command)) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no