summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/yasnippet.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/yasnippet.el')
-rw-r--r--.emacs.d/lisp/yasnippet.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index 69b880a..1f92adc 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -237,7 +237,7 @@ nil.
237- To signal that the user quit the prompting process, you can 237- To signal that the user quit the prompting process, you can
238signal `quit' with 238signal `quit' with
239 239
240 (signal \\='quit \"user quit!\")." 240 (signal \\='quit \"user quit!\")"
241 :type '(repeat function)) 241 :type '(repeat function))
242 242
243(defcustom yas-indent-line 'auto 243(defcustom yas-indent-line 'auto
@@ -984,11 +984,8 @@ Honour `yas-dont-activate-functions', which see."
984Meaning it's visiting a file under one of the mode directories in 984Meaning it's visiting a file under one of the mode directories in
985`yas-snippet-dirs'." 985`yas-snippet-dirs'."
986 (when buffer-file-name 986 (when buffer-file-name
987 (member 987 (cl-member buffer-file-name (yas-snippet-dirs)
988 (expand-file-name 988 :test #'file-in-directory-p)))
989 ".."
990 (file-name-directory buffer-file-name))
991 (yas-snippet-dirs))))
992 989
993;; We're abusing `magic-fallback-mode-alist' here because 990;; We're abusing `magic-fallback-mode-alist' here because
994;; `auto-mode-alist' doesn't support function matchers. 991;; `auto-mode-alist' doesn't support function matchers.
@@ -2949,7 +2946,8 @@ Otherwise signal `yas-exception'."
2949(defun yas-field-value (number) 2946(defun yas-field-value (number)
2950 "Get the string for field with NUMBER. 2947 "Get the string for field with NUMBER.
2951 2948
2952Use this in primary and mirror transformations to tget." 2949Use this in primary and mirror transformations to get the text of
2950other fields."
2953 (let* ((snippet (car (yas-active-snippets))) 2951 (let* ((snippet (car (yas-active-snippets)))
2954 (field (and snippet 2952 (field (and snippet
2955 (yas--snippet-find-field snippet number)))) 2953 (yas--snippet-find-field snippet number))))
@@ -4305,9 +4303,13 @@ The SNIPPET's markers are preserved."
4305 ;; Now do stuff for `fixed' and `auto'. 4303 ;; Now do stuff for `fixed' and `auto'.
4306 (save-excursion 4304 (save-excursion
4307 (cond ((eq yas-indent-line 'fixed) 4305 (cond ((eq yas-indent-line 'fixed)
4308 (while (and (zerop (forward-line)) 4306 (forward-line 1)
4309 (zerop (current-column))) 4307 (let ((indent-line-function
4310 (indent-to-column yas--indent-original-column))) 4308 (lambda ()
4309 (indent-to-column yas--indent-original-column))))
4310 (yas--indent-region (line-beginning-position)
4311 (point-max)
4312 snippet)))
4311 ((eq yas-indent-line 'auto) 4313 ((eq yas-indent-line 'auto)
4312 (unless yas-also-auto-indent-first-line 4314 (unless yas-also-auto-indent-first-line
4313 (forward-line 1)) 4315 (forward-line 1))