unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael.albinus@gmx.de, 21313@debbugs.gnu.org
Subject: bug#21313: 25.0.50; Strange errors from dbus-handle-event
Date: Fri, 16 Oct 2015 11:25:36 +0200	[thread overview]
Message-ID: <87oafz412n.fsf@gnu.org> (raw)
In-Reply-To: <83h9lr6x3c.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Oct 2015 11:23:19 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Looking at QUIT, the difference between my original code and the new
>> one is just when process_quit_flag() is called.  process_quit_flag()
>> always signals quit.  So with the new code, the signal is handled by
>> the right recipient.  Who consumed (and discarded) it before?
>
> process_quit_flag itself:
>
>   void
>   process_quit_flag (void)
>   {
>     Lisp_Object flag = Vquit_flag;
>     Vquit_flag = Qnil; <<<<<<<<<<<<<<<<<<<<<<<
>
> The gotcha here is that C-g is handled specially, i.e. not by
> process_quit_flag, during processing of user input.

Ok, I see.

> That special handling was bypassed because process_quit_flag attempted
> to process it too early, and reseted the flag afterwards, thus
> disabling that special processing.

What's a bit confusing is that it has been handled at least partially:
Quit was echoed but there was no "real" effect.  So I guess somewhere
the quit signal emitted by process_quit_flag() was caught by whatever
code does echo messages and then re-signalled, and the top-level handler
discarded it because Vquit_flag was nil.

The question is if Quit should have been echoed at all?  Well, it's good
for the user to see that emacs received it but then he'll wonder like me
why it has no effect.  So maybe it should have echoed "Quit [ignored]"
or something like that.

>> Well, I think I just remember that I want to bind Qinhibit_quit to Qt
>> whenever I need to call Lisp functions from C.
>
> In debugging code that isn't supposed to disrupt the control flow,
> yes, that's a good rule.  But if you write C code for "normal"
> processing, then no, don't inhibit quitting like that just because you
> call Lisp.

Yes, obviously.

Bye,
Tassilo





  reply	other threads:[~2015-10-16  9:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 16:24 bug#21313: 25.0.50; Strange errors from dbus-handle-event Tassilo Horn
2015-09-09 20:43 ` Tassilo Horn
2015-09-11 12:28   ` Tassilo Horn
2015-09-11 12:39     ` Eli Zaretskii
2015-09-11 13:06       ` Tassilo Horn
2015-09-11 13:59         ` Eli Zaretskii
2015-09-15 15:37           ` Tassilo Horn
2015-09-15 16:01             ` Eli Zaretskii
2015-09-16 11:39               ` Tassilo Horn
2015-09-22  5:49               ` Tassilo Horn
2015-09-22  8:00                 ` Robert Pluim
2015-09-22  8:21                   ` Tassilo Horn
2015-10-02 18:36                     ` Tassilo Horn
2015-10-02 19:05                       ` Eli Zaretskii
2015-10-02 20:33                         ` Tassilo Horn
2015-10-02 21:10                           ` Eli Zaretskii
2015-10-02 21:26                             ` Michael Albinus
2015-10-03  5:40                               ` Tassilo Horn
2015-10-03  6:32                                 ` Tassilo Horn
2015-10-03  7:14                                   ` Eli Zaretskii
2015-10-03  8:10                                     ` Tassilo Horn
2015-10-03  9:53                                       ` Eli Zaretskii
2015-10-03 12:06                                         ` Tassilo Horn
2015-10-03  7:43                                 ` Michael Albinus
2015-10-03  8:13                                   ` Tassilo Horn
2015-10-03  9:38                                     ` Tassilo Horn
2015-10-03 10:53                                       ` Eli Zaretskii
2015-10-14  9:58                                         ` Tassilo Horn
2015-10-14 17:05                                           ` Eli Zaretskii
2015-10-14 19:37                                             ` Tassilo Horn
2015-10-14 19:43                                               ` Eli Zaretskii
2015-10-15 11:37                                                 ` Tassilo Horn
2015-10-15 16:56                                                   ` Eli Zaretskii
2015-10-15 17:35                                                     ` Tassilo Horn
2015-10-15 19:44                                                       ` Eli Zaretskii
2015-10-16  4:53                                                         ` Tassilo Horn
2015-10-16  7:02                                                           ` Eli Zaretskii
2015-10-16  7:45                                                             ` Tassilo Horn
2015-10-16  8:23                                                               ` Eli Zaretskii
2015-10-16  9:25                                                                 ` Tassilo Horn [this message]
2015-10-16 10:11                                                                   ` Eli Zaretskii
2015-10-16 10:22                                                                     ` Tassilo Horn
2015-10-29  7:43                                                                       ` Tassilo Horn
2015-10-29 16:19                                                                         ` Eli Zaretskii

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=87oafz412n.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=21313@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.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 public inbox

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

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