]> code.delx.au - gnu-emacs/commitdiff
Allow `global-set-key' to bind keys under the `M-o' map
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 1 May 2016 19:15:06 +0000 (21:15 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 1 May 2016 19:15:06 +0000 (21:15 +0200)
* lisp/subr.el (global-set-key): Allow binding keys under the
`M-o' map (bug#9730).

lisp/subr.el

index 5f8d830051c3956df366a13b53fe5af85d20058d..afc86a77f8d2e03fbd698f9f29cde07c08c2ff4c 100644 (file)
@@ -849,7 +849,12 @@ above 127 (such as ISO Latin-1) can be included if you use a vector.
 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))