skel-do-fill-in: Save match data properly.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 24 Apr 2006 22:51:05 +0000 (23:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 24 Apr 2006 22:51:05 +0000 (23:51 +0100)
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.

skel.el.in

index 86ce7eb..0ce3831 100644 (file)
   (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))
    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))))