On Wed, Feb 1, 2017 at 8:14 AM Eli Zaretskii wrote: > > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > > From: Clément Pit-Claudel > > Date: Wed, 1 Feb 2017 02:33:14 -0500 > > > > Well, it's not uncommon to want to extend existing behavior, and > add-function lets you do it easily — more easily than if the variable may > be nil. > > Easier than using setq? I doubt that. > Using add-function instead of setq has these advantages: - You do not need to copy-paste the original variable definition, and *then* add your tweaks around it. (add-function :around ..) does that for you. Given that the *-function definitions can be multiple lines long, it saves some clutter from your emacs config. - If the variable customization does not work out, or you discovered a bug in the customization (and you do not have time to debug it), you can remove that safely using (remove-function ..) and get back the original definition.. No need to find the original definition and re-eval that. - If the original definition changes upstream, there are lesser chances of your config breaking if you did add-function than setq. And if it breaks due to an upstream change, just do remove-function till you get time to fix your customization. - Added convenience that you can edebug your customization function that you "add" to the original *-function variable. So you debug focuses only on the customization and not also on the original definition. -- Kaushal Modi