From f102033747fc016c4a8929607a818f84e943d79e Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 19 Jan 2007 06:35:56 +0000 Subject: [PATCH] * riece-mcat.el (riece-mcat-update): Create a mcat-file if it does not exist. --- lisp/riece-mcat.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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))) " . " -- 1.7.10.4