emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change in files.el


From: Eli Zaretskii
Subject: Re: Change in files.el
Date: Sat, 28 Jan 2017 16:57:50 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sat, 28 Jan 2017 09:40:11 -0500
> 
> >> Please make it so that the var *always* has a function value.
> > Why is that important?
> 
> - So that you don't have to wrap each and every use inside an `if'.
> - Or so you don't have to fix the docstring to say what happens when the
>   value is nil.
> - Or so you can use `add-function' on it.
> - More generally, so that you can slightly change its behavior without
>   having to re-implement the default behavior by hand.
> - Also, so as to make sure that it is *possible* to reimplement the
>   default behavior by hand (i.e. to make sure the predicate has access to all
>   the info it needs to reproduce the default behavior).

These sound minor to me (and the last two are also possible without
the requirement, AFAIU).  By contrast, insisting on a function value
instead of the default nil forces me to go through at least one more
level of indirection when I need to understand what happens in a
function that references such variables, which sounds like a more
serious trouble from my POV.  I was up to my neck in this when I
needed to document all the various optional behaviors implemented in
isearch.el, and bumped into similar issues several times elsewhere.

So IME following that rule is a net loss.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]