Merge pull request #352 from stepnem/fix-hook-functions
Don't add anonymous functions to hooks, use named functions instead
This commit is contained in:
commit
43624cad75
3 changed files with 10 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
|||
(require 'yasnippet)
|
||||
|
||||
(add-hook 'bibtex-mode-hook
|
||||
'(lambda () (set (make-local-variable 'yas-indent-line) nil)))
|
||||
(add-hook 'bibtex-mode-hook #'yasnippet-snippets--no-indent)
|
||||
|
|
|
@ -35,5 +35,4 @@
|
|||
"\n"))))
|
||||
|
||||
|
||||
(add-hook 'python-mode-hook
|
||||
'(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))
|
||||
(add-hook 'python-mode-hook #'yasnippet-snippets--fixed-indent)
|
||||
|
|
|
@ -58,6 +58,14 @@ customizable variable used for a snippet expansion.
|
|||
See Info node `(elisp)Customization Types'."
|
||||
:group 'yasnippet)
|
||||
|
||||
(defun yasnippet-snippets--fixed-indent ()
|
||||
"Set `yas-indent-line' to `fixed'."
|
||||
(set (make-local-variable 'yas-indent-line) 'fixed))
|
||||
|
||||
(defun yasnippet-snippets--no-indent ()
|
||||
"Set `yas-indent-line' to nil."
|
||||
(set (make-local-variable 'yas-indent-line) nil))
|
||||
|
||||
;;;###autoload
|
||||
(eval-after-load 'yasnippet
|
||||
'(yasnippet-snippets-initialize))
|
||||
|
|
Loading…
Reference in a new issue