Avoid potential problems with user's hooks

* yasnippet.el (yas--font-lock-keywords): ignore-errors from
emacs-lisp-mode call, in case user's hooks cause problems (e.g. enabling
`yas-minor-mode' before we finish loading).
This commit is contained in:
Noam Postavsky 2016-04-09 19:36:32 -04:00
parent 4af9fc9815
commit 4c6064ce1a

View File

@ -880,7 +880,7 @@ Honour `yas-dont-activate', which see."
(defvar yas--font-lock-keywords (defvar yas--font-lock-keywords
(append '(("^#.*$" . font-lock-comment-face)) (append '(("^#.*$" . font-lock-comment-face))
(with-temp-buffer (with-temp-buffer
(emacs-lisp-mode) (ignore-errors (emacs-lisp-mode))
(font-lock-set-defaults) (font-lock-set-defaults)
(if (eq t (car-safe font-lock-keywords)) (if (eq t (car-safe font-lock-keywords))
;; They're "compiled", so extract the source. ;; They're "compiled", so extract the source.