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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30560 in the body.
You can then email your comments to 30560 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Tue, 20 Feb 2018 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 20 Feb 2018 21:37:02 GMT) Full text and rfc822 format available.

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.

Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Thu, 22 Feb 2018 22:01:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Thu, 22 Feb 2018 22:01:02 GMT) Full text and rfc822 format available.

Message #10 received at 30560-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 30560-done <at> debbugs.gnu.org
Subject: Re: bug#30560: Better format for view-lossage
Date: Thu, 22 Feb 2018 23:59:42 +0200
> This patch is for master:

Pushed to master and closed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Fri, 23 Feb 2018 07:01:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 30560 <at> debbugs.gnu.org
Subject: Re: bug#30560: Better format for view-lossage
Date: Fri, 23 Feb 2018 08:59:29 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Thu, 22 Feb 2018 23:59:42 +0200
> 
> > This patch is for master:
> 
> Pushed to master and closed.

Thanks, but please in the future leave more than just 2 days for
people to comment on the patches you propose.

IMO, this change needs to be mentioned in NEWS.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Fri, 23 Feb 2018 10:11:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30560 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#30560: Better format for view-lossage
Date: Fri, 23 Feb 2018 11:09:52 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Juri Linkov <juri <at> linkov.net>
>> Date: Thu, 22 Feb 2018 23:59:42 +0200
>> 
>> > This patch is for master:
>> 
>> Pushed to master and closed.
>
> Thanks, but please in the future leave more than just 2 days for
> people to comment on the patches you propose.
>
> IMO, this change needs to be mentioned in NEWS.

Might I suggest the following as well? Does this need mentioning in
the info docs?

[0001-Describe-view-lossage-changes-in-its-docstring.patch (text/x-diff, inline)]
From 45c4f1a42e1e47f79055545a3fcf5a7d117e1caf Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim <at> gmail.com>
Date: Fri, 23 Feb 2018 11:01:23 +0100
Subject: [PATCH] Describe `view-lossage' changes in its docstring

* lisp/help.el (view-lossage): Mention that this now uses the same
format as `edit-last-kbd-macro'.
---
 etc/NEWS     | 11 ++++++-----
 lisp/help.el |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index dacaf023bb..3fa2670d60 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -167,11 +167,12 @@ directories in the destination.
 
 ** Help
 
-*** 'C-h l' (view-lossage) now displays last keystrokes and commands
-in the same format as the edit buffer of edit-last-kbd-macro.
-This makes possible to 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'.
+*** 'C-h l' (view-lossage) buffer format has changed.
+For convenience the lossage buffer now displays the last keystrokes
+and commands in the same format as the edit buffer of
+'edit-last-kbd-macro'.  This makes it possible to copy the lines from
+the buffer generated by 'view-lossage' to the "*Edit Macro*" buffer
+created by 'edit-last-kbd-macro', and save the macro by 'C-c C-c'.
 
 ** Ibuffer
 
diff --git a/lisp/help.el b/lisp/help.el
index 9575f5b090..917c25e427 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -454,7 +454,8 @@ view-external-packages
   (info "(efaq)Packages that do not come with Emacs"))
 
 (defun view-lossage ()
-  "Display last few input keystrokes and the commands run.
+  "Display last few input keystrokes and the commands run.  For
+convenience this uses the same format as `edit-last-kbd-macro'.
 
 To record all your input, use `open-dribble-file'."
   (interactive)
-- 
2.16.1.72.g5be1f00a9


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Fri, 23 Feb 2018 10:22:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 30560 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#30560: Better format for view-lossage
Date: Fri, 23 Feb 2018 11:20:58 +0100
> +  "Display last few input keystrokes and the commands run.  For

This wants the newline here ---------------------------------^

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Fri, 23 Feb 2018 11:10:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 30560 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#30560: Better format for view-lossage
Date: Fri, 23 Feb 2018 12:08:54 +0100
[Message part 1 (text/plain, inline)]
martin rudalics <rudalics <at> gmx.at> writes:

>> +  "Display last few input keystrokes and the commands run.  For
>
> This wants the newline here ---------------------------------^

Yes. I got it right for NEWS, and wrong here...

[0001-Describe-view-lossage-changes-in-its-docstring.patch (text/x-diff, inline)]
From 81839472eb88d79b12a44148fd47c76b7c6e56ea Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim <at> gmail.com>
Date: Fri, 23 Feb 2018 11:01:23 +0100
Subject: [PATCH] Describe `view-lossage' changes in its docstring

* lisp/help.el (view-lossage): Mention that this now uses the same
format as `edit-last-kbd-macro'.
---
 etc/NEWS     | 11 ++++++-----
 lisp/help.el |  2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index dacaf023bb..3fa2670d60 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -167,11 +167,12 @@ directories in the destination.
 
 ** Help
 
-*** 'C-h l' (view-lossage) now displays last keystrokes and commands
-in the same format as the edit buffer of edit-last-kbd-macro.
-This makes possible to 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'.
+*** 'C-h l' (view-lossage) buffer format has changed.
+For convenience the lossage buffer now displays the last keystrokes
+and commands in the same format as the edit buffer of
+'edit-last-kbd-macro'.  This makes it possible to copy the lines from
+the buffer generated by 'view-lossage' to the "*Edit Macro*" buffer
+created by 'edit-last-kbd-macro', and save the macro by 'C-c C-c'.
 
 ** Ibuffer
 
diff --git a/lisp/help.el b/lisp/help.el
index 9575f5b090..dcf1f32069 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -455,6 +455,8 @@ view-external-packages
 
 (defun view-lossage ()
   "Display last few input keystrokes and the commands run.
+For convenience this uses the same format as
+`edit-last-kbd-macro'.
 
 To record all your input, use `open-dribble-file'."
   (interactive)
-- 
2.16.1.72.g5be1f00a9


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Fri, 23 Feb 2018 13:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 30560 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#30560: Better format for view-lossage
Date: Fri, 23 Feb 2018 15:55:53 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Juri Linkov <juri <at> linkov.net>,  30560 <at> debbugs.gnu.org
> Date: Fri, 23 Feb 2018 11:09:52 +0100
> 
> Might I suggest the following as well?

LGTM, thanks.

> Does this need mentioning in the info docs?

The format of the output of view-lossage is currently not mentioned in
the manuals, AFAICS.  If it is self-explanatory enough, maybe we
should leave it that way (and mark the NEWS entry with "---").




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30560; Package emacs. (Sat, 24 Feb 2018 11:18:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: rudalics <at> gmx.at, 30560 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#30560: Better format for view-lossage
Date: Sat, 24 Feb 2018 13:17:40 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  30560 <at> debbugs.gnu.org,  Juri Linkov <juri <at> linkov.net>
> Date: Fri, 23 Feb 2018 12:08:54 +0100
> 
> >> +  "Display last few input keystrokes and the commands run.  For
> >
> > This wants the newline here ---------------------------------^
> 
> Yes. I got it right for NEWS, and wrong here...

Thanks, pushed.

For the future, please include a log entry for NEWS as well, and
please cite the bug number in the log message.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Mar 2018 11:24:03 GMT) Full text and rfc822 format available.

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.