unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: Pass an argument to a sentinel?
Date: Sat, 29 Jul 2017 12:54:24 +0000	[thread overview]
Message-ID: <CAArVCkRimBt0YVSgAJsucJg_uoGP5s7_B4i9zjqO+xCX-jc5YA@mail.gmail.com> (raw)
In-Reply-To: <831soz4vc8.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 29. Juli 2017 um 08:22 Uhr:

> > From: Yassin Philip <philcm@gnu.org>
> > Date: Fri, 28 Jul 2017 21:16:14 +0100
> >
> >     "The sentinel receives /two arguments/: the process for which the
> >     event occurred, and a string describing the type of event."
> >
> > But I need it to receive at least one more argument, because at the end
> > of the process, the context (like the buffer at the time of the sentinel
> > call) may have changed.
> >
> > How can I pass arguments to a sentinel?
>
> One way is to have a global variable with those additional values.
> Another is to put a property on the process object whose value
> provides those arguments.
>
>
The third (and most generic) way is to use a lexical closure.


      reply	other threads:[~2017-07-29 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 20:16 Pass an argument to a sentinel? Yassin Philip
2017-07-29  6:21 ` Eli Zaretskii
2017-07-29 12:54   ` Philipp Stephani [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAArVCkRimBt0YVSgAJsucJg_uoGP5s7_B4i9zjqO+xCX-jc5YA@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).