comparison lisp/prim/make-docfile.el @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 5a88923fcbfe
children 2d532a89d707
comparison
equal deleted inserted replaced
166:7a77eb660975 167:85ec50267440
36 (defvar options nil) 36 (defvar options nil)
37 (defvar processed nil) 37 (defvar processed nil)
38 (defvar docfile nil) 38 (defvar docfile nil)
39 (defvar docfile-buffer nil) 39 (defvar docfile-buffer nil)
40 (defvar site-file-list nil) 40 (defvar site-file-list nil)
41 (defvar docfile-out-of-date nil)
41 42
42 ;; Gobble up the stuff we don't wish to pass on. 43 ;; Gobble up the stuff we don't wish to pass on.
43 (setq command-line-args (cdr (cdr (cdr (cdr command-line-args))))) 44 (setq command-line-args (cdr (cdr (cdr (cdr command-line-args)))))
44 45
45 ;; First gather up the command line options. 46 ;; First gather up the command line options.
64 65
65 ;; Next process the list of C files. 66 ;; Next process the list of C files.
66 (while command-line-args 67 (while command-line-args
67 (let ((arg (car command-line-args))) 68 (let ((arg (car command-line-args)))
68 (if (null (member arg processed)) 69 (if (null (member arg processed))
69 (setq processed (cons arg processed)))) 70 (progn
71 (if (and (null docfile-out-of-date)
72 (file-newer-than-file-p arg docfile))
73 (setq docfile-out-of-date t))
74 (setq processed (cons arg processed)))))
70 (setq command-line-args (cdr command-line-args))) 75 (setq command-line-args (cdr command-line-args)))
71 76
72 ;; Then process the list of Lisp files. 77 ;; Then process the list of Lisp files.
73 (define-function 'defalias 'define-function) 78 (define-function 'defalias 'define-function)
74 (let ((temp-path (expand-file-name ".." (car load-path)))) 79 (let ((temp-path (expand-file-name ".." (car load-path))))
99 (append dumped-lisp-packages packages-hardcoded-lisp)) 104 (append dumped-lisp-packages packages-hardcoded-lisp))
100 (while dumped-lisp-packages 105 (while dumped-lisp-packages
101 (let ((arg (packages-add-suffix (car dumped-lisp-packages)))) 106 (let ((arg (packages-add-suffix (car dumped-lisp-packages))))
102 (setq arg (locate-library arg)) 107 (setq arg (locate-library arg))
103 (if (null (member arg processed)) 108 (if (null (member arg processed))
104 (setq processed (cons arg processed))) 109 (progn
110 (if (and (null docfile-out-of-date)
111 (file-newer-than-file-p arg docfile))
112 (setq docfile-out-of-date t))
113 (setq processed (cons arg processed))))
105 (setq dumped-lisp-packages (cdr dumped-lisp-packages))))) 114 (setq dumped-lisp-packages (cdr dumped-lisp-packages)))))
106 115
107 ;; Finally process the list of site-loaded files. 116 ;; Finally process the list of site-loaded files.
108 (if site-file-list 117 (if site-file-list
109 (let (site-load-packages) 118 (let (site-load-packages)
110 (load site-file-list t t) 119 (load site-file-list t t)
111 (while site-load-packages 120 (while site-load-packages
112 (let ((arg (car site-load-packages))) 121 (let ((arg (car site-load-packages)))
113 (if (not (member arg processed)) 122 (if (not (member arg processed))
114 (setq processed (cons arg processed)))) 123 (progn
124 (if (and (null docfile-out-of-date)
125 (file-newer-than-file-p arg docfile))
126 (setq docfile-out-of-date t))
127 (setq processed (cons arg processed)))))
115 (setq site-load-packages (cdr site-load-packages))))) 128 (setq site-load-packages (cdr site-load-packages)))))
116 129
117 (let ((autoloads (list-autoloads))) 130 (let ((autoloads (list-autoloads)))
118 ;; (print (concat "Autoloads: " (prin1-to-string autoloads))) 131 ;; (print (concat "Autoloads: " (prin1-to-string autoloads)))
119 (while autoloads 132 (while autoloads
120 (let ((arg (car autoloads))) 133 (let ((arg (car autoloads)))
121 (if (null (member arg processed)) 134 (if (null (member arg processed))
122 (setq processed (cons arg processed))) 135 (progn
136 (if (and (null docfile-out-of-date)
137 (file-newer-than-file-p arg docfile))
138 (setq docfile-out-of-date t))
139 (setq processed (cons arg processed))))
123 (setq autoloads (cdr autoloads))))) 140 (setq autoloads (cdr autoloads)))))
124 141
125 ;; Now fire up make-docfile and we're done 142 ;; Now fire up make-docfile and we're done
126 143
127 (setq processed (nreverse processed)) 144 (setq processed (nreverse processed))
128 145
129 ;; (print (prin1-to-string (append options processed))) 146 ;; (print (prin1-to-string (append options processed)))
130 147
131 (princ "Spawning make-docfile ...") 148 (if docfile-out-of-date
132 ;; (print (prin1-to-string (append options processed))) 149 (progn
150 (princ "Spawning make-docfile ...")
151 ;; (print (prin1-to-string (append options processed)))
133 152
134 (setq exec-path (list (concat default-directory "../lib-src"))) 153 (setq exec-path (list (concat default-directory "../lib-src")))
135 154
136 ;; (locate-file-clear-hashing nil) 155 ;; (locate-file-clear-hashing nil)
137 (apply 'call-process-internal 156 (apply 'call-process-internal
138 ;; (concat default-directory "../lib-src/make-docfile") 157 ;; (concat default-directory "../lib-src/make-docfile")
139 "make-docfile" 158 "make-docfile"
140 nil 159 nil
141 t 160 t
142 nil 161 nil
143 (append options processed)) 162 (append options processed))
144 163
145 (princ "Spawning make-docfile ...done\n") 164 (princ "Spawning make-docfile ...done\n")
146 ;; (write-region-internal (point-min) (point-max) "/tmp/DOC") 165 ;; (write-region-internal (point-min) (point-max) "/tmp/DOC")
166 )
167 (princ "DOC file is up to date\n"))
147 168
148 (kill-emacs) 169 (kill-emacs)
149 170
150 ;;; make-docfile.el ends here 171 ;;; make-docfile.el ends here