bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4891: 23.1; shell-command overwrites whole buffer


From: Juri Linkov
Subject: bug#4891: 23.1; shell-command overwrites whole buffer
Date: Wed, 11 Nov 2009 12:47:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

> 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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]