From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: C-h k, C-h f and keyboard macros: Patch. Date: 11 Feb 2003 14:10:42 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5xsmuvufn1.fsf@kfs2.cua.dk> References: <200302102356.RAA04775@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044965784 1147 80.91.224.249 (11 Feb 2003 12:16:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 11 Feb 2003 12:16:24 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18iZKp-0000IN-00 for ; Tue, 11 Feb 2003 13:16:23 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18iZWI-0001FJ-00 for ; Tue, 11 Feb 2003 13:28:15 +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 18iZL8-0006e9-05 for emacs-devel@quimby.gnus.org; Tue, 11 Feb 2003 07:16:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18iZKg-0006Y3-00 for emacs-devel@gnu.org; Tue, 11 Feb 2003 07:16:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18iZGo-0004oJ-00 for emacs-devel@gnu.org; Tue, 11 Feb 2003 07:12:16 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18iZGB-0004bv-00 for emacs-devel@gnu.org; Tue, 11 Feb 2003 07:11:35 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 3409D7C012; Tue, 11 Feb 2003 13:11:32 +0100 (CET) Original-To: Luc Teirlinck In-Reply-To: <200302102356.RAA04775@eel.dms.auburn.edu> Original-Lines: 49 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:11554 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11554 Luc Teirlinck 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