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
|
@ -1,4 +1,3 @@
|
||||||
(require 'yasnippet)
|
(require 'yasnippet)
|
||||||
|
|
||||||
(add-hook 'bibtex-mode-hook
|
(add-hook 'bibtex-mode-hook #'yasnippet-snippets--no-indent)
|
||||||
'(lambda () (set (make-local-variable 'yas-indent-line) nil)))
|
|
||||||
|
|
|
@ -35,5 +35,4 @@
|
||||||
"\n"))))
|
"\n"))))
|
||||||
|
|
||||||
|
|
||||||
(add-hook 'python-mode-hook
|
(add-hook 'python-mode-hook #'yasnippet-snippets--fixed-indent)
|
||||||
'(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))
|
|
||||||
|
|
|
@ -58,6 +58,14 @@ customizable variable used for a snippet expansion.
|
||||||
See Info node `(elisp)Customization Types'."
|
See Info node `(elisp)Customization Types'."
|
||||||
:group 'yasnippet)
|
: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
|
;;;###autoload
|
||||||
(eval-after-load 'yasnippet
|
(eval-after-load 'yasnippet
|
||||||
'(yasnippet-snippets-initialize))
|
'(yasnippet-snippets-initialize))
|
||||||
|
|
Loading…
Reference in a new issue