emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] master 9173a44 1/2: [Fix #12] Don't autodisable beacon on hl-


From: Stefan Monnier
Subject: Re: [elpa] master 9173a44 1/2: [Fix #12] Don't autodisable beacon on hl-line-mode
Date: Sun, 18 Oct 2015 20:56:07 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Then I'm clearly unaware of something here.
> There was a discussion here a few months ago where I learned that
> hooks should always be defined with nil initial values.
> So, if it must be defined empty, and it's wrong to add entries to it
> later, then what's the correct way for a package to have a non-empty
> hook?

A custom var shouldn't be modified programmatically.

But hook should usually be modified via `add-hook'
(i.e. programmatically).

Ergo, hooks are better defined with defvar than with defcustom.

Otherwise, define 2 hooks: a defvar one, modified via add-hook, and
a defcustom one, only modified via Custom.


        Stefan



reply via email to

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