GNU bug report logs - #31441
26; doc of functions `(lax-)plist-get'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 13 May 2018 18:53:01 UTC

Severity: minor

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31441 in the body.
You can then email your comments to 31441 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31441; Package emacs. (Sun, 13 May 2018 18:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 May 2018 18:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26; doc of functions `(lax-)plist-get'
Date: Sun, 13 May 2018 11:51:54 -0700 (PDT)
The doc in (elisp) `Plist Access' is mostly OK, but it could
be improved.  The doc strings of these two functions are not OK.

The doc strings need to point out, as does the manual, that `plist-get'
uses `eq' and `lax-plist-get' uses `equal'.  In addition, the doc string
of `lax-plist-get' should, like the manual, say that it is in all other
respects just like `plist-get' (providing a link to that function's
description).

In addition the manual description of `plist-get' could be improved by
mentioning these two things, which are mentioned by its doc string:

1. It uses `eq'.  (If one reads further then this becomes apparent when
   reading about `lax-plist-get'.

2. "This function never signals an error.  This function does not change
   global state, including the match data."  If that is worth saying in
   the doc string (dunno) then it is worth saying in the manual,
   especially as the description of `lax-plist-get' says that it is like
   `plist-get' except for using `equal'.



In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-04-10
Repository revision: c267421647510319d2a70554e42f0d1c394dba0a
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31441; Package emacs. (Sat, 13 Jul 2019 14:44:01 GMT) Full text and rfc822 format available.

Message #8 received at 31441 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 31441 <at> debbugs.gnu.org
Subject: Re: bug#31441: 26; doc of functions `(lax-)plist-get'
Date: Sat, 13 Jul 2019 16:43:37 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> The doc in (elisp) `Plist Access' is mostly OK, but it could
> be improved.  The doc strings of these two functions are not OK.
>
> The doc strings need to point out, as does the manual, that `plist-get'
> uses `eq' and `lax-plist-get' uses `equal'.  In addition, the doc string
> of `lax-plist-get' should, like the manual, say that it is in all other
> respects just like `plist-get' (providing a link to that function's
> description).

I've now done these things, except that (weirdly enough) lax-plist-get
is not like plist-get in all other respects -- plist-get will never
signal an error, while lax-plist-get may signal an error if PLIST isn't
a valid plist.  *sigh*

> In addition the manual description of `plist-get' could be improved by
> mentioning these two things, which are mentioned by its doc string:
>
> 1. It uses `eq'.  (If one reads further then this becomes apparent when
>    reading about `lax-plist-get'.

The manual says (right above plist-get):

They all compare property names using @code{eq}.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 14:44:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 31441 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 14:44:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31441; Package emacs. (Sat, 13 Jul 2019 17:32:02 GMT) Full text and rfc822 format available.

Message #15 received at 31441 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 31441 <at> debbugs.gnu.org
Subject: RE: bug#31441: 26; doc of functions `(lax-)plist-get'
Date: Sat, 13 Jul 2019 10:31:32 -0700 (PDT)
> > In addition the manual description of `plist-get' could be improved by
> > mentioning these two things, which are mentioned by its doc string:
> >
> > 1. It uses `eq'.  (If one reads further then this becomes apparent when
> >    reading about `lax-plist-get'.
> 
> The manual says (right above plist-get):
> 
> They all compare property names using @code{eq}.

... which is belied further down by the description
of `lax-plist-get'.

That's the point.  The intro says that they all use
`eq' - which is wrong.  The entry for `plist-get'
says nothing about comparison.  The entry for `lax...'
says it uses `equal'.

Parallel construction calls for each to say what it
uses, and remove the statement saying that they all
use `eq'.

This is about making the doc clearer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31441; Package emacs. (Sat, 13 Jul 2019 18:33:02 GMT) Full text and rfc822 format available.

Message #18 received at 31441 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 31441 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#31441: 26; doc of functions `(lax-)plist-get'
Date: Sat, 13 Jul 2019 18:31:23 +0000
On Sat, Jul 13, 2019 at 2:44 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> I've now done these things, except that (weirdly enough) lax-plist-get
> is not like plist-get in all other respects -- plist-get will never
> signal an error, while lax-plist-get may signal an error if PLIST isn't
> a valid plist.  *sigh*

How is that weird? `plist-get' might, once in a while, be useful to
call on potentially malicious data. Fequal isn't, so `lax-plist-get'
cannot be, either.

(Fequal can signal, and it's easy to construct objects which will lock
up Emacs for many minutes when compared with Fequal. I think the
latter issue should be fixed, FWIW).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31441; Package emacs. (Sat, 13 Jul 2019 19:15:01 GMT) Full text and rfc822 format available.

Message #21 received at 31441 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 31441 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#31441: 26; doc of functions `(lax-)plist-get'
Date: Sat, 13 Jul 2019 21:14:42 +0200
Pip Cet <pipcet <at> gmail.com> writes:

> On Sat, Jul 13, 2019 at 2:44 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>> I've now done these things, except that (weirdly enough) lax-plist-get
>> is not like plist-get in all other respects -- plist-get will never
>> signal an error, while lax-plist-get may signal an error if PLIST isn't
>> a valid plist.  *sigh*
>
> How is that weird? `plist-get' might, once in a while, be useful to
> call on potentially malicious data. Fequal isn't, so `lax-plist-get'
> cannot be, either.

The *sigh* was in that lax-plist-get is strict in interpreting PLIST
while plist-get is lax in interpreting PLIST.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 11 Aug 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.