From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs 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 Message-ID: <877e76w4wf.fsf@mouse.gnus.org> References: <8739qls36x.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="190088"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: rfrancoise@debian.org, 7513@debbugs.gnu.org To: jidanni@jidanni.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 22 00:06:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0YkB-000nCC-0F for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Aug 2019 00:06:15 +0200 Original-Received: from localhost ([::1]:36390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Yk9-0005Uf-M0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Aug 2019 18:06:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37375) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Yk1-0005UF-K1 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0Yk0-0007NB-Hy for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:06:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0Yk0-0007N2-FD for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:06:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0Yjx-0000f9-LK for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Aug 2019 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7513 X-GNU-PR-Package: emacs Original-Received: via spool by 7513-submit@debbugs.gnu.org id=B7513.15664251472523 (code B ref 7513); Wed, 21 Aug 2019 22:06:01 +0000 Original-Received: (at 7513) by debbugs.gnu.org; 21 Aug 2019 22:05:47 +0000 Original-Received: from localhost ([127.0.0.1]:36701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0Yjj-0000ec-0H for submit@debbugs.gnu.org; Wed, 21 Aug 2019 18:05:47 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:44116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0Yjg-0000eR-KR for 7513@debbugs.gnu.org; Wed, 21 Aug 2019 18:05:45 -0400 Original-Received: from [76.14.1.154] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0Yjb-00071H-CQ; Thu, 22 Aug 2019 00:05:42 +0200 In-Reply-To: <8739qls36x.fsf@jidanni.org> (jidanni@jidanni.org's message of "Mon, 29 Nov 2010 02:39:18 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165531 Archived-At: 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 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