all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25292: Ambiguity in doc string of defvar
@ 2016-12-29 18:18 Alan Mackenzie
  2016-12-29 18:29 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2016-12-29 18:18 UTC (permalink / raw
  To: 25292

Hello, Emacs.

The doc string for defvar includes this bit:

    The optional argument INITVALUE is evaluated, and used to set
    SYMBOL, only if SYMBOL's value is void.

Supposing SYMBOL's value is bound.  Clearly it does not get set to
INITVALUE.  But in this case is INITVALUE evaluated (and the result
discarded) or not?  The text leaves this ambiguous.  An improvement
would be the appropriate one of the following:

    If SYMBOL's value is void, the optional argument INITVALUE is
    evaluated and used to set SYMBOL.

    INITVALUE is evaluated, and if SYMBOL's value is void, it is used to
    set SYMBOL.

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-29 18:18 bug#25292: Ambiguity in doc string of defvar Alan Mackenzie
@ 2016-12-29 18:29 ` Eli Zaretskii
  2016-12-29 19:42   ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2016-12-29 18:29 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: 25292

> Date: Thu, 29 Dec 2016 18:18:38 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
>     INITVALUE is evaluated, and if SYMBOL's value is void, it is used to
>     set SYMBOL.                                            ^^

That "it" is ambiguous.  By default, people tend to interpret "it" as
referring to the last noun before it, but that's not what you mean in
this case.

And after all that, are you sure INITVALUE is always evaluated?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-29 18:29 ` Eli Zaretskii
@ 2016-12-29 19:42   ` Alan Mackenzie
  2016-12-29 20:35     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2016-12-29 19:42 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: 25292

Hello, Eli.

On Thu, Dec 29, 2016 at 08:29:15PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 29 Dec 2016 18:18:38 +0000
> > From: Alan Mackenzie <acm@muc.de>

> >     INITVALUE is evaluated, and if SYMBOL's value is void, it is used to
> >     set SYMBOL.                                            ^^

> That "it" is ambiguous.  By default, people tend to interpret "it" as
> referring to the last noun before it, but that's not what you mean in
> this case.

Yes, it's no better than what I was complaining about.  :-(

> And after all that, are you sure INITVALUE is always evaluated?

I've had a look at eval.c.  INITVALUE is evaluated only when it's going
to be used.

So, maybe the whole paragraph should look like this:

    If SYMBOL's value is void and the optional argument INITVALUE is
    provided, INITVALUE is evaluated and the result used to set SYMBOL.
    If SYMBOL is buffer-local, its default value is what is set;
    buffer-local values are not affected.  If INITVALUE is missing,
    SYMBOL's value is not set.
 
What do you think?

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-29 19:42   ` Alan Mackenzie
@ 2016-12-29 20:35     ` Eli Zaretskii
  2016-12-29 20:57       ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2016-12-29 20:35 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: 25292

> Date: Thu, 29 Dec 2016 19:42:38 +0000
> Cc: 25292@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
>     If SYMBOL's value is void and the optional argument INITVALUE is
>     provided, INITVALUE is evaluated and the result used to set SYMBOL.
                                                           ^^^^^^^^^^^^^
"...to set SYMBOL's value."

>     If SYMBOL is buffer-local, its default value is what is set;
>     buffer-local values are not affected.  If INITVALUE is missing,
>     SYMBOL's value is not set.
>  
> What do you think?

Other than that, LGTM, thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-29 20:35     ` Eli Zaretskii
@ 2016-12-29 20:57       ` Alan Mackenzie
  2016-12-30  7:46         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2016-12-29 20:57 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: 25292-done

Hello, Eli.

On Thu, Dec 29, 2016 at 10:35:07PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 29 Dec 2016 19:42:38 +0000
> > Cc: 25292@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> >     If SYMBOL's value is void and the optional argument INITVALUE is
> >     provided, INITVALUE is evaluated and the result used to set SYMBOL.
>                                                            ^^^^^^^^^^^^^
> "...to set SYMBOL's value."

> >     If SYMBOL is buffer-local, its default value is what is set;
> >     buffer-local values are not affected.  If INITVALUE is missing,
> >     SYMBOL's value is not set.
 
> > What do you think?

> Other than that, LGTM, thanks.

OK.  I've made that correction, and committed the amended doc string.
I'm closing the bug as fixed.

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-29 20:57       ` Alan Mackenzie
@ 2016-12-30  7:46         ` Eli Zaretskii
  2016-12-30  9:02           ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2016-12-30  7:46 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: 25292

> Date: Thu, 29 Dec 2016 20:57:22 +0000
> Cc: 25292-done@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> OK.  I've made that correction, and committed the amended doc string.

Thanks, but why on master?...





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-30  7:46         ` Eli Zaretskii
@ 2016-12-30  9:02           ` Alan Mackenzie
  2016-12-30  9:42             ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2016-12-30  9:02 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: 25292

Hello, Eli.

On Fri, Dec 30, 2016 at 09:46:46AM +0200, Eli Zaretskii wrote:
> > Date: Thu, 29 Dec 2016 20:57:22 +0000
> > Cc: 25292-done@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > OK.  I've made that correction, and committed the amended doc string.

> Thanks, but why on master?...

I think I assumed (subconsciously) that emacs-25 was deep frozen prior
to the next release.

Anyhow, I've backported the change onto emacs-25.

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#25292: Ambiguity in doc string of defvar
  2016-12-30  9:02           ` Alan Mackenzie
@ 2016-12-30  9:42             ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2016-12-30  9:42 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: 25292

> Date: Fri, 30 Dec 2016 09:02:42 +0000
> Cc: 25292@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > > OK.  I've made that correction, and committed the amended doc string.
> 
> > Thanks, but why on master?...
> 
> I think I assumed (subconsciously) that emacs-25 was deep frozen prior
> to the next release.

Not for documentation changes.

> Anyhow, I've backported the change onto emacs-25.

Thanks!





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-12-30  9:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-29 18:18 bug#25292: Ambiguity in doc string of defvar Alan Mackenzie
2016-12-29 18:29 ` Eli Zaretskii
2016-12-29 19:42   ` Alan Mackenzie
2016-12-29 20:35     ` Eli Zaretskii
2016-12-29 20:57       ` Alan Mackenzie
2016-12-30  7:46         ` Eli Zaretskii
2016-12-30  9:02           ` Alan Mackenzie
2016-12-30  9:42             ` Eli Zaretskii

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.