[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 35a4df7 03/51: Let whitespace-global-mode work in new snip
From: |
Noam Postavsky |
Subject: |
[elpa] master 35a4df7 03/51: Let whitespace-global-mode work in new snippet buffers |
Date: |
Sun, 13 May 2018 13:11:39 -0400 (EDT) |
branch: master
commit 35a4df769cbdebd10d043f16d680bdb16ee858ed
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Let whitespace-global-mode work in new snippet buffers
* yasnippet.el (yas-new-snippet-buffer-name): New constant, holds the
name of new snippet buffers. Change it to "+new-snippet+" to avoid
the leading "*" from fooling whitespace-global-mode into thinking it
shouldn't activate.
(yas-new-snippet):
* yasnippet-tests.el (snippet-save): Use the constant instead of
hardcoding the literal string.
---
yasnippet-tests.el | 4 ++--
yasnippet.el | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index f9195db..bc3bef0 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -1019,13 +1019,13 @@ hello ${1:$(when (stringp yas-text) (funcall func
yas-text))} foo${1:$$(concat \
(yas-minor-mode +1)
(save-current-buffer
(yas-new-snippet t)
- (with-current-buffer "*new snippet*"
+ (with-current-buffer yas-new-snippet-buffer-name
(snippet-mode)
(insert "# name: foo\n# key: bar\n# --\nsnippet foo")
(call-interactively 'yas-load-snippet-buffer-and-close)))
(save-current-buffer
(yas-new-snippet t)
- (with-current-buffer "*new snippet*"
+ (with-current-buffer yas-new-snippet-buffer-name
(snippet-mode)
(insert "# name: bar\n# key: bar\n# --\nsnippet bar")
(call-interactively 'yas-load-snippet-buffer-and-close)))
diff --git a/yasnippet.el b/yasnippet.el
index 6660f57..b3c5c90 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -2528,6 +2528,10 @@ where snippets of table might exist."
;; create the .yas-parents file here...
candidate)))))
+;; NOTE: Using the traditional "*new snippet*" stops whitespace mode
+;; from activating (it doesn't like the leading "*").
+(defconst yas-new-snippet-buffer-name "+new-snippet+")
+
(defun yas-new-snippet (&optional no-template)
"Pops a new buffer for writing a snippet.
@@ -2540,7 +2544,7 @@ NO-TEMPLATE is non-nil."
(buffer-substring-no-properties
(region-beginning) (region-end))))))
- (switch-to-buffer "*new snippet*")
+ (switch-to-buffer yas-new-snippet-buffer-name)
(erase-buffer)
(kill-all-local-variables)
(snippet-mode)
- [elpa] master updated (04889dc -> e64297e), Noam Postavsky, 2018/05/13
- [elpa] master ba4e5c1 01/51: * yasnippet-debug.el (yas-debug-snippet): Handle non-numbered fields., Noam Postavsky, 2018/05/13
- [elpa] master 1fc3426 02/51: Add test relying on overlay hook inhibition in `yas-expand-snippet', Noam Postavsky, 2018/05/13
- [elpa] master ece7935 07/51: * yasnippet.el (yas--message): Fix invalid docstring reference., Noam Postavsky, 2018/05/13
- [elpa] master 4ab9cb5 04/51: Set test to fail with newer org version, Noam Postavsky, 2018/05/13
- [elpa] master 0b8d434 05/51: Unset autoload-compute-prefixes for utility files, Noam Postavsky, 2018/05/13
- [elpa] master acec3ba 06/51: * doc/faq.org: Fix typo., Noam Postavsky, 2018/05/13
- [elpa] master ee81da9 11/51: Allow "# --" end-of-header marker to have trailing space, Noam Postavsky, 2018/05/13
- [elpa] master b1ca219 12/51: Remove submodules (snippet and yasmate), Noam Postavsky, 2018/05/13
- [elpa] master 35a4df7 03/51: Let whitespace-global-mode work in new snippet buffers,
Noam Postavsky <=
- [elpa] master d806b04 15/51: * yasnippet.el (snippet-mode): Derive from prog-mode., Noam Postavsky, 2018/05/13
- [elpa] master 1292cd2 10/51: Refactor undo tests, Noam Postavsky, 2018/05/13
- [elpa] master 203059a 17/51: * yasnippet.el (yas-key-syntaxes): Prefer the longest key., Noam Postavsky, 2018/05/13
- [elpa] master 7ea1305 09/51: Fix undo when first line indentation moves snippet forward, Noam Postavsky, 2018/05/13
- [elpa] master 6ffd1c7 22/51: ; .travis.yml: Test with 25.3 and 26 prelease., Noam Postavsky, 2018/05/13
- [elpa] master 2e69471 24/51: ; yasnippet-debug.el: macroexp-progn is not avaiable in Emacs 23., Noam Postavsky, 2018/05/13
- [elpa] master 3d7cafc 34/51: Make yas-snippet-mode-buffer-p robust against symlinks, Noam Postavsky, 2018/05/13
- [elpa] master ba73f20 27/51: Bind field skip and clear command conditionally, Noam Postavsky, 2018/05/13
- [elpa] master ce11fd6 13/51: * yasnippet.el (yas-reload-all): Mention if no snippets were found., Noam Postavsky, 2018/05/13
- [elpa] master e200a3b 08/51: Let snippet insertion trigger active field clearing., Noam Postavsky, 2018/05/13