X-Git-Url: https://git.distorted.org.uk/~mdw/skel/blobdiff_plain/89b7a3ae81e08415c68518d54c5d3c6ac25b9b66..da3134ee428238075d12295d6f184694e9cca36c:/skel.el.in diff --git a/skel.el.in b/skel.el.in index 86ce7eb..b56afe0 100644 --- a/skel.el.in +++ b/skel.el.in @@ -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 @@ -13,12 +11,12 @@ ;;; 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)) @@ -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)))) @@ -196,7 +198,7 @@ (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 --- @@ -236,7 +238,7 @@ "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")