aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-02-22 23:59:32 +0200
committerJuri Linkov2018-02-22 23:59:32 +0200
commitdad1aeb30760ef524e95e636c22346b051233a38 (patch)
treee469c48d718e557f8c58e75c00382d721df804e8
parent8ba61ffd8cebb0ff9f7a219022f3c1f3eac2f6d0 (diff)
downloademacs-dad1aeb30760ef524e95e636c22346b051233a38.tar.gz
emacs-dad1aeb30760ef524e95e636c22346b051233a38.zip
* lisp/help.el (view-lossage): Use the same format as in edit-last-kbd-macro.
Call comment-indent with let-bound comment-start and comment-column. (Bug#30560)
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/help.el14
2 files changed, 15 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 6a89182493a..70bafcd01b4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -160,6 +160,14 @@ bound to 'C-c C-f'.
160'dired-do-copy' and 'dired-rename-file' should create non-existent 160'dired-do-copy' and 'dired-rename-file' should create non-existent
161directories in the destination. 161directories in the destination.
162 162
163** Help
164
165*** 'C-h l' (view-lossage) now displays last keystrokes and commands
166in the same format as the edit buffer of edit-last-kbd-macro.
167This makes possible to copy the lines from the buffer generated
168by 'view-lossage', yank them to the buffer "*Edit Macro*" created by
169'edit-last-kbd-macro', and save the macro by 'C-c C-c'.
170
163** Ibuffer 171** Ibuffer
164 172
165--- 173---
diff --git a/lisp/help.el b/lisp/help.el
index 4899bc44e03..9575f5b090c 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -465,8 +465,8 @@ To record all your input, use `open-dribble-file'."
465 (princ (mapconcat (lambda (key) 465 (princ (mapconcat (lambda (key)
466 (cond 466 (cond
467 ((and (consp key) (null (car key))) 467 ((and (consp key) (null (car key)))
468 (format "[%s]\n" (if (symbolp (cdr key)) (cdr key) 468 (format ";; %s\n" (if (symbolp (cdr key)) (cdr key)
469 "anonymous-command"))) 469 "anonymous-command")))
470 ((or (integerp key) (symbolp key) (listp key)) 470 ((or (integerp key) (symbolp key) (listp key))
471 (single-key-description key)) 471 (single-key-description key))
472 (t 472 (t
@@ -475,11 +475,11 @@ To record all your input, use `open-dribble-file'."
475 " ")) 475 " "))
476 (with-current-buffer standard-output 476 (with-current-buffer standard-output
477 (goto-char (point-min)) 477 (goto-char (point-min))
478 (while (not (eobp)) 478 (let ((comment-start ";; ")
479 (move-to-column 50) 479 (comment-column 24))
480 (unless (eolp) 480 (while (not (eobp))
481 (fill-region (line-beginning-position) (line-end-position))) 481 (comment-indent)
482 (forward-line 1)) 482 (forward-line 1)))
483 ;; jidanni wants to see the last keystrokes immediately. 483 ;; jidanni wants to see the last keystrokes immediately.
484 (set-marker help-window-point-marker (point))))) 484 (set-marker help-window-point-marker (point)))))
485 485