From: ueno Date: Fri, 19 Jan 2007 06:35:56 +0000 (+0000) Subject: * riece-mcat.el (riece-mcat-update): Create a mcat-file if it does X-Git-Tag: riece-3_1_2~36 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f102033747fc016c4a8929607a818f84e943d79e;p=elisp%2Friece.git * riece-mcat.el (riece-mcat-update): Create a mcat-file if it does not exist. --- diff --git a/lisp/riece-mcat.el b/lisp/riece-mcat.el index 59ddd64..87f9973 100644 --- a/lisp/riece-mcat.el +++ b/lisp/riece-mcat.el @@ -49,13 +49,16 @@ (save-excursion (set-buffer (find-file-noselect mcat-file)) (goto-char (point-min)) - (re-search-forward (concat "^\\s-*(\\(defvar\\|defconst\\)\\s-+" - (regexp-quote (symbol-name mcat-alist)))) - (goto-char (match-beginning 0)) - (save-excursion - (eval (read (current-buffer)))) + (if (re-search-forward (concat "^\\s-*(\\(defvar\\|defconst\\)\\s-+" + (regexp-quote (symbol-name mcat-alist))) + nil t) + (progn + (goto-char (match-beginning 0)) + (save-excursion + (eval (read (current-buffer)))) + (delete-region (point) (progn (forward-sexp) (point)))) + (set mcat-alist nil)) (setq alist (riece-mcat-extract files (symbol-value mcat-alist))) - (delete-region (point) (progn (forward-sexp) (point))) (insert "(defconst " (symbol-name mcat-alist) "\n '(") (while alist (insert "(" (prin1-to-string (car (car alist))) " . "