Skip to content
This repository
Browse code

Calling (paredit-mode) etc. from elisp code always enables, not toggl…

…es, the mode.

`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")

Third parties using `esk-turn-on-paredit', `esk-turn-on-whitespace', or
`esk-turn-on-idle-highlight-mode' should simply replace
  (add-hook 'xyz 'esk-turn-on-paredit)
with
  (add-hook 'xyz 'paredit-mode)
  • Loading branch information...
commit c71507f85132cf7e3e911629550f03d668781a55 1 parent 794a005
David Röthlisberger authored May 04, 2012
2  modules/starter-kit-lisp.el
@@ -82,7 +82,7 @@
82 82
       (font-lock-add-keywords (intern (concat (symbol-name mode) "-mode"))
83 83
                               '(("(\\|)" . 'esk-paren-face))))
84 84
     (add-hook (intern (concat (symbol-name mode) "-mode-hook"))
85  
-              'esk-turn-on-paredit))
  85
+              'paredit-mode))
86 86
 
87 87
   (defun esk-pretty-fn ()
88 88
     (font-lock-add-keywords nil `(("(\\(\\<fn\\>\\)"
11  starter-kit-defuns.el
@@ -60,15 +60,6 @@
60 60
   (require 'saveplace)
61 61
   (setq save-place t))
62 62
 
63  
-(defun esk-turn-on-whitespace ()
64  
-  (whitespace-mode t))
65  
-
66  
-(defun esk-turn-on-paredit ()
67  
-  (paredit-mode t))
68  
-
69  
-(defun esk-turn-on-idle-highlight-mode ()
70  
-  (idle-highlight-mode t))
71  
-
72 63
 (defun esk-pretty-lambdas ()
73 64
   (font-lock-add-keywords
74 65
    nil `(("(?\\(lambda\\>\\)"
@@ -87,7 +78,7 @@
87 78
 (add-hook 'prog-mode-hook 'esk-turn-on-save-place-mode)
88 79
 (add-hook 'prog-mode-hook 'esk-pretty-lambdas)
89 80
 (add-hook 'prog-mode-hook 'esk-add-watchwords)
90  
-(add-hook 'prog-mode-hook 'esk-turn-on-idle-highlight-mode)
  81
+(add-hook 'prog-mode-hook 'idle-highlight-mode)
91 82
 
92 83
 (defun esk-prog-mode-hook ()
93 84
   (run-hooks 'prog-mode-hook))

0 notes on commit c71507f

Please sign in to comment.
Something went wrong with that request. Please try again.