]> code.delx.au - gnu-emacs-elpa/commitdiff
* packages/yasnippet: Fix some compilation warnings
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 22 Jun 2016 12:53:13 +0000 (08:53 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 22 Jun 2016 12:53:13 +0000 (08:53 -0400)
* packages/yasnippet/yasnippet-tests.el (complicated-yas-key-syntaxes):
Avoid looking-back.

* packages/yasnippet/yasnippet.el (yas--font-lock-keywords): Escape $, even if
first in the regexp.
(yas--indent): Remove unused var `end'.
(yas--indent-parse-create): Remove unused arg `snippet'.  Update caller.

packages/yasnippet/yasnippet-tests.el
packages/yasnippet/yasnippet.el

index 9d2074aa4f0b6a102e55adf9de9eebf126a5f09d..47b6e1f1a93be3e6f7e448f5054eb19b87d5ecb6 100644 (file)
@@ -484,7 +484,7 @@ TODO: correct this bug!"
            (yas-should-expand '(("foo-barbaz" . "OKfoo-barbazOK"))))
          (let ((yas-key-syntaxes
                 (cons #'(lambda (_start-point)
-                          (unless (looking-back "-")
+                          (unless (eq ?- (char-before))
                             (backward-char)
                             'again))
                       yas-key-syntaxes))
index 8a4ef1d22ff42c9c90400d0e085b55d0fd12a1b4..ed52907d24a0d822b93c4990a95137e88d2cf535 100644 (file)
@@ -896,10 +896,10 @@ Honour `yas-dont-activate-functions', which see."
                 ;; They're "compiled", so extract the source.
                 (cadr font-lock-keywords)
               font-lock-keywords))
-          '(("$\\([0-9]+\\)"
+          '(("\\$\\([0-9]+\\)"
              (0 font-lock-keyword-face)
              (1 font-lock-string-face t))
-            ("${\\([0-9]+\\):?"
+            ("\\${\\([0-9]+\\):?"
              (0 font-lock-keyword-face)
              (1 font-lock-warning-face t))
             ("\\(\\$(\\)" 1 font-lock-preprocessor-face)
@@ -3860,7 +3860,7 @@ Meant to be called in a narrowed buffer, does various passes"
     (yas--protect-escapes)
     ;; Parse indent markers: `$>'.
     (goto-char parse-start)
-    (yas--indent-parse-create snippet)
+    (yas--indent-parse-create)
     ;; parse fields with {}
     ;;
     (goto-char parse-start)
@@ -3966,12 +3966,11 @@ The SNIPPET's markers are preserved."
                        (zerop (current-column)))
              (indent-to-column yas--indent-original-column)))
           ((eq yas-indent-line 'auto)
-           (let ((end (set-marker (make-marker) (point-max))))
-             (unless yas-also-auto-indent-first-line
-               (forward-line 1))
-             (yas--indent-region (line-beginning-position)
-                                 (point-max)
-                                 snippet))))))
+           (unless yas-also-auto-indent-first-line
+             (forward-line 1))
+           (yas--indent-region (line-beginning-position)
+                               (point-max)
+                               snippet)))))
 
 (defun yas--collect-snippet-markers (snippet)
   "Make a list of all the markers used by SNIPPET."
@@ -4064,8 +4063,8 @@ with their evaluated value into `yas--backquote-markers-and-strings'."
     (set-marker-insertion-type marker nil)
     marker))
 
-(defun yas--indent-parse-create (snippet)
-  "Parse the \"$>\" indentation markers in SNIPPET."
+(defun yas--indent-parse-create ()
+  "Parse the \"$>\" indentation markers just inserted."
   (setq yas--indent-markers ())
   (while (search-forward "$>" nil t)
     (delete-region (match-beginning 0) (match-end 0))
@@ -4523,7 +4522,7 @@ and return the directory.  Return nil if not found."
                              yas-after-exit-snippet-hook
                              yas-before-expand-snippet-hook
                              yas-buffer-local-condition
-                             yas-dont-activate
+                             yas-dont-activate-functions
 
                              ;; prompting functions
                              ;;