all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Nicolas Richard <nrichard@ulb.ac.be>
Cc: 9730@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
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	[thread overview]
Message-ID: <87zis9y4ke.fsf@gnus.org> (raw)
In-Reply-To: <87d1p9vo41.fsf@ulb.ac.be> (Nicolas Richard's message of "Thu, 28 Apr 2016 15:50:38 +0200")

Nicolas Richard <nrichard@ulb.ac.be> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
> [...]
>
>>>> Stefan Monnier <monnier@iro.umontreal.ca> 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





  reply	other threads:[~2016-05-01 19:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 18:30 bug#9730: 24.0.50; `M-o' should not be _invoked_ in `global-set-key' Drew Adams
2011-10-11 18:59 ` Stefan Monnier
2011-10-11 19:30   ` Drew Adams
2016-04-28 11:34   ` Lars Ingebrigtsen
2016-04-28 12:10     ` Stefan Monnier
2016-04-28 12:46       ` Lars Ingebrigtsen
2016-04-28 13:01         ` Nicolas Richard
2016-04-28 13:25           ` Lars Ingebrigtsen
2016-04-28 13:50             ` Nicolas Richard
2016-05-01 19:13               ` Lars Ingebrigtsen [this message]
2016-04-28 13:33         ` Stefan Monnier
2016-04-28 13:37           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zis9y4ke.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=9730@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nrichard@ulb.ac.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.