emacs-devel
[Top][All Lists]
Advanced

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

Re: New optional arg to [async-]shell-command[-on-region]


From: Clément Pit--Claudel
Subject: Re: New optional arg to [async-]shell-command[-on-region]
Date: Wed, 13 Jul 2016 16:29:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

On 2016-07-13 16:09, Tino Calancha wrote:
> I would like to propose a patch adding a new optional argument KEEP
> for commands: `shell-command,' `async-shell-command' and
> `shell-command-on-region'.

This looks like an OK idea to me :) Although you could also make it a defcustom 
instead of cluttering the call signature.
Some comments below:

>            (let ((inhibit-read-only t))
> -            (erase-buffer))
> +            (or keep (erase-buffer)))

I tend to prefer (unless ...) here.

> +Optional ninth arg KEEP, if non-nil, then the output buffer is
> +not erased before inserting the output."

I think something went wrong with the grammar here.

> -                    (erase-buffer)))
> +                    (if keep
> +                        (goto-char (point-max))
> +                      (erase-buffer))))

Is this in a save-excursion? If not, is there a way to preserve the point in 
the target buffer? (Is that desirable?)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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