From: Michael Albinus <michael.albinus@gmx.de>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 39067@debbugs.gnu.org, Madhu <madhu@cs.unm.edu>
Subject: bug#39067: shell-command-dont-erase-buffer strange behaviour
Date: Tue, 14 Jan 2020 09:49:14 +0100 [thread overview]
Message-ID: <87muaqv2wl.fsf@gmx.de> (raw)
In-Reply-To: <87d0bnt8d2.fsf@calancha-pc.dy.bbexcite.jp> (Tino Calancha's message of "Mon, 13 Jan 2020 21:22:01 +0100")
Tino Calancha <tino.calancha@gmail.com> 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.
Thanks!
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'.
'shell-command-save-pos-or-erase'
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.
"being"
"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.
next prev parent reply other threads:[~2020-01-14 8:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 5:34 bug#39067: shell-command-dont-erase-buffer strange behaviour Madhu
2020-01-11 9:25 ` Eli Zaretskii
2020-01-11 9:57 ` Michael Albinus
2020-01-13 20:22 ` Tino Calancha
2020-01-14 8:49 ` Michael Albinus [this message]
2020-01-19 10:19 ` Tino Calancha
2020-01-19 18:05 ` Glenn Morris
2020-01-19 20:55 ` Tino Calancha
2020-01-20 3:25 ` Eli Zaretskii
2020-01-20 13:20 ` Tino Calancha
2020-02-01 13:36 ` Michael Albinus
2020-01-20 10:04 ` Mattias Engdegård
2020-01-20 13:21 ` Tino Calancha
2020-01-20 13:30 ` Mattias Engdegård
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87muaqv2wl.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=39067@debbugs.gnu.org \
--cc=madhu@cs.unm.edu \
--cc=tino.calancha@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).