GNU bug report logs - #5618
23.1.91; shell-command-on-region unexpectedly erases buffer

Previous Next

Package: emacs;

Reported by: tomas <at> tuxteam.de

Date: Mon, 22 Feb 2010 12:13:01 UTC

Severity: minor

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 5618 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: tomas <at> tuxteam.de
Cc: 5618 <at> debbugs.gnu.org, rfrancoise <at> debian.org
Subject: Re: bug#5618: 23.1.91; shell-command-on-region unexpectedly erases
 buffer
Date: Thu, 27 Jan 2022 19:31:08 +0100
tomas <at> 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




This bug report was last modified 3 years and 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.