GNU bug report logs -
#30309
C-u M-x insert-kbd-macro RET RET inserts many unrelated "bindings" (menu separators?)
Previous Next
Reported by: Robert Pluim <rpluim <at> gmail.com>
Date: Wed, 31 Jan 2018 16:28:01 UTC
Severity: minor
Tags: confirmed, easy
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Robert Pluim <rpluim <at> gmail.com> writes:
> That would work as well. Something like this (utterly untested beyond
> 'insert-kbd-macro'):
> DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0,
> doc: /* Return list of keys that invoke DEFINITION.
> +If DEFINITION is nil, return nil.
> + if (NILP (definition))
> + return Qnil;
> +
Hmm, on the one hand no keys invoke 'nil', so returning nil in that
situation is already covered by the current docstring (and doing
something else could be considered a plain bug). On the other hand, I
see it returns keys for which (define-key global-map KEY nil) was
called, which is potentially useful. I don't know if anything uses
that, but I hesitate to remove the capability.
By the way, I noticed the diff below also fixes this bug, although I
don't quite understand why.
--- i/lisp/macros.el
+++ w/lisp/macros.el
@@ -127,7 +127,7 @@ (defun insert-kbd-macro (macroname &optional keys)
(insert ")\n")
(if keys
(let ((keys (or (where-is-internal (symbol-function macroname)
- '(keymap))
+ '(keymap) nil t)
(where-is-internal macroname '(keymap)))))
(while keys
(insert "(global-set-key ")
This bug report was last modified 3 years and 178 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.