From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#40896: 27.0.91; Moving point fails sometimes in shell-command Date: Sat, 02 May 2020 15:12:17 +0200 Message-ID: <87zhaqwkem.fsf@gmx.de> References: <877dy1miy4.fsf@gmx.de> <83v9ll3s68.fsf@gnu.org> <87lfmgyfzy.fsf@gmx.de> <837dxz3kww.fsf@gnu.org> <87tv13wuzo.fsf@gmx.de> <874kt113zx.fsf@gmx.de> <83mu6qu13b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102267"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40896@debbugs.gnu.org, tino.calancha@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 02 15:13:34 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUrxW-000QVJ-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 May 2020 15:13:34 +0200 Original-Received: from localhost ([::1]:42570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUrxV-0001pG-CR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 May 2020 09:13:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUrx0-0001lB-VR for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 09:13:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUrx0-0001vl-9h for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 09:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUrwz-0001vb-Tg for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 09:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jUrwz-0002BV-NO for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 09:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 May 2020 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40896 X-GNU-PR-Package: emacs Original-Received: via spool by 40896-submit@debbugs.gnu.org id=B40896.15884251598362 (code B ref 40896); Sat, 02 May 2020 13:13:01 +0000 Original-Received: (at 40896) by debbugs.gnu.org; 2 May 2020 13:12:39 +0000 Original-Received: from localhost ([127.0.0.1]:51517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUrwR-0002AV-36 for submit@debbugs.gnu.org; Sat, 02 May 2020 09:12:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:57475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUrwP-0002AE-HD for 40896@debbugs.gnu.org; Sat, 02 May 2020 09:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1588425138; bh=GLDFbV0HfHq3MxZCYlxUHOp7ORs3gOa7FuZoGju68o8=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=O4OHfkqJE4NyQaOCpAriDc7THviv4lw/ijmwOVmQZJgQN+WEIdTI1y1N93DUrLYLU mISe/QWjWHwWdMvh/cZrCbcx2cZm4CBISWRe7ldZs7to8KCXDu5TdGfJSy3qaZK26q Se831OEPNQtWnP+TTeTZikOo4ntEmWXCiOr2z5xg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.112.148]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MrhUK-1iqGFa2t3k-00njt1; Sat, 02 May 2020 15:12:18 +0200 In-Reply-To: <83mu6qu13b.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 May 2020 12:40:08 +0300") X-Provags-ID: V03:K1:wDLIOsySDZvnXSAQvJjIms80H9Nxtxwti2jUeE6vLtSw5k6n6i6 hJZMrYKyBJ6aQ3yd9X0JBY82odVIdiFyrZU5BP0vYLn0w950EVie4ZHvunfopQwLwOwwA6+ vAf7dFpesup5+X5vC1FXeA/vETLbYzBZffc+qNNjP0IGUovWDumcb9jMNsAMo7Ygq9lypLP 0CeDAnHN2zt9bIpqNeKgQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:CS8hCbzb0h0=:ivKRNnrz3XH30fQHq4rvht kV31lhPbDUc7hXKy8nPOA5AtwXKuveQ4kxr1hfz3nzlzwx3MjD2SyOFQPsO9wyrKpJGvxGufn PAHRVIGRsm0bQfRrhCGHX5UBU6rdLFMipAAdV2V7Hjl0ahmoq0q0kqi2sw05tlVfROs4EDkVG 1pwRUFYeqs8KedmVJpkSEWiy9eTRDAqooc1o9LTSW+pcKUmo/8oz0VogyVK7KZ9Ag3xcELdhA pFaDQYnLBb7TDqPcTwm/w8yI6IeIl+4yRau1+FWuqGYM3O1V8WaWOit5cjzb2le4gXSuhnxfb TCOUqqaFN4n1z104BF7EGX7SnxAakXdd0nRs8ltCUBEWG+gHhrSsxRe73Pg/VlBfq7WWutvgn DB3SWMxEZgozUPS9HVysYlMLHpX/61WozNdUunb3rR9uc9Hqx+RkU3Wohf4t9cEkLbepFswd+ 2DNPsXKNxA8y3qqdrj9RmMSvjnvkYzLaz1y73XeFMQnvowvf78SuQ6I7l7Ileg2qr83jTgwjy FHw6OqLgMxDX00SeikGynguX2KF/5IfR3Brg0jF5GyPNgob/QaoiF1XiVrh5VVSIGjoXGK3fK tTLur04t4HhimbtWILtKgkk2bXGkev85pZ38VRrykQHgG+wDvi1Di7jgRgNMx1zHx6eRYDl/C Uww+GHPbHJzZwhA1ovqfgykA9luhBmNNMDkc6YP9YtmcR7kHOrfQRZGH1//ie1xoSfZSsR+0Y K/BzsrlgupgBlaoOa4RAYd2DaFDyVfbEiiqI5L9pvWQOxEHib+T+rE1OB4T3z6Awoh8BsOBC X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179502 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: Hi Eli, >> In order to understand the situation better, I have enhanced my test >> code to cover all different values of shell-command-dont-erase-buffer, >> and whether the OUTPUT-BUFFER argument of shell-command is the current >> buffer, or not. Here's the code: > > AFAIU, the use case of OUTPUT-BUFFER being different from the current > buffer is meant for the case where subsequent commands accumulate the > output in that buffer, which is why the output is appended in that > case. > > Does what you see make more sense now? Almost. But it is not documented. Maybe we shall apply the appended patch. And if shell-command-dont-erase-buffer is end-last-out with output buffer not being the current one, the behavior is simply wrong, see my previous analysis. At least *this* case must be fixed. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 47f195d0b2..ca3d52c36a 100644 =2D-- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -846,6 +846,9 @@ Single Shell shell-command output. @end table +In case the output buffer is not the current buffer, shell command +output is appended at the end of this buffer. + @node Interactive Shell @subsection Interactive Subshell diff --git a/lisp/simple.el b/lisp/simple.el index ab277c4e11..2f0626d96e 100644 =2D-- a/lisp/simple.el +++ b/lisp/simple.el @@ -3606,6 +3606,9 @@ shell-command interactively when the prefix argument is given), insert the output in current buffer after point leaving mark after it. This cannot be done asynchronously. +If OUTPUT-BUFFER is a buffer or buffer name different from the +current buffer, append the output in this buffer instead of +inserting it at point. The user option `shell-command-dont-erase-buffer', which see, controls whether the output buffer is erased and where to put point after --=-=-=--