bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60623: 30.0.50; Add forward-sentence with tree sitter support


From: Drew Adams
Subject: bug#60623: 30.0.50; Add forward-sentence with tree sitter support
Date: Mon, 9 Jan 2023 15:57:16 +0000

> > Exactly.  IMO, if the variable can have
                   ^^
> > a nonfunction value, especially nil, then
> 
> Bad idea.

I know you think so. ;-)

> That precludes changing the value of the
> variable with `add-function`,

Yes, it does, at least blindly and ignoring
its current value.  And that's _appropriate_
IF the var can have a non-function value.

But even in that case the var value can be
tested to see if it's a function, and if/when
so, advising it can make sense.

> whereas `add-function` is often the best way for
> a major/minor mode to change that variable (actually, the "only" way to
> do it with some hope that it will interact correctly with other modes
> that may change it as well).

A legitimate argument.  But it doesn't apply to
a variable already defined so that it "can have
a nonfunction value."  Did you perhaps miss that
"if"?

I also don't agree that that (_good_) reason you
give is all-deciding.

I'd say that _other things being equal_, yes,
you can take advantage of that good reason, IF
the variable's value can be ensured to always be
a function, or sometimes even if it just is
currently a function.

IOW, you give one (good) reason for one (good)
practice, which, yes, can sometimes make sense.

> > there's no need (nothing gained, and even
> > possible confusion/misunderstanding added) by
> > adding "-default-" to the name.
> >
> > On the other hand, if the value must always
> > be a function, then having "-default-" in the
> > name makes sense.
> 
> Agreed.  It's also helpful when you look at the var's
> value, it lets you know that it hasn't been modified.






reply via email to

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