Subject: bug#6060: closed (Re: bug#6060: 24.0.50; Process filters can no longer kill buffers)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 29 Apr 2010 23:13:02 +0000

Your bug report

#6060: 24.0.50; Process filters can no longer kill buffers

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 [email-masked].

-- 
6060: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6060
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#6060: 24.0.50; Process filters can no longer kill buffers
From: Stefan Monnier <[email-masked]>
To: Helmut Eller <[email-masked]>
Date: Thu, 29 Apr 2010 18:52:39 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> Yes, works. Thanks for the quick fix.

Thanks for confirming,

        Stefan

Subject: 24.0.50; Process filters can no longer kill buffers
From: Helmut Eller <[email-masked]>
To: [email-masked]
Date: Wed, 28 Apr 2010 16:08:12 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

When GNU Emacs 24.0.50.7 (i686-pc-linux-gnu, GTK+ Version 2.12.12) of
2010-04-28 executes code like this:

(defun filter-test ()
  (let* ((proc (start-process 
                "test" nil "/bin/bash" "-c" 
                "for i in 1 2 3 4 ; do echo $i ; sleep 1 ; done"))
         (buffer (generate-new-buffer "test-buffer"))
         (filter (lambda (proc str)
                   (message "filter: %S" str)
                   (kill-buffer buffer))))
    (set-process-filter proc filter)
    (unwind-protect
        (with-current-buffer buffer
          (while (buffer-live-p buffer)
            (accept-process-output proc)))
      (kill-process proc))))

Emacs signals this error:  (error "Selecting deleted buffer")

This used to work in earlier versions of Emacs.
The problem was most likely introduced by:

2010-04-11  Stefan Monnier  <[email-masked]>

	* process.c (exec_sentinel): Preserve current-buffer.

	* process.c (read_process_output): Move the save-current-buffer to
	apply to both the filter and the non-filter branches.