From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: C-h k, C-h f and keyboard macros: Patch. Date: Mon, 10 Feb 2003 17:56:29 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200302102356.RAA04775@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1044921474 20859 80.91.224.249 (10 Feb 2003 23:57:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 10 Feb 2003 23:57:54 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18iNo8-0005QD-00 for ; Tue, 11 Feb 2003 00:57:52 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18iNzM-0002j4-00 for ; Tue, 11 Feb 2003 01:09:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18iNpV-0005S0-0A for emacs-devel@quimby.gnus.org; Mon, 10 Feb 2003 18:59:17 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18iNor-0004zM-00 for emacs-devel@gnu.org; Mon, 10 Feb 2003 18:58:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18iNoh-0004p2-00 for emacs-devel@gnu.org; Mon, 10 Feb 2003 18:58:28 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18iNm5-0003XY-00 for emacs-devel@gnu.org; Mon, 10 Feb 2003 18:55:45 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.9.1a/8.9.1) with ESMTP id RAA18076 for ; Mon, 10 Feb 2003 17:55:42 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id RAA04775; Mon, 10 Feb 2003 17:56:29 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11551 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11551 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 * 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 ============================================================