summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2021-11-18 19:47:41 +0100
committerJonas Bernoulli <jonas@bernoul.li>2021-11-18 19:47:41 +0100
commit22278a95474ccd665f84c16aa8760534ced9b150 (patch)
treeb75650e3f8b8bfb4ec9b35214e5cd8499b4a22b3
parent38aebc2781b75ee96a54d1d361807b1c23c6768e (diff)
Save match-datav0.2.0
This is necessary when `##' is evaluated uncompiled.
-rw-r--r--llama.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/llama.el b/llama.el
index cc4cfa2..e02aa8d 100644
--- a/llama.el
+++ b/llama.el
@@ -135,16 +135,17 @@ above is *displayed* as:
(cond
((symbolp data)
(let ((name (symbol-name data)) pos)
- (when (string-match "\\`%\\([1-9*]\\)?\\'" name)
- (setq pos (match-string 1 name))
- (setq pos (cond ((equal pos "*") 0)
- ((not pos) 1)
- (t (string-to-number pos))))
- (when (and (= pos 1)
- (aref args 1)
- (not (equal data (aref args 1))))
- (error "%% and %%1 are mutually exclusive"))
- (aset args pos data))))
+ (save-match-data
+ (when (string-match "\\`%\\([1-9*]\\)?\\'" name)
+ (setq pos (match-string 1 name))
+ (setq pos (cond ((equal pos "*") 0)
+ ((not pos) 1)
+ (t (string-to-number pos))))
+ (when (and (= pos 1)
+ (aref args 1)
+ (not (equal data (aref args 1))))
+ (error "%% and %%1 are mutually exclusive"))
+ (aset args pos data)))))
((and (not (eq (car-safe data) '##))
(or (listp data)
(vectorp data)))