technomancy / emacs-starter-kit

[ARCHIVED] this is ancient history
GNU General Public License v3.0
2.86k stars 887 forks source link

Calling (paredit-mode) etc. from elisp code always enables, not toggles, the mode #138

Closed drothlis closed 12 years ago

drothlis commented 12 years ago

Hi! Something I learned today:

'paredit-mode' with no arguments only toggles the mode when called interactively. From Lisp, ommitted or 'nil' argument enables the mode -- this "makes it easy to enable the minor mode in a major mode hook, for example".

See: (info "(elisp) Defining Minor Modes")

I, as no doubt many others, learn a lot of my elisp from your excellent starter kit; so it would be nice to see this standard way of enabling minor modes reflected in your code.

Unfortunately this change will break any users' code that calls esk-turn-on-paredit, esk-turn-on-whitespace, or esk-turn-on-idle-highlight-mode. For those users the fix is to replace (add-hook 'xyz 'esk-turn-on-paredit) with (add-hook 'xyz 'paredit-mode).

technomancy commented 12 years ago

good catch; thanks.