[Top][All Lists]

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

bug#39067: shell-command-dont-erase-buffer strange behaviour

From: Michael Albinus
Subject: bug#39067: shell-command-dont-erase-buffer strange behaviour
Date: Tue, 14 Jan 2020 09:49:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tino Calancha <address@hidden> writes:

Hi Tino,

> Fixed the logic to cover the side case reported in this thread.
>> The current implementation in simple.el uses
>> shell-command--save-pos-or-erase and shell-command--set-point-after-cmd,
>> both are internal functions. Could we make them first class citizens,
>> that Tramp could profit from?
> Renamed them to shell-command-save-pos-or-erase, 
> shell-command--set-point-after-cmd.


You plan to bring it into Emacs 27.1. FTR, related Tramp changes will
appear with Emacs 27.2 only. This shouldn't be a problem I guess, in
case there's sombdy concerned, a Tramp ELPA release will make it
available earlier.

I haven't tested yet, but some minor nits:

> --- a/doc/emacs/misc.texi
> +++ b/doc/emacs/misc.texi
> +  By default, the output buffer is erased between shell commands, except
> +when the output goes to the current buffer.  If you change the value
> +of the variable @code{shell-command-dont-erase-buffer} to @code{erase},
> +then the output buffer is always erased.  Any other non-@code{nil}
> +value prevents to erase the output buffer.
> +
> +This variable also controls where to set the point in the output buffer
> +after the command completes; see the documentation of the variable for 
> details.

s/variable/user option/

> --- a/etc/NEWS
> +++ b/etc/NEWS
> +*** New functions shell-command-save-pos-or-erase' and
> +'shell-command-set-point-after-cmd'.

Maybe you could be a little bit more verbose, saying that they control
how point is handled between two consecutive shell commands in the same buffer.

> --- a/lisp/simple.el
> +++ b/lisp/simple.el
>  (defcustom shell-command-dont-erase-buffer nil
> +A `nil' value erases the output buffer before execute
> +the shell command, except when the output buffer is the current one.

We don't quote nil.
"execution of the shell command"

> +Other non-nil values prevent the output buffer from be erased and
> +set the point after execute the shell command.

"execution of the shell command"

> +          ;; sucesive commands knows the position where the new comman start.

;; successive commands know the position where the new command starts.

> +          ;; (unless (and pos (memq sym '(save-point beg-last-out)))

This is superfluous, isn't it?

> --- a/test/lisp/simple-tests.el
> +++ b/test/lisp/simple-tests.el

> +  "The output buffer is erased or not according with 
> `shell-command-dont-erase-buffer'."

"according to" (?)

> +(ert-deftest simple-tests-shell-command-dont-erase-buffer ()
> +  "The point is set at the expected position after execute the command."

"execution of the command"

Best regards, Michael.

reply via email to

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