From: bg66 Date: Tue, 3 Jun 2003 04:05:23 +0000 (+0000) Subject: * lisp/initz-list.el (initz-list-previous-line): Add optional X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5392b1bd87168670e3c08415c9e2e7db501de11d;p=elisp%2Finitz.git * lisp/initz-list.el (initz-list-previous-line): Add optional argument `arg'. * lisp/initz-list.el (initz-list-new-file-header-message-format): Rename from 'initz-list-new-file-comment-message-format'. (initz-list-new-file-footer-message-format): Change value and rename from 'initz-list-new-file-provide-message-format'. (initz-list-new-file): Follow change above. --- diff --git a/ChangeLog b/ChangeLog index 8bdeefd..570372c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-06-03 OHASHI Akira + + * lisp/initz-list.el (initz-list-previous-line): Add optional + argument `arg'. + + * lisp/initz-list.el (initz-list-new-file-header-message-format): + Rename from 'initz-list-new-file-comment-message-format'. + (initz-list-new-file-footer-message-format): Change value and rename + from 'initz-list-new-file-provide-message-format'. + (initz-list-new-file): Follow change above. + 2003-05-18 OHASHI Akira * lisp/initz.el (initz-message): Protect 1st arg of `message'. diff --git a/lisp/initz-list.el b/lisp/initz-list.el index aa4b2c3..93d6e3f 100644 --- a/lisp/initz-list.el +++ b/lisp/initz-list.el @@ -104,11 +104,11 @@ (defconst initz-list-new-file-provided-message "Module is already provided.") -(defconst initz-list-new-file-comment-message-format +(defconst initz-list-new-file-header-message-format ";;; %s --- init file for %s.\n\n\n\n") -(defconst initz-list-new-file-provide-message-format - "(provide '%s)\n") +(defconst initz-list-new-file-footer-message-format + "(provide '%s)\n\n;;; %s ends here\n") (defconst initz-list-click-message-format "Click %s on the module name to select it.\n") @@ -148,10 +148,10 @@ (defun initz-list-input-dir (&optional default) "Input the dir." - (let* ((completing-list (mapcar #'(lambda (list) - (symbol-name (car list))) - initz-init-alist)) - (default (if (stringp default) default "misc"))) + (let ((completing-list (mapcar #'(lambda (list) + (symbol-name (car list))) + initz-init-alist)) + (default (if (stringp default) default "misc"))) (completing-read (format initz-list-input-dir-message-format initz-directory default) @@ -308,9 +308,11 @@ (when (integer-or-marker-p start) (goto-char start)))) -(defun initz-list-previous-line () +(defun initz-list-previous-line (&optional arg) (interactive) - (initz-list-next-line -1)) + (if (integerp arg) + (initz-list-next-line (- 0 arg)) + (initz-list-next-line -1))) (defun initz-list-print-file () "Print the file name under point." @@ -371,11 +373,11 @@ (defun initz-list-load-file () "Load the file under point." (interactive) - (let* ((file (get-text-property (point) :file))) - (when (and (initz-list-byte-compile-file) - (initz-load-file (initz-get-correspondence-file file))) - (setq initz-load-error-files - (delete file initz-load-error-files))))) + (let ((file (get-text-property (point) :file))) + (when (and (initz-list-byte-compile-file) + (initz-load-file (initz-get-correspondence-file file))) + (setq initz-load-error-files + (delete file initz-load-error-files))))) ;;;###autoload (defun initz-list-new-file () @@ -388,13 +390,13 @@ (string-match (concat "^" initz-module-regexp "$") module))) (message initz-list-new-file-illegal-message) (setq module (initz-trim-separator module)) - (let* ((startup-file (expand-file-name - (concat initz-prefix - (if (string= module initz-null-string) - initz-null-string - initz-separator-string) - module ".el") - (initz-startup-directory (intern dir))))) + (let ((startup-file (expand-file-name + (concat initz-prefix + (if (string= module initz-null-string) + initz-null-string + initz-separator-string) + module ".el") + (initz-startup-directory (intern dir))))) (if (file-exists-p startup-file) (message initz-list-new-file-exists-message) (let ((base-name (initz-get-base-name startup-file))) @@ -402,13 +404,14 @@ (message initz-list-new-file-provided-message) (initz-list-insert-file dir startup-file) (find-file-other-window startup-file) - (insert (format initz-list-new-file-comment-message-format - (file-name-nondirectory startup-file) - (if (string= module initz-null-string) - initz-prefix - module))) - (insert (format initz-list-new-file-provide-message-format - base-name)) + (let ((file-name (file-name-nondirectory startup-file))) + (insert (format initz-list-new-file-header-message-format + file-name + (if (string= module initz-null-string) + initz-prefix + module))) + (insert (format initz-list-new-file-footer-message-format + base-name file-name))) (save-buffer) (goto-char (point-min)) (search-forward "\n\n"))))))))