From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Adam Spiers , 4891@debbugs.gnu.org Resent-From: Adam Spiers Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 09 Nov 2009 11:20:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.1257765267910 (code B ref -1); Mon, 09 Nov 2009 11:20:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Nov 2009 11:14:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA9BEPXw000907 for ; Mon, 9 Nov 2009 03:14:26 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7SCW-0002eM-II for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7SCP-0002d7-PE for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:22 -0500 Received: from [199.232.76.173] (port=34356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7SCP-0002d4-EM for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:17 -0500 Received: from arctic.adamspiers.org ([212.13.194.176]:51756) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7SCO-0004Cx-WF for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:17 -0500 Received: from localhost (dsl-217-155-199-114.zen.co.uk [217.155.199.114]) by arctic.adamspiers.org (Postfix) with ESMTP id B55872414F for ; Mon, 9 Nov 2009 11:14:14 +0000 (UTC) From: Adam Spiers To: bug-gnu-emacs@gnu.org Message-Id: <20091109111414.B55872414F@arctic.adamspiers.org> Date: Mon, 9 Nov 2009 11:14:14 +0000 (UTC) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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). In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6) of 2009-09-29 on x86-7.fedora.phx.redhat.com Windowing system distributor `The X.Org Foundation', version 11.0.10603901 configured using `configure '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-: ( s h e l l - c o m m a n d SPC " d a t e " S-SPC ( g e t - b u f f e r SPC " * s c r a t c h * " ) ) C-x b M-x r e p o r Recent messages: Loading /usr/share/emacs/site-lisp/site-start.d/muse-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/ruby-mode-init.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Mon Nov 9 10:38:11 GMT 2009 0 (#o0, #x0) Making completion list... From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Juri Linkov , 4891@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 11 Nov 2009 11:05:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4891-submit@emacsbugs.donarmstrong.com id=B4891.125793693218985 (code B ref 4891); Wed, 11 Nov 2009 11:05:04 +0000 Received: (at 4891) by emacsbugs.donarmstrong.com; 11 Nov 2009 10:55:32 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nABAtUDC018981 for <4891@emacsbugs.donarmstrong.com>; Wed, 11 Nov 2009 02:55:31 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.28.110.cable.starman.ee [82.131.28.110]) by mx1.starman.ee (Postfix) with ESMTP id 02D943F41C4; Wed, 11 Nov 2009 12:55:23 +0200 (EET) From: Juri Linkov To: Adam Spiers Cc: 4891@debbugs.gnu.org Organization: JURTA References: <20091109111414.B55872414F@arctic.adamspiers.org> Date: Wed, 11 Nov 2009 12:47:21 +0200 In-Reply-To: <20091109111414.B55872414F@arctic.adamspiers.org> (Adam Spiers's message of "Mon, 9 Nov 2009 11:14:14 +0000 (UTC)") Message-ID: <871vk5shiu.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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). -- Juri Linkov http://www.jurta.org/emacs/ From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Adam Spiers , 4891@debbugs.gnu.org Resent-From: Adam Spiers Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 12 Nov 2009 01:25:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4891-submit@emacsbugs.donarmstrong.com id=B4891.125798857526733 (code B ref 4891); Thu, 12 Nov 2009 01:25:05 +0000 Received: (at 4891) by emacsbugs.donarmstrong.com; 12 Nov 2009 01:16:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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 Date: Thu, 12 Nov 2009 01:15:48 +0000 From: Adam Spiers To: Juri Linkov Cc: 4891@debbugs.gnu.org Message-ID: <20091112011548.GA14892@atlantic.linksys.moosehall> References: <20091109111414.B55872414F@arctic.adamspiers.org> <871vk5shiu.fsf@mail.jurta.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871vk5shiu.fsf@mail.jurta.org> X-OS: Linux User-Agent: Mutt/1.5.20 (2009-08-17) 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 From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Stefan Monnier , 4891@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 12 Nov 2009 04:30:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4891-submit@emacsbugs.donarmstrong.com id=B4891.125799983217433 (code B ref 4891); Thu, 12 Nov 2009 04:30:07 +0000 Received: (at 4891) by emacsbugs.donarmstrong.com; 12 Nov 2009 04:23:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAC4NoWU017430 for <4891@emacsbugs.donarmstrong.com>; Wed, 11 Nov 2009 20:23:52 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEADcc+0pMCpsp/2dsb2JhbACBTtsPhDwEiSM X-IronPort-AV: E=Sophos;i="4.44,726,1249272000"; d="scan'208";a="49152683" Received: from 76-10-155-41.dsl.teksavvy.com (HELO pastel.home) ([76.10.155.41]) by ironport2-out.pppoe.ca with ESMTP; 11 Nov 2009 23:23:44 -0500 Received: by pastel.home (Postfix, from userid 20848) id 580068373; Wed, 11 Nov 2009 23:23:44 -0500 (EST) From: Stefan Monnier To: Adam Spiers Cc: 4891@debbugs.gnu.org, Juri Linkov Message-ID: References: <20091109111414.B55872414F@arctic.adamspiers.org> <871vk5shiu.fsf@mail.jurta.org> <20091112011548.GA14892@atlantic.linksys.moosehall> Date: Wed, 11 Nov 2009 23:23:44 -0500 In-Reply-To: <20091112011548.GA14892@atlantic.linksys.moosehall> (Adam Spiers's message of "Thu, 12 Nov 2009 01:15:48 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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? Then switch to that buffer before starting the command and pass t as the OUTPUT-BUFFER. Stefan From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Kevin Rodgers , 4891@debbugs.gnu.org Resent-From: Kevin Rodgers Original-Sender: news Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 12 Nov 2009 06:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125800816730759 (code B ref -1); Thu, 12 Nov 2009 06:50:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 12 Nov 2009 06:42:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAC6gi5H030756 for ; Wed, 11 Nov 2009 22:42:47 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8TOG-0003Bo-7Y for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 01:42:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8TOA-00037f-Bt for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 01:42:42 -0500 Received: from [199.232.76.173] (port=58715 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8TOA-00037J-2O for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 01:42:38 -0500 Received: from lo.gmane.org ([80.91.229.12]:37865) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8TO9-00066C-IH for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 01:42:37 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8TO5-0007md-ET for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 07:42:33 +0100 Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 07:42:33 +0100 Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 07:42:33 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Kevin Rodgers Date: Wed, 11 Nov 2009 23:42:25 -0700 Lines: 14 Message-ID: References: <20091109111414.B55872414F@arctic.adamspiers.org> <871vk5shiu.fsf@mail.jurta.org> <20091112011548.GA14892@atlantic.linksys.moosehall> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: Sender: news X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Stefan Monnier wrote: >> 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? > > Then switch to that buffer before starting the command and pass t as the > OUTPUT-BUFFER. But why is the distinction between append and replace conflated with the OUTPUT-BUFFER argument in the first place? -- Kevin Rodgers Denver, Colorado, USA From unknown Fri Aug 15 15:56:09 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4891: 23.1; shell-command overwrites whole buffer Reply-To: Adam Spiers , 4891@debbugs.gnu.org Resent-From: Adam Spiers Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 12 Nov 2009 09:40:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4891 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4891-submit@emacsbugs.donarmstrong.com id=B4891.125801842813557 (code B ref 4891); Thu, 12 Nov 2009 09:40:06 +0000 Received: (at 4891) by emacsbugs.donarmstrong.com; 12 Nov 2009 09:33:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 nAC9Xkso013553 for <4891@emacsbugs.donarmstrong.com>; Thu, 12 Nov 2009 01:33:47 -0800 Received: from localhost ([::ffff:149.44.117.250]) by gwia-smtp.id2.novell.com with ESMTP (TLS encrypted); Thu, 12 Nov 2009 10:24:44 +0000 Date: Thu, 12 Nov 2009 09:33:33 +0000 From: Adam Spiers To: Stefan Monnier Cc: 4891@debbugs.gnu.org, Juri Linkov Message-ID: <20091112093333.GB14892@atlantic.linksys.moosehall> References: <20091109111414.B55872414F@arctic.adamspiers.org> <871vk5shiu.fsf@mail.jurta.org> <20091112011548.GA14892@atlantic.linksys.moosehall> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: Linux User-Agent: Mutt/1.5.20 (2009-08-17) On Wed, Nov 11, 2009 at 11:23:44PM -0500, Stefan Monnier wrote: > > 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? > > Then switch to that buffer before starting the command and pass t as the > OUTPUT-BUFFER. That's exactly what I tried yesterday - but that's synchronous ... From unknown Fri Aug 15 15:56:09 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Adam Spiers Subject: bug#4891 closed by Chong Yidong (Re: 23.1; shell-command overwrites whole buffer) Message-ID: References: <871vk1hyv9.fsf@stupidchicken.com> <20091109111414.B55872414F@arctic.adamspiers.org> X-Emacs-PR-Message: they-closed 4891 X-Emacs-PR-Package: emacs Reply-To: 4891@debbugs.gnu.org Date: Sat, 14 Nov 2009 16:15:05 +0000 Content-Type: multipart/mixed; boundary="----------=_1258215305-9520-1" This is a multi-part message in MIME format... ------------=_1258215305-9520-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4891: 23.1; shell-command overwrites whole buffer It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 4891: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4891 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1258215305-9520-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4891-done) by emacsbugs.donarmstrong.com; 14 Nov 2009 16:09:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.2 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po24.its.yale.edu (pantheon-po24.its.yale.edu [130.132.50.118]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAEG9b0i009058 for <4891-done@emacsbugs.donarmstrong.com>; Sat, 14 Nov 2009 08:09:39 -0800 Received: from furry (adsl-99-58-202-243.dsl.wlfrct.sbcglobal.net [99.58.202.243]) (authenticated bits=0) by pantheon-po24.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id nAEG9USc000613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 14 Nov 2009 11:09:30 -0500 Received: by furry (Postfix, from userid 1000) id 53FC1C071; Sat, 14 Nov 2009 11:09:30 -0500 (EST) From: Chong Yidong To: Adam Spiers Cc: 4891-done@debbugs.gnu.org Subject: Re: 23.1; shell-command overwrites whole buffer Date: Sat, 14 Nov 2009 11:09:30 -0500 Message-ID: <871vk1hyv9.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) > 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). Thanks for the bug report. This is really a documentation bug, because shell-command has always erased the buffer since the first version of Emacs, and other code depends on this behavior. I've amended the docstring to mention that the buffer is erased. ------------=_1258215305-9520-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 9 Nov 2009 11:14:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA9BEPXw000907 for ; Mon, 9 Nov 2009 03:14:26 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7SCW-0002eM-II for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7SCP-0002d7-PE for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:22 -0500 Received: from [199.232.76.173] (port=34356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7SCP-0002d4-EM for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:17 -0500 Received: from arctic.adamspiers.org ([212.13.194.176]:51756) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7SCO-0004Cx-WF for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2009 06:14:17 -0500 Received: from localhost (dsl-217-155-199-114.zen.co.uk [217.155.199.114]) by arctic.adamspiers.org (Postfix) with ESMTP id B55872414F for ; Mon, 9 Nov 2009 11:14:14 +0000 (UTC) From: Adam Spiers To: bug-gnu-emacs@gnu.org Subject: 23.1; shell-command overwrites whole buffer Message-Id: <20091109111414.B55872414F@arctic.adamspiers.org> Date: Mon, 9 Nov 2009 11:14:14 +0000 (UTC) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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). In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6) of 2009-09-29 on x86-7.fedora.phx.redhat.com Windowing system distributor `The X.Org Foundation', version 11.0.10603901 configured using `configure '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-: ( s h e l l - c o m m a n d SPC " d a t e " S-SPC ( g e t - b u f f e r SPC " * s c r a t c h * " ) ) C-x b M-x r e p o r Recent messages: Loading /usr/share/emacs/site-lisp/site-start.d/muse-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/ruby-mode-init.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Mon Nov 9 10:38:11 GMT 2009 0 (#o0, #x0) Making completion list... ------------=_1258215305-9520-1--