[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9730: 24.0.50; `M-o' should not be _invoked_ in `global-set-key'

From: Lars Ingebrigtsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Nicolas Richard <address@hidden> writes:

> Lars Ingebrigtsen <address@hidden> writes:
> [...]
>>>> Stefan Monnier <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]