emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 35642ac 33/60: Simplify string matching.


From: João Távora
Subject: [elpa] master 35642ac 33/60: Simplify string matching.
Date: Thu, 21 Jan 2016 22:35:59 +0000

branch: master
commit 35642ac007a63aa7bc6c50fc6fc5688bfb3b057b
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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)
---
 yasnippet.el |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index 50973e9..77702eb 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]