From: yamaoka Date: Wed, 24 Feb 1999 08:57:20 +0000 (+0000) Subject: * (dgnushack-add-info-suffix-maybe): New function. It will be used for adding X-Git-Tag: semi-gnus-6_10_10~15 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=08f54a2383c15d58a50a83edfb13132f376775a1;p=elisp%2Fgnus.git- * (dgnushack-add-info-suffix-maybe): New function. It will be used for adding ".info" suffix to @setfilename line in each .texi files. (dgnushack-texi-file-regexp): New constant. (dgnushack-info-file-regexp): Add ".info" suffix. --- diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 11a7fa9..7057e62 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -97,7 +97,10 @@ Modify to suit your needs.")) (defvar package-path) (defconst dgnushack-info-file-regexp - "^\\(gnus\\|message\\|gnus-ja\\|message-ja\\)\\(-[0-9]+\\)?$") + "^\\(gnus\\|message\\|gnus-ja\\|message-ja\\)\\.info\\(-[0-9]+\\)?$") + +(defconst dgnushack-texi-file-regexp + "^\\(gnus\\|message\\|gnus-ja\\|message-ja\\)\\.texi$") (defun dgnushack-make-package () (require 'gnus) @@ -190,4 +193,20 @@ Modify to suit your needs.")) (message "Done"))) +(defun dgnushack-add-info-suffix-maybe () + ;; This function must be invoked from texi directory. + (let ((coding-system-for-read 'raw-text) + (coding-system-for-write 'raw-text) + (files (directory-files "." nil dgnushack-texi-file-regexp)) + file make-backup-files) + (while (setq file (pop files)) + (find-file file) + (when (and (re-search-forward + "^@setfilename[\t ]+\\([^\t\n ]+\\)" nil t) + (not (string-match "\\.info$" (match-string 1)))) + (copy-file file (concat file "_") nil t) + (insert ".info") + (save-buffer)) + (kill-buffer (current-buffer))))) + ;;; dgnushack.el ends here