emacs-devel
[Top][All Lists]
Advanced

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

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


From: Luc Teirlinck
Subject: C-h k, C-h f and keyboard macros: Patch.
Date: Mon, 10 Feb 2003 17:56:29 -0600 (CST)

Currently, `describe-key' (usually C-h k) and `describe-function'
(usually C-h f) produce confusing output when confronted with a
keyboard macro.  Bind any key to a keyboard macro and do C-h k.  The
output looks like:

    C-c 3 runs the command ott
       which is a keyboard macro.
    It is bound to C-c 3.
    [Missing arglist.  Please make a bug report.]

    Keyboard macro.

There is no missing arglist.  The following patch would replace the
confusing "[Missing arglist.  Please make a bug report.]" with a
description of the macro, provided by `kmacro-display'.

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.

It also seems to work well for keys bound directly to the macro
definition:

    C-c d runs the command [24 100 126]
       which is a keyboard macro.
    It is bound to C-c d.
    Macro: C-x d ~

    Keyboard macro.

In other words, we get the "readable" and the "formal" definition,
yielding no duplication in this case.

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.

Change log:

2003-02-10  Luc Teirlinck  <address@hidden>

        * help-fns.el (describe-function-1): Change output for
          keyboard macros.

Patch:

===File ~/help-fns-diff=====================================
cd /usr/local/share/emacs/21.3.50/lisp/
diff -c /usr/local/share/emacs/21.3.50/lisp/help-fns.el 
/usr/local/share/emacs/21.3.50/lisp/help-fns.new.el
*** /usr/local/share/emacs/21.3.50/lisp/help-fns.el     Tue Feb  4 22:37:29 2003
--- /usr/local/share/emacs/21.3.50/lisp/help-fns.new.el Mon Feb 10 16:22:57 2003
***************
*** 293,299 ****
      (when (commandp function)
        (let* ((remapped (remap-command function))
             (keys (where-is-internal
!                  (or remapped function) overriding-local-map nil nil)))
        (when remapped
          (princ "It is remapped to `")
          (princ (symbol-name remapped))
--- 293,299 ----
      (when (commandp function)
        (let* ((remapped (remap-command function))
             (keys (where-is-internal
!                   (or remapped function) overriding-local-map nil nil)))
        (when remapped
          (princ "It is remapped to `")
          (princ (symbol-name remapped))
***************
*** 323,328 ****
--- 323,331 ----
                                                 function)))))
                   usage)
                 (car usage))
+               ((or (stringp def)
+                    (vectorp def))
+                (kmacro-display def))
                (t "[Missing arglist.  Please make a bug report.]")))
        (terpri))
        (let ((obsolete (and

Diff finished at Mon Feb 10 16:47:18
============================================================




reply via email to

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