[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0d79e69 30/36: Extra measures to prevent premature yas-min
From: |
Noam Postavsky |
Subject: |
[elpa] master 0d79e69 30/36: Extra measures to prevent premature yas-minor-mode |
Date: |
Sat, 11 Jun 2016 19:21:11 +0000 (UTC) |
branch: master
commit 0d79e6988ec371279fc1c23733c7371bd21927ee
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Extra measures to prevent premature yas-minor-mode
The user's hooks may try to enable yas-minor-mode before yasnippet.el
has finished loading. In [1], we catch and ignore the errors arising
from this, but it's better if we can avoid hitting the error in the
first place.
This means we have 3 separate measures to avoid the problem, but since
this bug can leave Emacs unusable due to a failing post-command-hook,
a bit of redundant safety is not a bad thing.
* yasnippet.el (yas-minor-mode): Only turn on if yasnippet is fully
loaded.
(yas--font-lock-keywords): Disable user hooks.
[1]: "Avoid potential problems with user's hooks"
4c6064ce1aff07fe4481b5e2d987c8a7f044c207
---
yasnippet.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 4514f1b..aa28c1e 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -776,7 +776,7 @@ Key bindings:
;; The indicator for the mode line.
" yas"
:group 'yasnippet
- (cond (yas-minor-mode
+ (cond ((and yas-minor-mode (featurep 'yasnippet))
;; Install the direct keymaps in `emulation-mode-map-alists'
;; (we use `add-hook' even though it's not technically a hook,
;; but it works). Then define variables named after modes to
@@ -884,7 +884,9 @@ Honour `yas-dont-activate-functions', which see."
(defvar yas--font-lock-keywords
(append '(("^#.*$" . font-lock-comment-face))
(with-temp-buffer
- (ignore-errors (emacs-lisp-mode))
+ (let ((prog-mode-hook nil)
+ (emacs-lisp-mode-hook nil))
+ (ignore-errors (emacs-lisp-mode)))
(font-lock-set-defaults)
(if (eq t (car-safe font-lock-keywords))
;; They're "compiled", so extract the source.
- [elpa] master e9406f5 26/36: Document $> and fix escaping, (continued)
- [elpa] master e9406f5 26/36: Document $> and fix escaping, Noam Postavsky, 2016/06/11
- [elpa] master 6f97316 27/36: Fix outdated and misformatted docs, Noam Postavsky, 2016/06/11
- [elpa] master bd30a30 04/36: yas-dont-activate is a hook, Noam Postavsky, 2016/06/11
- [elpa] master c1b2cb7 17/36: Improve documentation for new register option, Noam Postavsky, 2016/06/11
- [elpa] master 4c6064c 01/36: Avoid potential problems with user's hooks, Noam Postavsky, 2016/06/11
- [elpa] master 5d44a9f 19/36: Revert "Disable region wrapping for trigger key expansion", Noam Postavsky, 2016/06/11
- [elpa] master beb2ba4 21/36: Fix fields following $0 + region insertion, Noam Postavsky, 2016/06/11
- [elpa] master eeb4b62 14/36: Add new tests for multi-line mirror indentation, Noam Postavsky, 2016/06/11
- [elpa] master 78fe979 22/36: Support htmlize.el in Rakefile doc target, Noam Postavsky, 2016/06/11
- [elpa] master 7f03a23 07/36: Change Emacs installation method for Travis CI, Noam Postavsky, 2016/06/11
- [elpa] master 0d79e69 30/36: Extra measures to prevent premature yas-minor-mode,
Noam Postavsky <=
- [elpa] master 497867c 32/36: Rename yas-backport-obsolete-alias, Noam Postavsky, 2016/06/11
- [elpa] master e23a053 34/36: Avoid bug in insert-file-contents with REPLACE=t, Noam Postavsky, 2016/06/11
- [elpa] master 567ada0 06/36: Decide field clearing based on command's effect, Noam Postavsky, 2016/06/11
- [elpa] master bdfab67 24/36: Make yasnippet less chatty, Noam Postavsky, 2016/06/11
- [elpa] master bbfa1f0 31/36: Add yas-backport-obsolete-alias option, Noam Postavsky, 2016/06/11
- [elpa] master bfe14f1 10/36: Test and fix problem with mirror+autofill, Noam Postavsky, 2016/06/11
- [elpa] master df229b9 23/36: Fix some doc formatting, Noam Postavsky, 2016/06/11
- [elpa] master 1b8f5b7 29/36: Don't use major-mode syntax-propertize-function, Noam Postavsky, 2016/06/11
- [elpa] master 47dbe93 33/36: Fix broken links in README.mdown, Noam Postavsky, 2016/06/11
- [elpa] master dc3e4ca 35/36: Release 0.10.0, Noam Postavsky, 2016/06/11