* lisp/initz.el (initz-init-alist): Use `#'' instead of `function'.
authorbg66 <bg66>
Tue, 30 Apr 2002 13:21:44 +0000 (13:21 +0000)
committerbg66 <bg66>
Tue, 30 Apr 2002 13:21:44 +0000 (13:21 +0000)
(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.

ChangeLog
lisp/initz-error.el
lisp/initz-list.el
lisp/initz-util.el
lisp/initz.el

index 0dfe15a..1a4493a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
 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>
index 905a2b8..634fead 100644 (file)
     (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))
index 5350d6b..cdfc0c7 100644 (file)
   (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))
index 5719f89..71f85ac 100644 (file)
 (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.
index 1780edf..29b136f 100644 (file)
@@ -79,11 +79,10 @@ If ARG is specified, don't display code name."
 
 (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)))
@@ -95,16 +94,14 @@ If ARG is specified, don't display code name."
        (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))))
 
@@ -131,11 +128,10 @@ If ARG is specified, don't display code name."
 (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)
@@ -149,11 +145,10 @@ If ARG is specified, don't display code name."
          (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)
@@ -188,23 +183,21 @@ If ARG is specified, don't display code name."
 
 (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."
@@ -215,20 +208,18 @@ If ARG is specified, don't display code name."
 (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."
@@ -250,10 +241,9 @@ If ARG is specified, don't display code name."
   "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)
@@ -264,11 +254,10 @@ If ARG is specified, don't display code name."
   (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)))
 
@@ -305,10 +294,9 @@ If ARG is specified, don't display code name."
 (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."
@@ -319,11 +307,10 @@ If ARG is specified, don't display code name."
   ;; 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)))