[Top][All Lists]

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

defcustom :set vs. add-variable-watcher

From: Ihor Radchenko
Subject: defcustom :set vs. add-variable-watcher
Date: Thu, 05 Jan 2023 08:06:45 +0000


AFAIK, the traditional way to provide side effects to customization
value changes if :set option in `defcustom' definition.

However, it has been suggested [1] that one might also utilize
`add-variable-watcher' for the same purpose.

Given that many users don't actually use customize interface and instead
tend to set variables directly, `add-variable-watcher' looks like a more
reliable option compared to :set.

Are there any reasons to prefer :set over `add-variable-watcher'? Maybe
some non-obvious pitfalls?

[1] https://orgmode.org/list/87h6x8kluc.fsf@localhost

Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

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