all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: p.stephani2@gmail.com
Cc: 30461@debbugs.gnu.org
Subject: bug#30461: 27.0.50; Incorrect description of sentinels
Date: Sat, 17 Feb 2018 15:50:15 +0200	[thread overview]
Message-ID: <83wozbbu94.fsf@gnu.org> (raw)
In-Reply-To: <wvr4o9kri5nr.fsf@a.muc.corp.google.com> (p.stephani2@gmail.com)

> 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.





  reply	other threads:[~2018-02-17 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 22:10 bug#30461: 27.0.50; Incorrect description of sentinels p.stephani2
2018-02-17 13:50 ` Eli Zaretskii [this message]
2021-02-04 11:04   ` Lars Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wozbbu94.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30461@debbugs.gnu.org \
    --cc=p.stephani2@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.