GNU bug report logs - #7513
24.0.50; shell-command-default-error-buffer should always append to the bottom

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Sun, 28 Nov 2010 23:06:03 UTC

Severity: wishlist

Tags: fixed

Found in version 24.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: jidanni <at> jidanni.org
Cc: rfrancoise <at> debian.org, 7513 <at> 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
jidanni <at> 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 <at> 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




This bug report was last modified 5 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.