all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 7291@debbugs.gnu.org
Subject: bug#7291: 24.0.50; `non-essential' is incomprehensible
Date: Fri, 29 Oct 2010 12:20:36 -0400	[thread overview]
Message-ID: <jwvlj5h2dhh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <D07ECE8A4198434681B524AECADC9E82@us.oracle.com> (Drew Adams's message of "Thu, 28 Oct 2010 14:58:34 -0700")

>> That's because you have it backwards:
>> It means that the task being performed is so UNimportant that
>> the user should NOT be interrupted for it.
> And there's the potential confusion.  Which task is the "currently executing
> code" whose task gets characterized as essential or non-essential?

Elisp is single-threaded, so there is never more than one task at any
given time.  So I don't understand the question.

> It is quite possible to read the doc and think that the "currently
> executing code" refers to the code that binds this var to non-nil in
> order to prevent it's own interruption.

No, the docstring of a variable always describes the meaning of that
variable, i.e. "what does it mean for the variable to be set to
a particular value".  So the code that sets the non-essential variable
states that "the code is non-essential" and the code that reads it
checks whether it (itself) is non-essential.

> Now you are suggesting that the "task being performed" is the task
> that would be _doing_ the interrupting, not the task that would be
> interrupted.

Again, Elisp is single-threaded, so the current code can't interrupt
some other.

> That comes across because you say "interrupted _for_ it"
> (for the task being performed).  That one word makes all the
> difference - the difference between interrupted "by" some task and
> interrupted "for" (i.e. to perform) some task.

The docstring says:

   Whether the currently executing code is performing an essential task.
   This variable should be non-nil only when running code which should not
   disturb the user.  ...

do you also see such a potential confusion there?

> The doc as written allows an interpretation of the "currently
> performing task" as the task that would (not) be interrupted.  It is
> very easy to think that by "the currently performing task"

As you can see the doc has no such "the currently performing task".

>> > One could easily suppose that a non-essential task is one that it is
>> > NOT IMPORTANT enough to protect against interruption.
>> Yes, I thought it was so easy to suppose that, that the docstring
>> was understandable.
> And yet you just said above that "the task being performed is so UNimportant
> that the user should NOT be interrupted for it".

Yes, sorry I didn't read your sentence carefully until the end.

> In one case we're talking about the nonimportance of the task that might be
> interrupted (so no need to prevent interruption).  In the other case we're
> talking about the nonimportance of the interrupting task.

But the only place where the docstring refers to the word "task" it very
clearly refers to "what the currently executing code is doing".  And it
never uses the word "interrupt" but instead uses "disturb".

> "Non-nil can prevent some tasks from interrupting the user.

Some of your confusion comes from the word "interrupt", so I'd rather
stick to "disturb".

>  Code that might perform a non-essential task can test this
>  variable and dispense with performing the task if the value
>  is non-nil.

No, this is backwards: e.g. Tramp doesn't know that what it does is
non-essential, which is why it needs to look up non-essential to figure
that out.  The only reason it does such a look up is not because it
suspects this is non-essential, but because it is about to do something
that may disturb the user, so it first wants to make sure it is really
necessary to do it.


        Stefan





  reply	other threads:[~2010-10-29 16:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 22:30 bug#7291: 24.0.50; `non-essential' is incomprehensible Drew Adams
2010-10-28  0:52 ` Stefan Monnier
2010-10-28 16:22   ` Drew Adams
2010-10-28 17:14     ` Stefan Monnier
2010-10-28 18:43       ` Michael Albinus
2010-10-28 18:51       ` Drew Adams
2010-10-28 20:12         ` Stefan Monnier
2010-10-28 21:58           ` Drew Adams
2010-10-29 16:20             ` Stefan Monnier [this message]
2010-10-29 16:47               ` Drew Adams
2010-10-29 17:36                 ` Stefan Monnier
2010-10-29  8:36           ` Andreas Schwab
2010-10-29 16:03             ` Stefan Monnier
2010-10-29 16:21               ` Andreas Schwab
2010-10-29 18:29               ` Eli Zaretskii
2010-10-29 23:00                 ` Andy Moreton
2010-10-30  6:52                   ` Eli Zaretskii
2010-10-30 16:16                     ` Drew Adams
2010-10-30 17:53                       ` Michael Albinus
2010-10-30 20:05                         ` Drew Adams
2010-10-29 18:56           ` Alan Mackenzie
2010-10-28 17:33 ` James Cloos
2010-10-28 18:53   ` Drew Adams
2011-07-14 14:35   ` Lars Magne Ingebrigtsen
2010-10-31  2:34 ` MON KEY

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=jwvlj5h2dhh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=7291@debbugs.gnu.org \
    --cc=drew.adams@oracle.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.