branch: elpa/llama commit 22278a95474ccd665f84c16aa8760534ced9b150 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Save match-data This is necessary when `##' is evaluated uncompiled. --- llama.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/llama.el b/llama.el index cc4cfa2366..e02aa8d1a5 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)))