all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-h k, C-h f and keyboard macros: Patch.
@ 2003-02-10 23:56 Luc Teirlinck
  2003-02-11 13:10 ` Kim F. Storm
  2003-02-12  7:19 ` Richard Stallman
  0 siblings, 2 replies; 15+ messages in thread
From: Luc Teirlinck @ 2003-02-10 23:56 UTC (permalink / raw)


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  <teirllm@mail.auburn.edu>

        * 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
============================================================

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-02-13  0:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-10 23:56 C-h k, C-h f and keyboard macros: Patch Luc Teirlinck
2003-02-11 13:10 ` Kim F. Storm
2003-02-11 12:52   ` Juanma Barranquero
2003-02-11 14:13     ` Kim F. Storm
2003-02-11 14:07       ` Juanma Barranquero
2003-02-11 15:18         ` Kim F. Storm
2003-02-11 14:27           ` Juanma Barranquero
2003-02-11 15:36           ` Kim F. Storm
2003-02-11 14:47             ` Juanma Barranquero
2003-02-11 16:19       ` Stefan Monnier
2003-02-11 20:58         ` Kim F. Storm
2003-02-12 20:34         ` Richard Stallman
2003-02-13  0:16           ` Kim F. Storm
2003-02-11 16:03   ` Luc Teirlinck
2003-02-12  7:19 ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.