all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31441: 26; doc of functions `(lax-)plist-get'
@ 2018-05-13 18:51 Drew Adams
  2019-07-13 14:43 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2018-05-13 18:51 UTC (permalink / raw)
  To: 31441

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''





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

* bug#31441: 26; doc of functions `(lax-)plist-get'
  2018-05-13 18:51 bug#31441: 26; doc of functions `(lax-)plist-get' Drew Adams
@ 2019-07-13 14:43 ` Lars Ingebrigtsen
  2019-07-13 17:31   ` Drew Adams
  2019-07-13 18:31   ` Pip Cet
  0 siblings, 2 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-13 14:43 UTC (permalink / raw)
  To: Drew Adams; +Cc: 31441

Drew Adams <drew.adams@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





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

* bug#31441: 26; doc of functions `(lax-)plist-get'
  2019-07-13 14:43 ` Lars Ingebrigtsen
@ 2019-07-13 17:31   ` Drew Adams
  2019-07-13 18:31   ` Pip Cet
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2019-07-13 17:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 31441

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





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

* bug#31441: 26; doc of functions `(lax-)plist-get'
  2019-07-13 14:43 ` Lars Ingebrigtsen
  2019-07-13 17:31   ` Drew Adams
@ 2019-07-13 18:31   ` Pip Cet
  2019-07-13 19:14     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Pip Cet @ 2019-07-13 18:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 31441

On Sat, Jul 13, 2019 at 2:44 PM Lars Ingebrigtsen <larsi@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).





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

* bug#31441: 26; doc of functions `(lax-)plist-get'
  2019-07-13 18:31   ` Pip Cet
@ 2019-07-13 19:14     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-13 19:14 UTC (permalink / raw)
  To: Pip Cet; +Cc: 31441

Pip Cet <pipcet@gmail.com> writes:

> On Sat, Jul 13, 2019 at 2:44 PM Lars Ingebrigtsen <larsi@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





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

end of thread, other threads:[~2019-07-13 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-13 18:51 bug#31441: 26; doc of functions `(lax-)plist-get' Drew Adams
2019-07-13 14:43 ` Lars Ingebrigtsen
2019-07-13 17:31   ` Drew Adams
2019-07-13 18:31   ` Pip Cet
2019-07-13 19:14     ` Lars Ingebrigtsen

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.