From ddd2d044acc5d4db08f2aa18e4535f7d6dccfa8f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 12 Aug 2021 22:02:17 -0700 Subject: [PATCH] [oni-core] Only enable yas-global-mode if everything is installed --- oni-core.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/oni-core.el b/oni-core.el index fab0390..69d90fe 100644 --- a/oni-core.el +++ b/oni-core.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2021.0807.195258 +;; Version: 2021.0807.195510 ;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key insert-char-preview dashboard) ;; This program is free software; you can redistribute it and/or modify @@ -271,7 +271,12 @@ _s_: String list" (with-eval-after-load 'sh (require 'oni-sh)) (with-eval-after-load 'smartparens (require 'oni-smartparens)) (with-eval-after-load 'vterm (require 'oni-vterm)) -(with-eval-after-load 'yasnippet (require 'oni-yasnippet)) + +(with-eval-after-load 'yasnippet + (require 'oni-yasnippet) + (when (and (package-installed-p 'oni-yasnippet) + (not yas-global-mode)) + (yas-global-mode))) ;; Enable any modes that I want to have turned on right away. @@ -282,8 +287,6 @@ _s_: String list" (ws-butler-global-mode) (which-key-mode) (auto-insert-mode) -(when (package-installed-p 'oni-yasnippet) - (yas-global-mode)) (provide 'oni-core) ;;; oni-core.el ends here