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, 15 insertions, 7 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index 9951940..3bbb94d 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -1,6 +1,6 @@
1;;; yasnippet.el --- Yet another snippet extension for Emacs. 1;;; yasnippet.el --- Yet another snippet extension for Emacs
2 2
3;; Copyright (C) 2008-2018 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
4;; Authors: pluskid <pluskid@gmail.com>, 4;; Authors: pluskid <pluskid@gmail.com>,
5;; João Távora <joaotavora@gmail.com>, 5;; João Távora <joaotavora@gmail.com>,
6;; Noam Postavsky <npostavs@gmail.com> 6;; Noam Postavsky <npostavs@gmail.com>
@@ -381,8 +381,7 @@ the trigger key itself."
381(defcustom yas-alias-to-yas/prefix-p t 381(defcustom yas-alias-to-yas/prefix-p t
382 "If non-nil make aliases for the old style yas/ prefixed symbols. 382 "If non-nil make aliases for the old style yas/ prefixed symbols.
383It must be set to nil before loading yasnippet to take effect." 383It must be set to nil before loading yasnippet to take effect."
384 :type 'boolean 384 :type 'boolean)
385 :group 'yasnippet)
386 385
387;; Only two faces, and one of them shouldn't even be used... 386;; Only two faces, and one of them shouldn't even be used...
388;; 387;;
@@ -790,12 +789,12 @@ expanded.")
790 ["About" yas-about 789 ["About" yas-about
791 :help "Display some information about YASnippet"])) 790 :help "Display some information about YASnippet"]))
792 791
792(define-obsolete-variable-alias 'yas-extra-modes 'yas--extra-modes "0.9.1")
793(defvar yas--extra-modes nil 793(defvar yas--extra-modes nil
794 "An internal list of modes for which to also lookup snippets. 794 "An internal list of modes for which to also lookup snippets.
795 795
796This variable probably makes more sense as buffer-local, so 796This variable probably makes more sense as buffer-local, so
797ensure your use `make-local-variable' when you set it.") 797ensure your use `make-local-variable' when you set it.")
798(define-obsolete-variable-alias 'yas-extra-modes 'yas--extra-modes "0.9.1")
799 798
800(defvar yas--tables (make-hash-table) 799(defvar yas--tables (make-hash-table)
801 "A hash table of mode symbols to `yas--table' objects.") 800 "A hash table of mode symbols to `yas--table' objects.")
@@ -3039,8 +3038,13 @@ snippet field. The arguments are the same as `completing-read'.
3039 3038
3040(defun yas--auto-next () 3039(defun yas--auto-next ()
3041 "Helper for `yas-auto-next'." 3040 "Helper for `yas-auto-next'."
3042 (remove-hook 'post-command-hook #'yas--auto-next t) 3041 (cl-loop
3043 (yas-next-field)) 3042 do (progn (remove-hook 'post-command-hook #'yas--auto-next t)
3043 (yas-next-field))
3044 ;; The transform in the next field may have requested auto-next as
3045 ;; well. Call it ourselves, since the command loop itself won't
3046 ;; recheck the value of post-command-hook while running it.
3047 while (memq #'yas--auto-next post-command-hook)))
3044 3048
3045(defmacro yas-auto-next (&rest body) 3049(defmacro yas-auto-next (&rest body)
3046 "Automatically advance to next field after eval'ing BODY." 3050 "Automatically advance to next field after eval'ing BODY."
@@ -4149,6 +4153,7 @@ After revival, push the `yas--take-care-of-redo' in the
4149 (when (yas--maybe-move-to-active-field snippet) 4153 (when (yas--maybe-move-to-active-field snippet)
4150 (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end)) 4154 (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end))
4151 (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet) 4155 (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet)
4156 (push snippet yas--active-snippets)
4152 (when (listp buffer-undo-list) 4157 (when (listp buffer-undo-list)
4153 (push `(apply yas--take-care-of-redo ,snippet) 4158 (push `(apply yas--take-care-of-redo ,snippet)
4154 buffer-undo-list)))) 4159 buffer-undo-list))))
@@ -4683,7 +4688,10 @@ SAVED-QUOTES is the in format returned by `yas--save-backquotes'."
4683(defun yas--scan-sexps (from count) 4688(defun yas--scan-sexps (from count)
4684 (ignore-errors 4689 (ignore-errors
4685 (save-match-data ; `scan-sexps' may modify match data. 4690 (save-match-data ; `scan-sexps' may modify match data.
4691 ;; Parse using the syntax table corresponding to the yasnippet syntax.
4686 (with-syntax-table (standard-syntax-table) 4692 (with-syntax-table (standard-syntax-table)
4693 ;; And ignore syntax-table properties that may have been placed by the
4694 ;; major mode since these aren't related to the yasnippet syntax.
4687 (let ((parse-sexp-lookup-properties nil)) 4695 (let ((parse-sexp-lookup-properties nil))
4688 (scan-sexps from count)))))) 4696 (scan-sexps from count))))))
4689 4697