* Re: master f17bdee79b1: sgml-mode.el: Cosmetic fixes
[not found] ` <20230715154139.5B03FC06C71@vcs2.savannah.gnu.org>
@ 2023-07-17 8:32 ` Robert Pluim
2023-07-17 12:57 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2023-07-17 8:32 UTC (permalink / raw)
To: emacs-devel; +Cc: Stefan Monnier
>>>>> On Sat, 15 Jul 2023 11:41:39 -0400 (EDT), Stefan Monnier via Mailing list for Emacs changes <emacs-diffs@gnu.org> said:
Stefan> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
Stefan> index b4f5ebf5cd0..d80cdc34775 100644
Stefan> --- a/lisp/textmodes/sgml-mode.el
Stefan> +++ b/lisp/textmodes/sgml-mode.el
Stefan> @@ -66,7 +66,7 @@ When 2, attribute indentation looks like this:
Stefan> </element>"
Stefan> :version "25.1"
Stefan> :type 'integer
Stefan> - :safe 'integerp)
Stefan> + :safe #'integerp)
Isnʼt that already enforced by the ':typeʼ keyword? If so, we have
lots of redundant ':safe' in defcustoms.
Robert
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master f17bdee79b1: sgml-mode.el: Cosmetic fixes
2023-07-17 8:32 ` master f17bdee79b1: sgml-mode.el: Cosmetic fixes Robert Pluim
@ 2023-07-17 12:57 ` Stefan Monnier
2023-07-17 13:17 ` Robert Pluim
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2023-07-17 12:57 UTC (permalink / raw)
To: Robert Pluim; +Cc: emacs-devel
> Stefan> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
> Stefan> index b4f5ebf5cd0..d80cdc34775 100644
> Stefan> --- a/lisp/textmodes/sgml-mode.el
> Stefan> +++ b/lisp/textmodes/sgml-mode.el
> Stefan> @@ -66,7 +66,7 @@ When 2, attribute indentation looks like this:
> Stefan> </element>"
> Stefan> :version "25.1"
> Stefan> :type 'integer
> Stefan> - :safe 'integerp)
> Stefan> + :safe #'integerp)
>
> Isnʼt that already enforced by the ':typeʼ keyword?
No.
> If so, we have lots of redundant ':safe' in defcustoms.
It's not redundant: one describe the set of values that are meaningful
(so as to allow Custom to provide a more helpful UI), the other
specifies which values are believed to be safe when coming from
untrusted sources.
They're closely related and often identical, but not always.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master f17bdee79b1: sgml-mode.el: Cosmetic fixes
2023-07-17 12:57 ` Stefan Monnier
@ 2023-07-17 13:17 ` Robert Pluim
2023-07-17 13:33 ` Eli Zaretskii
2023-07-17 15:18 ` Basil Contovounesios
0 siblings, 2 replies; 5+ messages in thread
From: Robert Pluim @ 2023-07-17 13:17 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
>>>>> On Mon, 17 Jul 2023 08:57:03 -0400, Stefan Monnier <monnier@iro.umontreal.ca> said:
Stefan> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
Stefan> index b4f5ebf5cd0..d80cdc34775 100644
Stefan> --- a/lisp/textmodes/sgml-mode.el
Stefan> +++ b/lisp/textmodes/sgml-mode.el
Stefan> @@ -66,7 +66,7 @@ When 2, attribute indentation looks like this:
Stefan> </element>"
Stefan> :version "25.1"
Stefan> :type 'integer
Stefan> - :safe 'integerp)
Stefan> + :safe #'integerp)
>>
>> Isnʼt that already enforced by the ':typeʼ keyword?
Stefan> No.
If I remove the ':safe' spec, and try to set the value to a string,
M-x customize refuses to apply it, so now I wonder when this failure
to enforce occurs.
>> If so, we have lots of redundant ':safe' in defcustoms.
Stefan> It's not redundant: one describe the set of values that are meaningful
Stefan> (so as to allow Custom to provide a more helpful UI), the other
Stefan> specifies which values are believed to be safe when coming from
Stefan> untrusted sources.
Stefan> They're closely related and often identical, but not always.
Iʼm having a hard time coming up with a situation where they wouldnʼt
be identical, but I guess they exist in the wild.
Robert
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master f17bdee79b1: sgml-mode.el: Cosmetic fixes
2023-07-17 13:17 ` Robert Pluim
@ 2023-07-17 13:33 ` Eli Zaretskii
2023-07-17 15:18 ` Basil Contovounesios
1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2023-07-17 13:33 UTC (permalink / raw)
To: Robert Pluim; +Cc: monnier, emacs-devel
> From: Robert Pluim <rpluim@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 17 Jul 2023 15:17:36 +0200
>
> >>>>> On Mon, 17 Jul 2023 08:57:03 -0400, Stefan Monnier <monnier@iro.umontreal.ca> said:
>
> Stefan> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
> Stefan> index b4f5ebf5cd0..d80cdc34775 100644
> Stefan> --- a/lisp/textmodes/sgml-mode.el
> Stefan> +++ b/lisp/textmodes/sgml-mode.el
> Stefan> @@ -66,7 +66,7 @@ When 2, attribute indentation looks like this:
> Stefan> </element>"
> Stefan> :version "25.1"
> Stefan> :type 'integer
> Stefan> - :safe 'integerp)
> Stefan> + :safe #'integerp)
> >>
> >> Isnʼt that already enforced by the ':typeʼ keyword?
>
> Stefan> No.
>
> If I remove the ':safe' spec, and try to set the value to a string,
> M-x customize refuses to apply it, so now I wonder when this failure
> to enforce occurs.
The :safe property is for using the option in file-local variables,
not for customizing it interactively.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master f17bdee79b1: sgml-mode.el: Cosmetic fixes
2023-07-17 13:17 ` Robert Pluim
2023-07-17 13:33 ` Eli Zaretskii
@ 2023-07-17 15:18 ` Basil Contovounesios
1 sibling, 0 replies; 5+ messages in thread
From: Basil Contovounesios @ 2023-07-17 15:18 UTC (permalink / raw)
To: Robert Pluim; +Cc: Stefan Monnier, emacs-devel
Robert Pluim [2023-07-17 15:17 +0200] wrote:
>>>>>> On Mon, 17 Jul 2023 08:57:03 -0400, Stefan Monnier <monnier@iro.umontreal.ca> said:
>
> Stefan> It's not redundant: one describe the set of values that are meaningful
> Stefan> (so as to allow Custom to provide a more helpful UI), the other
> Stefan> specifies which values are believed to be safe when coming from
> Stefan> untrusted sources.
>
> Stefan> They're closely related and often identical, but not always.
>
> Iʼm having a hard time coming up with a situation where they wouldnʼt
> be identical, but I guess they exist in the wild.
What about user options that can take on one of a set of predefined
atoms, or a custom function: then you may want to declare the defaults
as safe for use in a file-local variable, but not the arbitrary code.
--
Basil
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-17 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <168943569908.27847.5147959039975518199@vcs2.savannah.gnu.org>
[not found] ` <20230715154139.5B03FC06C71@vcs2.savannah.gnu.org>
2023-07-17 8:32 ` master f17bdee79b1: sgml-mode.el: Cosmetic fixes Robert Pluim
2023-07-17 12:57 ` Stefan Monnier
2023-07-17 13:17 ` Robert Pluim
2023-07-17 13:33 ` Eli Zaretskii
2023-07-17 15:18 ` Basil Contovounesios
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).