From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5618: 23.1.91; shell-command-on-region unexpectedly erases buffer Date: Thu, 27 Jan 2022 19:31:08 +0100 Message-ID: <87czkdjaj7.fsf@gnus.org> References: <20100222094413.GC21836@tomas> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8128"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 5618@debbugs.gnu.org, rfrancoise@debian.org To: tomas@tuxteam.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 27 19:33:09 2022 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 1nD9a1-0001qs-8Z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Jan 2022 19:33:09 +0100 Original-Received: from localhost ([::1]:39052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nD9Zz-0000fe-SR for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Jan 2022 13:33:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nD9Z1-0007RU-QG for bug-gnu-emacs@gnu.org; Thu, 27 Jan 2022 13:32:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nD9Yv-0000kG-Of for bug-gnu-emacs@gnu.org; Thu, 27 Jan 2022 13:32:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nD9Yv-0001mQ-Kr for bug-gnu-emacs@gnu.org; Thu, 27 Jan 2022 13:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jan 2022 18:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5618 X-GNU-PR-Package: emacs Original-Received: via spool by 5618-submit@debbugs.gnu.org id=B5618.16433082816781 (code B ref 5618); Thu, 27 Jan 2022 18:32:01 +0000 Original-Received: (at 5618) by debbugs.gnu.org; 27 Jan 2022 18:31:21 +0000 Original-Received: from localhost ([127.0.0.1]:56558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD9YH-0001lI-Bu for submit@debbugs.gnu.org; Thu, 27 Jan 2022 13:31:21 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:33854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD9YE-0001l3-Sr for 5618@debbugs.gnu.org; Thu, 27 Jan 2022 13:31:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=69tw+l+89iwOKRTl+aDyFTppXJrVi/YuJ8elfzGQf04=; b=VhqOAYtzICYWPRcK/c7H/W4KZA g1UAFZhyZpbHw6mrYR6DbXYDTrxPeVgMJF9EzsiNBqjFgG79h5C83xlfKuG6Dvsl7gRSza+EbQ9NO g5AlP5qxsultwoDfeh1RvaYcmzTKc/U023XktDIMflNNdlag/aAab+K4m8e8BpzeJwQA=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD9Y5-00016p-9Q; Thu, 27 Jan 2022 19:31:12 +0100 X-Now-Playing: David Sylvian's _Everything And Nothing (1)_: "Blackwater" In-Reply-To: <20100222094413.GC21836@tomas> (tomas@tuxteam.de's message of "Mon, 22 Feb 2010 10:44:13 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:225387 Archived-At: tomas@tuxteam.de writes: > - Start with some buffer with text in it. *scratch* will do fine. > - Put point somewhere in text > - evaluate (shell-command-on-region (point) (point) "/bin/date" (current-buffer) nil) > > (The actual values of START and END are irrelevant, though). > > The whole content of the buffer gets replaced by output of > command. According to the doc, I'd expect the ouput to be inserted > before point. (I'm going through old bug reports that unfortunately weren't resolved at the time.) The behaviour has now been documented as such: ---- Optional fourth arg OUTPUT-BUFFER specifies where to put the command's output. If the value is a buffer or buffer name, erase that buffer and insert the output there; a non-nil value of `shell-command-dont-erase-buffer' prevent to erase the buffer. If the value is nil, use the buffer specified by `shell-command-buffer-name'. Any other non-nil value means to insert the output in the current buffer after START. ---- And we've grown an extra user option (that's... pretty confusing in itself, I think). So while the semantics here are far less than ideal, I don't think there's anything further to do here, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no