GNU bug report logs - #30560
Better format for view-lossage

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 20 Feb 2018 21:37:02 UTC

Severity: wishlist

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Better format for view-lossage
Date: Tue, 20 Feb 2018 23:17:58 +0200
[Message part 1 (text/plain, inline)]
It would much more useful in the output buffer of ‘C-h l’ (view-lossage)
to use the same format as is used by ‘edit-last-kbd-macro’.

Then it will possible to just copy the lines from the buffer generated
by ‘view-lossage’, yank them to the buffer “*Edit Macro*” created by
‘edit-last-kbd-macro’, and save the macro by ‘C-c C-c’.

This is useful for such cases when the user forgets to start macro recording,
or wants to convert recent keystrokes to the macro without re-typing them,
or pick only some of recent keystrokes and compose a new macro
in different order.

This patch is for master:

[view-lossage.patch (text/x-diff, inline)]
diff --git a/lisp/help.el b/lisp/help.el
index 4899bc4..9575f5b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -465,8 +465,8 @@ view-lossage
     (princ (mapconcat (lambda (key)
 			(cond
 			 ((and (consp key) (null (car key)))
-			  (format "[%s]\n" (if (symbolp (cdr key)) (cdr key)
-					   "anonymous-command")))
+			  (format ";; %s\n" (if (symbolp (cdr key)) (cdr key)
+					      "anonymous-command")))
 			 ((or (integerp key) (symbolp key) (listp key))
 			  (single-key-description key))
 			 (t
@@ -475,11 +475,11 @@ view-lossage
 		      " "))
     (with-current-buffer standard-output
       (goto-char (point-min))
-      (while (not (eobp))
-	(move-to-column 50)
-	(unless (eolp)
-	  (fill-region (line-beginning-position) (line-end-position)))
-	(forward-line 1))
+      (let ((comment-start ";; ")
+            (comment-column 24))
+        (while (not (eobp))
+          (comment-indent)
+	  (forward-line 1)))
       ;; jidanni wants to see the last keystrokes immediately.
       (set-marker help-window-point-marker (point)))))
 
[Message part 3 (text/plain, inline)]
PS: I'm not sure whether this feature should be documented somewhere.

This bug report was last modified 7 years and 139 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.