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

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

[elpa] 238/255: wrap go-re-cond in save-match-data


From: Eric Schulte
Subject: [elpa] 238/255: wrap go-re-cond in save-match-data
Date: Sun, 16 Mar 2014 01:02:55 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit 750dae6d764841c5963054bc5803bad236137434
Author: Eric Schulte <address@hidden>
Date:   Fri Aug 9 00:46:37 2013 -0600

    wrap go-re-cond in save-match-data
---
 go-util.el |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/go-util.el b/go-util.el
index 7247d05..ccb2252 100644
--- a/go-util.el
+++ b/go-util.el
@@ -142,13 +142,14 @@
 
 (defmacro go-re-cond (string &rest body)
   (declare (indent 1))
-  `(cond ,@(mapcar
-            (lambda (part)
-              (cons (if (or (keywordp (car part)) (eq t (car part)))
-                        (car part)
-                      `(string-match ,(car part) ,string))
-                    (cdr part)))
-            body)))
+  `(save-match-data
+     (cond ,@(mapcar
+              (lambda (part)
+                (cons (if (or (keywordp (car part)) (eq t (car part)))
+                          (car part)
+                        `(string-match ,(car part) ,string))
+                      (cdr part)))
+              body))))
 (def-edebug-spec go-re-cond (form body))
 
 (defvar *go-partial-line* nil "Holds partial lines of input from a process.")



reply via email to

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