From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.bugs Subject: bug#39067: shell-command-dont-erase-buffer strange behaviour Date: Fri, 10 Jan 2020 05:34:18 +0000 Message-ID: Reply-To: madhu@cs.unm.edu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="208164"; mail-complaints-to="usenet@blaine.gmane.org" To: 39067@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 10 06:37:55 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.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 1ipmxx-000Sxo-DW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2020 06:36:13 +0100 Original-Received: from localhost ([::1]:40634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipmxv-0005pM-Jc for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2020 00:36:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52573) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipmxn-0005pF-Jy for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:36:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipmxm-0007Zw-HC for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:36:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipmxm-0007Yz-CY for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipmxm-0000ee-A0 for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2020 05:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39067 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15786345432489 (code B ref -1); Fri, 10 Jan 2020 05:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jan 2020 05:35:43 +0000 Original-Received: from localhost ([127.0.0.1]:53481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipmxT-0000e5-CH for submit@debbugs.gnu.org; Fri, 10 Jan 2020 00:35:43 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipmwC-0000c5-Og for submit@debbugs.gnu.org; Fri, 10 Jan 2020 00:34:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48663) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipmwB-0005fD-K6 for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:34:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipmw9-0001QH-O1 for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:34:23 -0500 Original-Received: from snape.cs.unm.edu ([64.106.20.59]:58927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ipmw9-0001GD-Ge for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 00:34:21 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by snape.cs.unm.edu (Postfix) with ESMTP id 47E1047512 for ; Thu, 9 Jan 2020 22:34:19 -0700 (MST) Original-Received: from snape.cs.unm.edu ([127.0.0.1]) by localhost (snape.cs.unm.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kbf1NnsDTaS7 for ; Thu, 9 Jan 2020 22:34:18 -0700 (MST) Original-Received: from chawla.cs.unm.edu (chawla.cs.unm.edu [64.106.20.203]) by snape.cs.unm.edu (Postfix) with ESMTPS id D7E2247511 for ; Thu, 9 Jan 2020 22:34:18 -0700 (MST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Mailman-Approved-At: Fri, 10 Jan 2020 00:35:43 -0500 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174423 Archived-At: C-h v shell-command-dont-erase-buffer C-h f shell-command Cut to the chase with the test case: (let ((shell-command-dont-erase-buffer 'beg-last-out)) (with-current-buffer (get-buffer-create "OUT") (erase-buffer) (shell-command "/bin/echo FOO" t) (shell-command "/bin/echo FOO" t))) The result (as expected) is a buffer named OUT with 2 lines FOO. The same result is expected with the following code: (let ((shell-command-dont-erase-buffer 'beg-last-out)) (with-current-buffer (get-buffer-create "OUT") (erase-buffer) (shell-command "/bin/echo FOO" "OUT") (shell-command "/bin/echo FOO" "OUT"))) However in this case (and in some other cases) shell-command erases the "OUT" buffer despite a non-NIL binding of shell-command-dont-erase-buffer (at least since emacs 25.2)