Subject: bug#30560: closed (Re: bug#30560: Better format for view-lossage)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 22 Feb 2018 22:01:02 +0000

Your bug report

#30560: Better format for view-lossage

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
30560: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30560
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#30560: Better format for view-lossage
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Thu, 22 Feb 2018 23:59:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> This patch is for master:

Pushed to master and closed.

Subject: Better format for view-lossage
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Tue, 20 Feb 2018 23:17:58 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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:

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)))))

PS: I'm not sure whether this feature should be documented somewhere.