]> code.delx.au - gnu-emacs-elpa/commitdiff
Simplify string matching.
authorNoam Postavsky <npostavs@users.sourceforge.net>
Mon, 12 Oct 2015 01:23:36 +0000 (21:23 -0400)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Mon, 12 Oct 2015 01:23:36 +0000 (21:23 -0400)
* yasnippet.el (yas--field-parse-create): Use string-match-p to instead
  of save-match-data, anchor regexp with \` (start of string) to instead
  of (eq ... 0)

yasnippet.el

index 50973e9df06b6cb1948c5157e62ee335d6f672ff..77702eb4931b58af75d5cbd1603d85fd3f8a5e2c 100644 (file)
@@ -4049,9 +4049,8 @@ When multiple expressions are found, only the last one counts."
                                    ;; after the ":", this will be
                                    ;; caught as a mirror with
                                    ;; transform later.
-                                   (not (save-match-data
-                                          (eq (string-match "$[ \t\n]*("
-                                                            (match-string-no-properties 2)) 0)))
+                                   (not (string-match-p "\\`\\$[ \t\n]*("
+                                                        (match-string-no-properties 2)))
                                    ;; allow ${0: some exit text}
                                    ;; (not (and number (zerop number)))
                                    (yas--make-field number