GNU bug report logs - #6079
24.0.50; set-process-sentinel doesn't work inside sentinels

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Helmut Eller <eller.helmut@HIDDEN>; dated Sun, 2 May 2010 12:09:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 May 2010 12:08:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 02 08:08:07 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1O8Xxu-0008MQ-TF
	for submit <at> debbugs.gnu.org; Sun, 02 May 2010 08:08:07 -0400
Received: from mx10.gnu.org ([199.232.76.166])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eller.helmut@HIDDEN>) id 1O8Xxt-0008M2-H3
	for submit <at> debbugs.gnu.org; Sun, 02 May 2010 08:08:06 -0400
Received: from lists.gnu.org ([199.232.76.165]:36324)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <eller.helmut@HIDDEN>) id 1O8Xxo-0005ir-6j
	for submit <at> debbugs.gnu.org; Sun, 02 May 2010 08:08:00 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O8Xxn-0001sZ-PL
	for bug-gnu-emacs@HIDDEN; Sun, 02 May 2010 08:07:59 -0400
Received: from [140.186.70.92] (port=46651 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O8Xxl-0001sQ-8J
	for bug-gnu-emacs@HIDDEN; Sun, 02 May 2010 08:07:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	FSL_HELO_NON_FQDN_1, HELO_NO_DOMAIN, RCVD_IN_BRBL_LASTEXT,
	RCVD_IN_RP_RNBL, 
	T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.0
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <eller.helmut@HIDDEN>) id 1O8Xxk-0008Cx-6v
	for bug-gnu-emacs@HIDDEN; Sun, 02 May 2010 08:07:56 -0400
Received: from dial-178183.pool.broadband44.net ([212.46.178.183]:54469
	helo=ix) by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eller.helmut@HIDDEN>) id 1O8Xxk-0008Cp-08
	for bug-gnu-emacs@HIDDEN; Sun, 02 May 2010 08:07:56 -0400
Received: from helmut by ix with local (Exim 4.69)
	(envelope-from <eller.helmut@HIDDEN>) id 1O8Xxg-0000ww-Kw
	for bug-gnu-emacs@HIDDEN; Sun, 02 May 2010 14:07:52 +0200
From: Helmut Eller <eller.helmut@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.0.50; set-process-sentinel doesn't work inside sentinels
Date: Sun, 02 May 2010 14:07:52 +0200
Message-ID: <m2eihuqzfr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.8 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.8 (-----)

set-process-sentinel can't be used inside sentinels because
exec_sentinel_unwind always restores the old value.  This code 

(let* ((proc (start-process "foo" nil "/bin/bash" "-c" "sleep 100"))
       (a-called nil)
       (sentinel-a (lambda (proc msg)
                     (message "a: %s" msg)
                     (setq a-called t)))
       (b-called nil)
       (sentinel-b (lambda (proc msg)
                     (message "b: %s" msg)
                     (set-process-sentinel proc sentinel-a)
                     (setq b-called t))))
  (set-process-sentinel proc sentinel-b)
  (signal-process proc 'SIGSTOP)
  (message "waiting for b")
  (while (not b-called)
    (accept-process-output proc))
  (signal-process proc 'SIGKILL)
  (message "waiting for a")
  (while (not a-called)
    (accept-process-output proc)))

prints:

  waiting for b
  b: stopped (signal)
  waiting for a
  b: killed

which means that sentinel-b was called twice.  Since sentinel-b sets the
the process sentinel to sentinel-a I would expect that sentinel-b can
only be called once.





Acknowledgement sent to Helmut Eller <eller.helmut@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#6079; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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