unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30560: Better format for view-lossage
@ 2018-02-20 21:17 Juri Linkov
  2018-02-22 21:59 ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2018-02-20 21:17 UTC (permalink / raw)
  To: 30560

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: view-lossage.patch --]
[-- Type: text/x-diff, Size: 1053 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 71 bytes --]


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

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

end of thread, other threads:[~2018-02-24 11:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-20 21:17 bug#30560: Better format for view-lossage Juri Linkov
2018-02-22 21:59 ` Juri Linkov
2018-02-23  6:59   ` Eli Zaretskii
2018-02-23 10:09     ` Robert Pluim
2018-02-23 10:20       ` martin rudalics
2018-02-23 11:08         ` Robert Pluim
2018-02-24 11:17           ` Eli Zaretskii
2018-02-23 13:55       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).