(initz-get-init-value): Ditto.
(initz-get-kind): Ditto.
(initz-get-dir): Ditto.
(initz-make-directory): Ditto.
(initz-make-directories): Ditto.
(initz-delete-files): Ditto.
(initz-delete): Ditto.
(initz-compile-files): Ditto.
(initz-compile): Ditto.
(initz-load-files): Ditto.
(initz-load): Ditto.
* lisp/initz-list.el (sort-build-lists): Ditto.
(initz-list-input-dir): Ditto.
(initz-list-input-module): Ditto.
(initz-list-node-expand): Ditto.
(initz-list): Ditto.
* lisp/initz-error.el (initz-error-node-expand): Ditto.
(initz-error): Ditto.
* lisp/initz-util.el (initz-add-to-load-list): Ditto.
(initz-add-to-ignore-list): Ditto.
(initz-remove-from-load-list): Ditto.
(initz-remove-from-ignore-list): Ditto.
(initz-add-to-load-path): Ditto.
(initz-features): Ditto.
2002-04-30 OHASHI Akira <bg66@koka-in.org>
+ * lisp/initz.el (initz-init-alist): Use `#'' instead of `function'.
+ (initz-get-init-value): Ditto.
+ (initz-get-kind): Ditto.
+ (initz-get-dir): Ditto.
+ (initz-make-directory): Ditto.
+ (initz-make-directories): Ditto.
+ (initz-delete-files): Ditto.
+ (initz-delete): Ditto.
+ (initz-compile-files): Ditto.
+ (initz-compile): Ditto.
+ (initz-load-files): Ditto.
+ (initz-load): Ditto.
+ * lisp/initz-list.el (sort-build-lists): Ditto.
+ (initz-list-input-dir): Ditto.
+ (initz-list-input-module): Ditto.
+ (initz-list-node-expand): Ditto.
+ (initz-list): Ditto.
+ * lisp/initz-error.el (initz-error-node-expand): Ditto.
+ (initz-error): Ditto.
+ * lisp/initz-util.el (initz-add-to-load-list): Ditto.
+ (initz-add-to-ignore-list): Ditto.
+ (initz-remove-from-load-list): Ditto.
+ (initz-remove-from-ignore-list): Ditto.
+ (initz-add-to-load-path): Ditto.
+ (initz-features): Ditto.
+
* lisp/initz.el (initz-init-alist): Use `mapconcat' instead of `mapc'.
2002-04-28 OHASHI Akira <bg66@koka-in.org>
(initz-error-node-insert node 'expand)
(let ((sort-start (point)))
(mapc
- (function (lambda (file)
- (let (start)
- (insert-char ?\ 4)
- (setq start (point))
- (insert (initz-get-module-name file) "\n")
- (add-text-properties
- start (1- (point))
- `(face initz-list-module-face
- mouse-face highlight
- start-open t rear-nonsticky t
- help-echo ,file))
- (put-text-property start (point) :file file))))
+ #'(lambda (file)
+ (let (start)
+ (insert-char ?\ 4)
+ (setq start (point))
+ (insert (initz-get-module-name file) "\n")
+ (add-text-properties start (1- (point))
+ `(face initz-list-module-face
+ mouse-face highlight
+ start-open t rear-nonsticky t
+ help-echo ,file))
+ (put-text-property start (point) :file file)))
(eval (intern (concat "initz-" node "-error-files"))))
(sort-lines nil sort-start (point)))
(set-buffer-modified-p nil)
(format initz-error-enter-message-format
(substitute-command-keys "\\[initz-error-find-file]")))
(insert "\n")
- (mapc
- (function (lambda (node)
- (initz-error-node-expand node)))
- '("compile" "load"))
+ (mapc #'(lambda (node)
+ (initz-error-node-expand node))
+ '("compile" "load"))
(set-buffer-modified-p nil)
(setq buffer-read-only t)
(goto-char (point-min))
(when (or (eq major-mode 'initz-list-mode)
(eq major-mode 'initz-error-mode))
(setq ad-return-value
- (mapcar
- (function (lambda (list)
- (cons (cons (caar list) (1+ (cdar list)))
- (cons (cadr list) (1+ (cddr list))))))
- ad-return-value))))
+ (mapcar #'(lambda (list)
+ (cons (cons (caar list) (1+ (cdar list)))
+ (cons (cadr list) (1+ (cddr list)))))
+ ad-return-value))))
(defun initz-list-delete-whole-line ()
"Delete whole line at point."
(defun initz-list-input-dir (&optional default)
"Input the dir."
- (let* ((completing-list (mapcar
- (function (lambda (list)
- (symbol-name (car list))))
- initz-init-alist))
+ (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)
- (mapcar
- (function (lambda (name)
- (cons name name)))
- completing-list)
+ (mapcar #'(lambda (name)
+ (cons name name))
+ completing-list)
nil t nil nil default)))
(defun initz-list-input-module (dir)
(if initz-list-input-module-completing
(completing-read
(format initz-list-input-module-message-format dir)
- (mapcar
- (function (lambda (feature)
- (let ((name (symbol-name feature)))
- (cons name name))))
- features)
+ (mapcar #'(lambda (feature)
+ (let ((name (symbol-name feature)))
+ (cons name name)))
+ features)
nil nil init)
(read-string
- (format initz-list-input-module-message-format dir)
- init))))
+ (format initz-list-input-module-message-format dir)
+ init))))
(defun initz-list-insert-file (dir startup-file)
"Insert the STARTUP-FILE at DIR section."
(let ((sort-start (point))
(initz-features (initz-features)))
(mapc
- (function (lambda (file)
- (let* ((module (initz-get-module-name file))
- (loaded (memq (intern module) initz-features))
- start)
- (insert-char ?\ 4)
- (setq start (point))
- (insert module)
- (when loaded (insert initz-list-loaded-mark))
- (insert "\n")
- (add-text-properties
- start (1- (point))
- `(face ,(if loaded
- 'initz-list-module-face
- 'initz-list-unloaded-module-face)
- mouse-face highlight
- start-open t rear-nonsticky t
- help-echo ,file))
- (put-text-property start (point) :file file))))
+ #'(lambda (file)
+ (let* ((module (initz-get-module-name file))
+ (loaded (memq (intern module) initz-features))
+ start)
+ (insert-char ?\ 4)
+ (setq start (point))
+ (insert module)
+ (when loaded (insert initz-list-loaded-mark))
+ (insert "\n")
+ (add-text-properties start (1- (point))
+ `(face ,(if loaded
+ 'initz-list-module-face
+ 'initz-list-unloaded-module-face)
+ mouse-face highlight
+ start-open t rear-nonsticky t
+ help-echo ,file))
+ (put-text-property start (point) :file file)))
(initz-get-files 'startup node))
(sort-lines nil sort-start (point)))
(set-buffer-modified-p nil)
(format initz-list-enter-message-format
(substitute-command-keys "\\[initz-list-find-file]")))
(insert "\n")
- (mapc
- (function (lambda (alist)
- (let ((sym (car alist)))
- (funcall
- (intern (concat "initz-list-node-"
- (symbol-name
- initz-list-default-node-status)))
- sym))))
- initz-init-alist)
+ (mapc #'(lambda (alist)
+ (let ((sym (car alist)))
+ (funcall (intern (concat "initz-list-node-"
+ (symbol-name
+ initz-list-default-node-status)))
+ sym)))
+ initz-init-alist)
(set-buffer-modified-p nil)
(setq buffer-read-only t)
(goto-char (point-min))
(defun initz-add-to-load-list (modules)
"Add MODULES to `initz-load-list-internal'."
(let ((modules (if (listp modules) modules (list modules))))
- (mapc
- (function (lambda (module)
- (add-to-list 'initz-load-list-internal module)))
- modules)))
+ (mapc #'(lambda (module)
+ (add-to-list 'initz-load-list-internal module))
+ modules)))
(defun initz-add-to-ignore-list (modules)
"Add MODULES to `initz-ignore-list-internal'."
(let ((modules (if (listp modules) modules (list modules))))
- (mapc
- (function (lambda (module)
- (add-to-list 'initz-ignore-list-internal module)))
- modules)))
+ (mapc #'(lambda (module)
+ (add-to-list 'initz-ignore-list-internal module))
+ modules)))
(defun initz-remove-from-load-list (modules)
"Remove MODULES from `initz-load-list-internal'."
(let ((modules (if (listp modules) modules (list modules))))
- (mapc
- (function (lambda (module)
- (setq initz-load-list-internal
- (delete module initz-load-list-internal))))
- modules)))
+ (mapc #'(lambda (module)
+ (setq initz-load-list-internal
+ (delete module initz-load-list-internal)))
+ modules)))
(defun initz-remove-from-ignore-list (modules)
"Remove MODULES from `initz-ignore-list-internal'."
(let ((modules (if (listp modules) modules (list modules))))
- (mapc
- (function (lambda (module)
- (setq initz-ignore-list-internal
- (delete module initz-ignore-list-internal))))
- modules)))
+ (mapc #'(lambda (module)
+ (setq initz-ignore-list-internal
+ (delete module initz-ignore-list-internal)))
+ modules)))
(defun initz-set-load-list (modules)
"Set MODULES to `initz-load-list-internal'."
(defun initz-add-to-load-path (paths)
"Add PATHS to `load-path' recursively."
(let ((paths (if (listp paths) paths (list paths))))
- (mapc
- (function (lambda (path)
- (when (file-directory-p path)
- (add-to-list 'load-path path)
- (initz-add-to-load-path
- ;; Without `.' and `..'.
- (directory-files
- path t "^\\([^.].+\\|\\.[^.].+\\|\\.\\..+\\)$")))))
- paths)))
+ (mapc #'(lambda (path)
+ (when (file-directory-p path)
+ (add-to-list 'load-path path)
+ (initz-add-to-load-path
+ ;; Without `.' and `..'.
+ (directory-files
+ path t "^\\([^.].+\\|\\.[^.].+\\|\\.\\..+\\)$"))))
+ paths)))
(defun initz-features ()
"Return the Initz features."
(delq nil
(mapcar
- (function (lambda (feature)
- (let ((initz-feature (initz-get-module-name
- (concat (symbol-name feature)
- ".el"))))
- (unless (string= initz-feature initz-null-string)
- (intern initz-feature)))))
+ #'(lambda (feature)
+ (let ((initz-feature (initz-get-module-name
+ (concat (symbol-name feature) ".el"))))
+ (unless (string= initz-feature initz-null-string)
+ (intern initz-feature))))
features)))
;;; Internal functions.
(defconst initz-init-alist
`((argument . ("argument"
- ,(mapconcat
- (function (lambda (arg)
- (initz-trim-separator arg)))
- (cdr command-line-args)
- initz-separator-string)))
+ ,(mapconcat #'(lambda (arg)
+ (initz-trim-separator arg))
+ (cdr command-line-args)
+ initz-separator-string)))
( flavor . ("flavor" ,initz-flavor))
(host . ("host" ,(system-name)))
(system . ("system" ,(symbol-name system-type)))
(count 0))
(unless (null list)
(catch 'found
- (mapc
- (function (lambda (temp)
- (if (eq type temp)
- (let ((elem (nth count list)))
- (when (and (eq type 'prefix)
- (not (string= elem initz-null-string)))
- (setq elem (concat initz-separator-string
- elem)))
- (throw 'found elem))
- (setq count (incf count)))))
+ (mapc #'(lambda (temp)
+ (if (eq type temp)
+ (let ((elem (nth count list)))
+ (when (and (eq type 'prefix)
+ (not (string= elem initz-null-string)))
+ (setq elem (concat initz-separator-string elem)))
+ (throw 'found elem))
+ (setq count (incf count))))
'(dir prefix))
nil))))
(defun initz-get-kind (file)
"Return the kind of FILE."
(catch 'found
- (mapc
- (function (lambda (kind)
- (when (string-match (initz-directory kind) file)
- (throw 'found kind))))
- '(startup flavor))
+ (mapc #'(lambda (kind)
+ (when (string-match (initz-directory kind) file)
+ (throw 'found kind)))
+ '(startup flavor))
nil))
(defun initz-get-dir (file)
(throw 'found 'misc)
(when (string-match (concat directory "\\(.+\\)") file)
(let ((dir (substring (match-string 1 file) 1)))
- (mapc
- (function (lambda (alist)
- (when (string= (nth 0 (cdr alist)) dir)
- (throw 'found (car alist)))))
- initz-init-alist))))
+ (mapc #'(lambda (alist)
+ (when (string= (nth 0 (cdr alist)) dir)
+ (throw 'found (car alist))))
+ initz-init-alist))))
nil)))
(defun initz-get-correspondence-file (init-file)
(defun initz-make-directory (sym)
"Make SYM's directory."
- (mapc
- (function (lambda (kind)
- (let ((directory (expand-file-name
- (initz-get-init-value sym 'dir)
- (initz-directory kind))))
- (unless (file-directory-p directory)
- (make-directory directory t)))))
- '(startup flavor)))
+ (mapc #'(lambda (kind)
+ (let ((directory (expand-file-name
+ (initz-get-init-value sym 'dir)
+ (initz-directory kind))))
+ (unless (file-directory-p directory)
+ (make-directory directory t))))
+ '(startup flavor)))
(defun initz-make-directories ()
"Make initz directories."
(interactive)
- (mapc
- (function (lambda (alist)
- (let ((sym (car alist)))
- (initz-make-directory sym))))
- initz-init-alist))
+ (mapc #'(lambda (alist)
+ (let ((sym (car alist)))
+ (initz-make-directory sym)))
+ initz-init-alist))
(defun initz-delete-file (flavor-file)
"Delete the FLAVOR-FILE when startup-file was deleted."
(defun initz-delete-files (sym)
"Delete files in the SYM's directory when startup-file was deleted."
(let ((flavor-files (initz-get-files 'flavor sym)))
- (mapc
- (function (lambda (flavor-file)
- (initz-delete-file flavor-file)))
- flavor-files)))
+ (mapc #'(lambda (flavor-file)
+ (initz-delete-file flavor-file))
+ flavor-files)))
(defun initz-delete ()
"Delete the initz startup files."
(interactive)
(initz-make-directories)
- (mapc
- (function (lambda (alist)
- (let ((sym (car alist)))
- (initz-delete-files sym))))
- initz-init-alist))
+ (mapc #'(lambda (alist)
+ (let ((sym (car alist)))
+ (initz-delete-files sym)))
+ initz-init-alist))
(defun initz-compile-file (startup-file)
"Compile the STARTUP-FILE."
"Compile files in the SYM's directory."
(let ((startup-files (initz-get-files 'startup sym))
compiled-files)
- (mapc
- (function (lambda (startup-file)
- (initz-compile-file startup-file)))
- startup-files)
+ (mapc #'(lambda (startup-file)
+ (initz-compile-file startup-file))
+ startup-files)
(setq compiled-files (directory-files
(initz-startup-directory sym) nil "\\.elc$"))
(install-files compiled-files (initz-startup-directory sym)
(interactive)
(initz-delete)
(setq initz-compile-error-files nil)
- (mapc
- (function (lambda (alist)
- (let ((sym (car alist)))
- (initz-compile-files sym))))
- initz-init-alist)
+ (mapc #'(lambda (alist)
+ (let ((sym (car alist)))
+ (initz-compile-files sym)))
+ initz-init-alist)
(and initz-compile-error-files (eq initz-verbose 'errors)
(initz-error)))
(defun initz-load-files (sym)
"Load files in the SYM's directory."
(let ((flavor-files (initz-get-files 'flavor sym)))
- (mapc
- (function (lambda (flavor-file)
- (initz-load-file flavor-file)))
- flavor-files)))
+ (mapc #'(lambda (flavor-file)
+ (initz-load-file flavor-file))
+ flavor-files)))
(defun initz-load ()
"Load the initz startup files."
;; tricky
(setq initz-load-list-internal initz-load-list)
(setq initz-ignore-list-internal initz-ignore-list)
- (mapc
- (function (lambda (alist)
- (let ((sym (car alist)))
- (initz-load-files sym))))
- initz-init-alist)
+ (mapc #'(lambda (alist)
+ (let ((sym (car alist)))
+ (initz-load-files sym)))
+ initz-init-alist)
(and initz-load-error-files (eq initz-verbose 'errors)
(initz-error)))