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

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

bug#53153: [External] : bug#53153: package-quickstart: unusual autoload


From: Drew Adams
Subject: bug#53153: [External] : bug#53153: package-quickstart: unusual autoload form in selectrum gives byte-compilation warning
Date: Thu, 13 Jan 2022 16:20:00 +0000

> Global minor modes define a `defcustom` and its
> :group is usually provided by default by the last 
> `defgroup` but if you copy this `define-minor-mode`
> to some other file (such as an autoloads file),
> then you can't rely on this defaulting so you
> should provide a `:group` explicitly.

FWIW -

IMO, it's misguided to recommend that people not
use :group explicitly when they can get away
with depending on the preceding :group being for
the same group.

That's a sort of "premature visual optimization"
that provides no real advantage and presents the
disadvantages of (1) being less clear (at the
limit, it requires readers of the code to search
backward) and (2) gotchas such as the one you
described.

People no doubt have different feelings about
such things, which is fine - it's partly an
individual style choice.  I disagree with
recommending one or the other as a general
guideline.

But if one of them is to be used as a guideline
it should be to specify :group explicitly, even
when it might not be strictly necessary.  Clear
for all.

And what's the purported advantage of omitting
:group when it's not needed?  Presumably it's
 (1) less clutter/noise and perhaps (2) easier
to notice when the "current" :group changes.

#1 is very minor, at best.  :group labels are
not verbose.

#2 can be misleading.  If a reader of the code
tries to depend on each :group being significant
(i.e., it can't be omitted), that assumption
will bite, sooner or later.

(Just one opinion.)





reply via email to

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