unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables
@ 2022-07-08 12:47 Eli Zaretskii
  2022-07-08 13:03 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-07-08 12:47 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

> branch: master
> commit 38697a07c0f2b99b76c41cb1096543681342a405
> Author: Stefan Kangas <stefan@marxist.se>
> Commit: Stefan Kangas <stefan@marxist.se>
> 
>     Add :safe property to ffap-machine-p-* variables
>     
>     * lisp/ffap.el (ffap--accept-or-reject-p): New predicate defun.
>     (ffap-machine-p-local, ffap-machine-p-known)
>     (ffap-machine-p-unknown): Add :safe property using above new
>     predicate.

This uses an internal function as the value of a property of a user
option, which I think is not a good idea.  How about making the
function public instead (and changing its name to
'ffap-accept-or-reject-p' while at that)?



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

* Re: master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables
  2022-07-08 12:47 master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables Eli Zaretskii
@ 2022-07-08 13:03 ` Stefan Monnier
  2022-07-08 13:16   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2022-07-08 13:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Kangas, emacs-devel

> This uses an internal function as the value of a property of a user
> option, which I think is not a good idea.

Why is that a problem?  Internal names means users shouldn't rely on the
fact that this function exists and will keep existing under that name or
that its behavior will be preserved, but here the users aren't expected
to call this function under this internal name, they're just expected to
call the function that happens to be stored in the
`safe-local-variable`, regardless of its name and even if
it's anonymous.


        Stefan




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

* Re: master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables
  2022-07-08 13:03 ` Stefan Monnier
@ 2022-07-08 13:16   ` Eli Zaretskii
  2022-07-08 19:48     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-07-08 13:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: stefan, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Stefan Kangas <stefan@marxist.se>,  emacs-devel@gnu.org
> Date: Fri, 08 Jul 2022 09:03:25 -0400
> 
> > This uses an internal function as the value of a property of a user
> > option, which I think is not a good idea.
> 
> Why is that a problem?

It's not nice.  If we are serious about internal things being
internal, we should avoid exposing them to users.



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

* Re: master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables
  2022-07-08 13:16   ` Eli Zaretskii
@ 2022-07-08 19:48     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2022-07-08 19:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: stefan, emacs-devel

Eli Zaretskii [2022-07-08 16:16:57] wrote:
>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>> Cc: Stefan Kangas <stefan@marxist.se>,  emacs-devel@gnu.org
>> Date: Fri, 08 Jul 2022 09:03:25 -0400
>> > This uses an internal function as the value of a property of a user
>> > option, which I think is not a good idea.
>> Why is that a problem?
> It's not nice.  If we are serious about internal things being
> internal, we should avoid exposing them to users.

I don't see why.  AFAIK it's definitely no worse (and arguably better)
than having an anonymous function, and I've never heard anyone complain
about exposing an anonymous function on `safe-local-variable`.

To me, this is similar to

    (defalias 'foo-bar #'foo--bar-thingy)

The fact that the value stored is an internal function is not important
because the official API is "call `foo-bar`" and we "promise" that this
API will be preserved even if `foo--bar-thingy` disappears or changes.


        Stefan




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

end of thread, other threads:[~2022-07-08 19:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 12:47 master 38697a07c0 1/2: Add :safe property to ffap-machine-p-* variables Eli Zaretskii
2022-07-08 13:03 ` Stefan Monnier
2022-07-08 13:16   ` Eli Zaretskii
2022-07-08 19:48     ` Stefan Monnier

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