all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Adam Spiers <bug-gnu-emacs@adamspiers.org>
To: Juri Linkov <juri@jurta.org>
Cc: 4891@emacsbugs.donarmstrong.com
Subject: bug#4891: 23.1; shell-command overwrites whole buffer
Date: Thu, 12 Nov 2009 01:15:48 +0000	[thread overview]
Message-ID: <20091112011548.GA14892@atlantic.linksys.moosehall> (raw)
In-Reply-To: <871vk5shiu.fsf@mail.jurta.org>

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





  reply	other threads:[~2009-11-12  1:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871vk1hyv9.fsf@stupidchicken.com>
2009-11-09 11:14 ` bug#4891: 23.1; shell-command overwrites whole buffer Adam Spiers
2009-11-11 10:47   ` Juri Linkov
2009-11-12  1:15     ` Adam Spiers [this message]
2009-11-12  4:23       ` Stefan Monnier
2009-11-12  6:42         ` Kevin Rodgers
2009-11-12  9:33         ` Adam Spiers
2009-11-14 16:15   ` bug#4891: marked as done (23.1; shell-command overwrites whole buffer) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091112011548.GA14892@atlantic.linksys.moosehall \
    --to=bug-gnu-emacs@adamspiers.org \
    --cc=4891@emacsbugs.donarmstrong.com \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.