* bug#70531: insert timestamps and serial numbers along with \f\n in error-file
@ 2024-04-23 10:11 Dan Jacobson
0 siblings, 0 replies; only message in thread
From: Dan Jacobson @ 2024-04-23 10:11 UTC (permalink / raw)
To: 70531
shell-command-on-region is an interactive native-compiled Lisp
function in ‘simple.el’.
In it there is this code:
(when (and error-file (file-exists-p error-file))
(if (< 0 (file-attribute-size (file-attributes error-file)))
(with-current-buffer (get-buffer-create error-buffer)
(goto-char (point-max))
;; Insert a separator if there's already text here.
(unless (bobp)
(insert "\f\n"))
Problem is the user cannot tell which stuff, the stuff above the \f\n,
or the stuff below the \f\n is newer!
You might think that after a few years the user will figure it out and
remember it. But the user also worries "maybe where the message gets
inserted also depends which part of the error buffer I was looking at
last moments before." even if not the case.
All this could be cleared up, if along with inserting the \f\n, a
timestamp were inserted. Or at least a serial number: \f\nError group 1:
\f\nError group 2: etc. Best of all would be to use both a timestamp and
a serial number.
In fact (insert "\f\n") makes a heavy assumption that the user usually
doesn't have any \f's of their own in that file. But it is a bad thing
to have it hardwired in the first place, requiring the user to change
the entire function in order to choose a different separator. So maybe
have it a variable, set to \f\n by default, or better something like
("\f\n" . some-counter . some-time-stamp . "\n").
emacs-version "29.3"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-23 10:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 10:11 bug#70531: insert timestamps and serial numbers along with \f\n in error-file Dan Jacobson
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.