emacs-devel
[Top][All Lists]
Advanced

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

Re: C-h k, C-h f and keyboard macros: Patch.


From: Kim F. Storm
Subject: Re: C-h k, C-h f and keyboard macros: Patch.
Date: 11 Feb 2003 14:10:42 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Luc Teirlinck <address@hidden> writes:

> Currently, `describe-key' (usually C-h k) and `describe-function'
> (usually C-h f) produce confusing output when confronted with a
> keyboard macro.

> New C-h k output:
> 
>     C-c 3 runs the command ott
>        which is a keyboard macro.
>     It is bound to C-c 3.
>     Macro: SPC one SPC two SPC three SPC
> 
>     Keyboard macro.
> 
> In other words, we get the "readable" and the "formal" definition,
> yielding no duplication in this case.

GREAT IDEA!!

> 
> An alternative to printing the `kmacro-display' output would be to
> just erase the offending line and not replace it with anything, but I
> find the `kmacro-display' output useful in situations where I do
> C-h k.  The patch affects C-h f in the same way as C-h k.

The problem with using kmacro-display is that it is intended for
interactive use, so it prints the macro definition using `message'.
It is better to use format-kbd-macro directly:

Index: help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.28
diff -c -r1.28 help-fns.el
*** help-fns.el 4 Feb 2003 11:23:06 -0000       1.28
--- help-fns.el 11 Feb 2003 12:10:17 -0000
***************
*** 323,328 ****
--- 323,331 ----
                                                 function)))))
                   usage)
                 (car usage))
+               ((or (stringp def)
+                    (vectorp def))
+                (format "\nMacro: %s" (format-kbd-macro def)))
                (t "[Missing arglist.  Please make a bug report.]")))
        (terpri))
        (let ((obsolete (and





reply via email to

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