From 65dc7796edfe93bb1e6bf123c305f75bb1edfe6e Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Sun, 9 Sep 2018 21:41:35 -0500 Subject: [PATCH] Require `yasnippet` automatically when a snippet can be expanded --- jupyter-repl.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jupyter-repl.el b/jupyter-repl.el index 53c3c47..ee523b3 100644 --- a/jupyter-repl.el +++ b/jupyter-repl.el @@ -1842,8 +1842,10 @@ Run FUN when the completions are available." "If ARG is a completion with a snippet, expand the snippet. Do this only if STATUS is sole or finished." (when (and (memq status '(sole finished)) - (get-text-property 0 'snippet arg) - (bound-and-true-p yas-minor-mode)) + (get-text-property 0 'snippet arg)) + (when (and (require 'yasnippet nil t) + (not yas-minor-mode)) + (yas-minor-mode 1)) (yas-expand-snippet (get-text-property 0 'snippet arg) (save-excursion