skelrc: Add a debugging utility.
[skel] / skel.el.in
index 86ce7eb..b56afe0 100644 (file)
@@ -1,7 +1,5 @@
 ;;; -*-emacs-lisp-*-
 ;;;
-;;; $Id: skel.el.in,v 1.5 2004/04/08 01:36:28 mdw Exp $
-;;;
 ;;; Filling in skeletons
 ;;;
 ;;; (c) 1998 Mark Wooding
 ;;; it under the terms of the GNU General Public License as published by
 ;;; the Free Software Foundation; either version 2 of the License, or
 ;;; (at your option) any later version.
-;;; 
+;;;
 ;;; This program is distributed in the hope that it will be useful,
 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;;; GNU General Public License for more details.
-;;; 
+;;;
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with this program; if not, write to the Free Software Foundation,
 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -82,7 +80,9 @@
       (let ((n (car l)))
        (if (and (file-readable-p n) (file-regular-p n))
            (if all
-               (skel-do-find (cdr l) all (cons (abbreviate-file-name n) acc))
+               (skel-do-find (cdr l)
+                             all
+                             (cons (abbreviate-file-name n) acc))
              (abbreviate-file-name n))
          (skel-do-find (cdr l) all acc)))
     acc))
   (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))))
 
 
     (funcall switch (find-file-noselect name))
     (kill-region (point-min) (point-max))
-    (insert-file skel)
+    (insert-file-contents skel)
 
     ;; --- Mangle the skeleton data in the file ---
 
   "Like skel-create-file, but in another window."
   (interactive "FSkeleton create file in other window: \nP")
   (skel-do-create-file name 'switch-to-buffer-other-window skel))
-  
+
 (defun skel-create-file-other-frame (name &optional skel)
   "Like skel-create-file, but in another frame."
   (interactive "FSkeleton create file in other frame: \nP")