Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sophicshift authored Jul 14, 2021
1 parent 5cbdbf0 commit 45fbf72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions yasnippet.el
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ Key bindings:
(remove 'yas--direct-keymaps emulation-mode-map-alists)))))

(defun yas-activate-extra-mode (mode)
"Activates the snippets for the given `mode' in the buffer.
"Activates the snippets for the given `MODE' in the buffer.
The function can be called in the hook of a minor mode to
activate snippets associated with that mode."
Expand All @@ -929,10 +929,13 @@ activate snippets associated with that mode."
(intern symbol)))))
(when mode
(add-to-list (make-local-variable 'yas--extra-modes) mode)
(let ((name (intern (format "yas--direct-%s" mode))))
(set-default name nil)
(set (make-local-variable name) t))
(yas--load-pending-jits)))

(defun yas-deactivate-extra-mode (mode)
"Deactivates the snippets for the given `mode' in the buffer."
"Deactivates the snippets for the given `MODE' in the buffer."
(interactive
(list (intern
(completing-read
Expand Down

0 comments on commit 45fbf72

Please sign in to comment.