From: Mark Wooding Date: Mon, 24 Apr 2006 22:51:05 +0000 (+0100) Subject: skel-do-fill-in: Save match data properly. X-Git-Tag: 1.2.0~7 X-Git-Url: https://git.distorted.org.uk/~mdw/skel/commitdiff_plain/0c9e120c4516671e9f61bd32e4ce8adbcbae0db0 skel-do-fill-in: Save match data properly. Finally, the random insertion bug is nailed to the wall. I think. The problem was that skel-lookup wasn't saving match-data in the right place. In fact, it's not its job at all, and skel-do-fill-in ought to do it, dammit. --- diff --git a/skel.el.in b/skel.el.in index 86ce7eb..0ce3831 100644 --- a/skel.el.in +++ b/skel.el.in @@ -138,7 +138,7 @@ (let ((pair (assq name skel-alist)) value) (if pair - (save-match-data (setq value (eval (cdr pair)))) + (setq value (eval (cdr pair))) (setq value (read-string (format "Value for %s: " name))) (setq skel-alist (cons (cons name value) skel-alist))) value)) @@ -151,7 +151,9 @@ buffer at this point." (if (re-search-forward "\\[\\[\\([^]]*\\)\\]\\]" nil t) (progn - (replace-match (skel-lookup (match-string 1)) t t nil) + (replace-match (save-match-data + (skel-lookup (match-string 1))) + t t nil) (goto-char (match-beginning 0)) (skel-do-fill-in))))