all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Hans-Peter Deifel <hpd@hpdeifel.de>
Cc: emacs-devel@gnu.org
Subject: Re: Modules: should_quit vs. process_input in Emacs 27
Date: Tue, 23 Jul 2019 17:52:10 +0300	[thread overview]
Message-ID: <83lfwopzvp.fsf@gnu.org> (raw)
In-Reply-To: <87tvbdn4mq.fsf@hpdeifel.de> (message from Hans-Peter Deifel on Mon, 22 Jul 2019 23:25:33 +0200)

> From: Hans-Peter Deifel <hpd@hpdeifel.de>
> Date: Mon, 22 Jul 2019 23:25:33 +0200
> 
> I'm writing a dynamic module in C that includes a long-running
> computation. It uses `should_quit' as per the documentation to check
> from time to time if the user wants to quit, in which case the
> computation is immediately aborted. This works great on Emacs 26.2, but
> doesn't on master: The computation just keeps on computing, no matter
> how often the user presses C-g.
> 
> The git log and the info manual in master mention the new environment
> function `process_inputs' that should be used instead of `should_quit'.
> This does indeed work, but now the module is no longer compatible with
> Emacs 26.
> 
> What should module authors in this case do to keep their modules
> compatible with older Emacs versions? Conditional compilation?

Not conditional compilation; dynamic discovery of the Emacs version in
which the module is running.  How to do that is described in the
"Module Initialization" node of the ELisp manual.

> Also, what's the purpose of the current `should_quit' in master, if it
> doesn't work for the above use-case any more. Why doesn't it simply
> behave like the following?
> 
>   process_input (env) == emacs_process_input_quit

AFAIR, because process_input processes pending input events.
Sometimes you may wish not to do that.



      reply	other threads:[~2019-07-23 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 21:25 Modules: should_quit vs. process_input in Emacs 27 Hans-Peter Deifel
2019-07-23 14:52 ` Eli Zaretskii [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

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

  git send-email \
    --in-reply-to=83lfwopzvp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=hpd@hpdeifel.de \
    /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.