From: Lars Ingebrigtsen <larsi@gnus.org>
To: jidanni@jidanni.org
Cc: rfrancoise@debian.org, 7513@debbugs.gnu.org
Subject: bug#7513: 24.0.50; shell-command-default-error-buffer should always append to the bottom
Date: Wed, 21 Aug 2019 15:05:36 -0700 [thread overview]
Message-ID: <877e76w4wf.fsf@mouse.gnus.org> (raw)
In-Reply-To: <8739qls36x.fsf@jidanni.org> (jidanni@jidanni.org's message of "Mon, 29 Nov 2010 02:39:18 +0800")
jidanni@jidanni.org writes:
> (info "(emacs) Single Shell") and
> (describe-variable 'shell-command-default-error-buffer)
> should mention that the errors accumulate in that buffer, and are not
> wiped clean at each new command. Also mention they are separate by
> form-feeds (^L).
>
> Also the main reason I'm writing this bug report is currently
> `M-!' and `M-|' insert error output before point in that buffer.
> But that often leads to jumbled output. They should always append to the
> bottom! Like the view-echo-area-messages *Message* buffer.
Yes, the output in that buffer as it stands isn't very useful, I think.
However, great care has been taken to try to insert the error message
wherever point is, and restoring the buffer:
(with-current-buffer (get-buffer-create error-buffer)
(let ((pos-from-end (- (point-max) (point))))
(or (bobp)
(insert "\f\n"))
;; Do no formatting while reading error file,
;; because that can run a shell command, and we
;; don't want that to cause an infinite recursion.
(format-insert-file error-file nil)
;; Put point after the inserted errors.
(goto-char (- (point-max) pos-from-end)))
(display-buffer (current-buffer))))
I looked at the commit history, and it doesn't seem to explain why we
don't just append:
commit cc039f78e544719115e277364378c217156c958f
Author: Karl Heuer <kwzh@gnu.org>
Date: Mon Mar 1 03:19:32 1999 +0000
(shell-command-default-error-buffer): Renamed from
shell-command-on-region-default-error-buffer.
(shell-command-on-region): Mention in echo area when there
is some error output. Mention success or failure, too.
Accumulate multiple error outputs
going forward, with formfeed in between. Display the error buffer
when we have put something in it.
Does anybody object to rewriting it to just append the error messages to
the end of the buffer?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2019-08-21 22:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-28 18:39 bug#7513: 24.0.50; shell-command-default-error-buffer should always append to the bottom jidanni
2019-08-21 22:05 ` Lars Ingebrigtsen [this message]
2019-08-22 14:07 ` Eli Zaretskii
2019-08-22 21:18 ` 積丹尼 Dan Jacobson
2019-08-23 0:14 ` Lars Ingebrigtsen
2019-08-23 7:06 ` Eli Zaretskii
2019-08-23 8:12 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877e76w4wf.fsf@mouse.gnus.org \
--to=larsi@gnus.org \
--cc=7513@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
--cc=rfrancoise@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).