From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adam Spiers Newsgroups: gmane.emacs.bugs Subject: bug#4891: 23.1; shell-command overwrites whole buffer Date: Thu, 12 Nov 2009 01:15:48 +0000 Message-ID: <20091112011548.GA14892@atlantic.linksys.moosehall> References: <20091109111414.B55872414F@arctic.adamspiers.org> <871vk5shiu.fsf@mail.jurta.org> Reply-To: Adam Spiers , 4891@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257989273 19501 80.91.229.12 (12 Nov 2009 01:27:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2009 01:27:53 +0000 (UTC) Cc: 4891@emacsbugs.donarmstrong.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 12 02:27:46 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N8OTP-0000u5-F7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2009 02:27:43 +0100 Original-Received: from localhost ([127.0.0.1]:38370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8OTO-0000uA-Ue for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 20:27:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8OT8-0000q6-Rn for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 20:27:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8OT4-0000pF-4E for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 20:27:26 -0500 Original-Received: from [199.232.76.173] (port=52853 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8OT4-0000pC-0a for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 20:27:22 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44461) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8OT3-0000M8-Ch for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 20:27:21 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAC1RIR6027770; Wed, 11 Nov 2009 17:27:18 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAC1P6HP027423; Wed, 11 Nov 2009 17:25:06 -0800 Resent-Date: Wed, 11 Nov 2009 17:25:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Adam Spiers Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 12 Nov 2009 01:25:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4891-submit@emacsbugs.donarmstrong.com id=B4891.125798857526733 (code B ref 4891); Thu, 12 Nov 2009 01:25:05 +0000 Original-Received: (at 4891) by emacsbugs.donarmstrong.com; 12 Nov 2009 01:16:15 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from gwia-smtp.id2.novell.com (vpn.id2.novell.com [195.33.99.129]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAC1GDRa026722 for <4891@emacsbugs.donarmstrong.com>; Wed, 11 Nov 2009 17:16:15 -0800 Original-Received: from localhost ([::ffff:149.44.117.250]) by gwia-smtp.id2.novell.com with ESMTP (TLS encrypted); Thu, 12 Nov 2009 02:06:56 +0000 Content-Disposition: inline In-Reply-To: <871vk5shiu.fsf@mail.jurta.org> X-OS: Linux User-Agent: Mutt/1.5.20 (2009-08-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 11 Nov 2009 20:27:26 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32551 Archived-At: On Wed, Nov 11, 2009 at 12:47:21PM +0200, Juri Linkov wrote: > > Starting emacs 23.1.1 with the '-q' argument and typing: > > > > M-: (shell-command "date" (get-buffer "*scratch*")) > > > > results in the prior contents of the *scratch* buffer being > > overwritten. This seems to contradict the last sentence in the > > following paragraph of the docstring for shell-command: > > > > The optional second argument output-buffer, if non-nil, says to > > put the output in some other buffer. If output-buffer is a buffer > > or buffer name, put the output there. If output-buffer is not a > > buffer and not nil, insert output in current buffer. (This cannot > > be done asynchronously.) In either case, the output is inserted > > after point (leaving mark after it). > > Is the following description more precise? > > The optional second argument OUTPUT-BUFFER, if non-nil, > says to put the output in some other buffer. > If OUTPUT-BUFFER is a buffer or buffer name, put the output there > replacing the old contents of that buffer. > If OUTPUT-BUFFER is not a buffer and not nil, > insert output in current buffer. (This cannot be done > asynchronously.) In the latter case, the output is inserted > after point (leaving mark after it). Thanks for the quick reply! Yes, that does make more sense now - but what if I want to asynchronously insert output into an existing buffer? I think it would be more useful if the code was changed to match the docstring, rather than the other way around :-) Regards, Adam