GNU bug report logs - #39067
shell-command-dont-erase-buffer strange behaviour

Previous Next

Package: emacs;

Reported by: madhu <at> cs.unm.edu

Date: Fri, 10 Jan 2020 05:36:02 UTC

Severity: normal

Merged with 42922

Found in version 27.1

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: madhu <at> cs.unm.edu
Subject: bug#39067: closed (Re: bug#39067: shell-command-dont-erase-buffer
 strange behaviour)
Date: Sun, 19 Jan 2020 10:20:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 39067 <at> debbugs.gnu.org.

-- 
39067: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39067
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: 39067-done <at> debbugs.gnu.org
Subject: Re: bug#39067: shell-command-dont-erase-buffer strange behaviour
Date: Sun, 19 Jan 2020 11:19:19 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

Fixed the bug into emacs-27 branch with commit:
'Fix shell-command-dont-erase-buffer feature'
(2eb0b7835d1a9cd4b804436e33c71058cb38f178)

> I haven't tested yet, but some minor nits:
Thank Michael for the corrections!  I have added then but this one:

> ;; 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?
That is requred for a corner case: one of the new tests fails if I
remove that.


[Message part 3 (message/rfc822, inline)]
From: Madhu <madhu <at> cs.unm.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: shell-command-dont-erase-buffer strange behaviour
Date: Fri, 10 Jan 2020 05:34:18 +0000
C-h v shell-command-dont-erase-buffer
C-h f shell-command

Cut to the chase with the test case:

(let ((shell-command-dont-erase-buffer 'beg-last-out))
  (with-current-buffer (get-buffer-create "OUT")
    (erase-buffer)
    (shell-command "/bin/echo FOO" t)
    (shell-command "/bin/echo FOO" t)))

The result (as expected) is a buffer named OUT with 2 lines FOO.
The same result is expected with the following code:

(let ((shell-command-dont-erase-buffer 'beg-last-out))
  (with-current-buffer (get-buffer-create "OUT")
    (erase-buffer)
    (shell-command "/bin/echo FOO" "OUT")
    (shell-command "/bin/echo FOO" "OUT")))

However in this case (and in some other cases) shell-command erases the
"OUT" buffer despite a non-NIL binding of
shell-command-dont-erase-buffer

(at least since emacs 25.2)



This bug report was last modified 4 years and 277 days ago.

Previous Next


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