Simplify string matching.

* 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)
This commit is contained in:
Noam Postavsky 2015-10-11 21:23:36 -04:00
parent 72c6c4cd7b
commit 35642ac007

View 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