From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30461: 27.0.50; Incorrect description of sentinels Date: Sat, 17 Feb 2018 15:50:15 +0200 Message-ID: <83wozbbu94.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1518875359 17112 195.159.176.226 (17 Feb 2018 13:49:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Feb 2018 13:49:19 +0000 (UTC) Cc: 30461@debbugs.gnu.org To: p.stephani2@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 17 14:49:14 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1en2rT-0003kw-W5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Feb 2018 14:49:08 +0100 Original-Received: from localhost ([::1]:52094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en2tW-0002Az-5j for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Feb 2018 08:51:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en2tP-0002AU-9g for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2018 08:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en2tK-0006cv-DI for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2018 08:51:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en2tK-0006cn-95 for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2018 08:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1en2tJ-0006fJ-Uq for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2018 08:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Feb 2018 13:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30461 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30461-submit@debbugs.gnu.org id=B30461.151887542525572 (code B ref 30461); Sat, 17 Feb 2018 13:51:01 +0000 Original-Received: (at 30461) by debbugs.gnu.org; 17 Feb 2018 13:50:25 +0000 Original-Received: from localhost ([127.0.0.1]:47615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1en2sj-0006eO-Ed for submit@debbugs.gnu.org; Sat, 17 Feb 2018 08:50:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1en2si-0006eB-0g for 30461@debbugs.gnu.org; Sat, 17 Feb 2018 08:50:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en2sX-0005sP-Ko for 30461@debbugs.gnu.org; Sat, 17 Feb 2018 08:50:18 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en2sX-0005rY-Cb; Sat, 17 Feb 2018 08:50:13 -0500 Original-Received: from [176.228.60.248] (port=3685 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1en2sW-0000mi-QX; Sat, 17 Feb 2018 08:50:13 -0500 In-reply-to: (p.stephani2@gmail.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143375 Archived-At: > Date: Wed, 14 Feb 2018 23:10:32 +0100 > From: p.stephani2@gmail.com > > > A =E2=80=9Cprocess sentinel=E2=80=9D is a function that is called wheneve= > r the > > associated process changes status for any reason, including signals > > (whether sent by Emacs or caused by the process=E2=80=99s own actions) th= > at > > terminate, stop, or continue the process. > > But that doesn't seem to be the case: > > (let ((p (make-process :name "sleep" > :command '("sleep" "1h") > :sentinel (lambda (p s) > (message "sentinel: %S" s))))) > (sit-for 0.1) > (stop-process p) > (sit-for 0.1) > (continue-process p)) > > If you then check the messages buffer, you see only the following: > > > sentinel: "run" > > That is, the sentinel isn't called when the process is stopped or > continued. I think the sentinel is in fact called when the process is continued: that's where that "run" came from, right? You will see in process_send_signal that we explicitly call the sentinel when the signal is SIGCONT. > However, the sentinel *is* called when manually sending a STOP > signal to the process. Did you send SIGSTOP or SIGTSTP? stop-process sends the latter. > Furthermore, the description about the possible event strings doesn't > mention "run". The documentation describes the strings produced by status_message. You will see that there's an "else" catch-all clause there that produces the name of the status symbol it is passed as an argument, in case it doesn't recognize it. I believe that's where "run" comes from (note that it has no final newline, unlike the documented event strings). We could add "run", but it should be clear that by the same token the string could be _anything_, a name of any symbol which is stashed in the process's status.