mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Closes #335: YAS-DONT-ACTIVATE is only buffer-local in pre-24 emacsen
This commit is contained in:
parent
327fa4b86e
commit
1bc497ecbe
21
yasnippet.el
21
yasnippet.el
@ -743,17 +743,26 @@ Key bindings:
|
|||||||
(remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps))))
|
(remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps))))
|
||||||
|
|
||||||
(defvar yas-dont-activate '(minibufferp)
|
(defvar yas-dont-activate '(minibufferp)
|
||||||
"If non-nil don't let `yas-minor-mode-on' activate for this buffer.
|
"If non-nil don't let `yas-global-mode' affect some buffers.
|
||||||
|
|
||||||
If a function, then its result is used.
|
If a function of zero arguments, then its result is used.
|
||||||
|
|
||||||
If a list of functions, then all functions must return nil to
|
If a list of functions, then all functions must return nil to
|
||||||
activate yas for this buffer.
|
activate yas for this buffer.
|
||||||
|
|
||||||
`yas-minor-mode-on' is usually called by `yas-global-mode' so
|
In Emacsen <= 23, this variable is buffer-local. Because
|
||||||
this effectively lets you define exceptions to the \"global\"
|
`yas-minor-mode-on' is called by `yas-global-mode' after
|
||||||
behaviour. Can also be a function of zero arguments.")
|
executing the buffer's major mode hook, setting this variable
|
||||||
(make-variable-buffer-local 'yas-dont-activate)
|
there is an effective way to define exceptions to the \"global\"
|
||||||
|
activation behaviour.
|
||||||
|
|
||||||
|
In Emacsen > 23, only the global value is used. To define
|
||||||
|
per-mode exceptions to the \"global\" activation behaviour, call
|
||||||
|
`yas-minor-mode' with a negative argument directily in the major
|
||||||
|
mode's hook.")
|
||||||
|
(unless (> emacs-major-version 23)
|
||||||
|
(make-variable-buffer-local 'yas-dont-activate))
|
||||||
|
|
||||||
|
|
||||||
(defun yas-minor-mode-on ()
|
(defun yas-minor-mode-on ()
|
||||||
"Turn on YASnippet minor mode.
|
"Turn on YASnippet minor mode.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user