comparison lisp/prim/packages.el @ 187:b405438285a2 r20-3b20

Import from CVS: tag r20-3b20
author cvs
date Mon, 13 Aug 2007 09:56:28 +0200
parents 3d6bfa290dbd
children 489f57a838ef
comparison
equal deleted inserted replaced
186:24ac94803b48 187:b405438285a2
138 "List autoloads from precomputed load-path." 138 "List autoloads from precomputed load-path."
139 (let ((path load-path) 139 (let ((path load-path)
140 autoloads) 140 autoloads)
141 (while path 141 (while path
142 (if (file-exists-p (concat (car path) 142 (if (file-exists-p (concat (car path)
143 "/" autoload-file-name)) 143 autoload-file-name))
144 (setq autoloads (cons (concat (car path) 144 (setq autoloads (cons (concat (car path)
145 "/" autoload-file-name) 145 autoload-file-name)
146 autoloads))) 146 autoloads)))
147 (setq path (cdr path))) 147 (setq path (cdr path)))
148 autoloads)) 148 autoloads))
149 149
150 (defun list-autoloads () 150 (defun list-autoloads ()
182 (setq data-directory-list 182 (setq data-directory-list
183 (cons (concat package "/etc/") data-directory-list))) 183 (cons (concat package "/etc/") data-directory-list)))
184 ;; Lisp files 184 ;; Lisp files
185 (if (file-directory-p (concat package "/lisp")) 185 (if (file-directory-p (concat package "/lisp"))
186 (progn 186 (progn
187 ;; (print (concat "DIR: " package "/lisp/"))
187 (setq load-path (cons (concat package "/lisp/") load-path)) 188 (setq load-path (cons (concat package "/lisp/") load-path))
188 (let ((dirs (directory-files (concat package "/lisp/") 189 (let ((dirs (directory-files (concat package "/lisp/")
189 t "^[^-.]" nil 'dirs-only)) 190 t "^[^-.]" nil 'dirs-only))
190 dir) 191 dir)
191 (while dirs 192 (while dirs
192 (setq dir (car dirs)) 193 (setq dir (car dirs))
194 ;; (print (concat "DIR: " dir "/"))
193 (setq load-path (cons (concat dir "/") load-path)) 195 (setq load-path (cons (concat dir "/") load-path))
194 (packages-find-packages-1 dir path-only) 196 (packages-find-packages-1 dir path-only)
195 (setq dirs (cdr dirs))))))) 197 (setq dirs (cdr dirs)))))))
196 198
197 ;; The following function is called from temacs 199 ;; The following function is called from temacs
198 (defun packages-find-packages (pkg-path path-only) 200 (defun packages-find-packages (pkg-path path-only &optional suppress-user)
199 "Search the supplied path for additional info/etc/lisp directories. 201 "Search the supplied path for additional info/etc/lisp directories.
200 Lisp directories if configured prior to build time will have equivalent 202 Lisp directories if configured prior to build time will have equivalent
201 status as bundled packages." 203 status as bundled packages.
202 (let ((path pkg-path) 204 If the argument `path-only' is non-nil, only the `load-path' will be set,
205 otherwise data directories and info directories will be added.
206 If the optional argument `suppress-user' is non-nil, package directories
207 rooted in a user login directory (like ~/.xemacs) will not be searched.
208 This is used at dump time to suppress the builder's local environment."
209 (let ((path (reverse pkg-path))
203 dir) 210 dir)
204 (while path 211 (while path
205 (setq dir (car path)) 212 (setq dir (car path))
206 ;; (prin1 (concat "Find: " (expand-file-name dir) "\n")) 213 ;; (prin1 (concat "Find: " (expand-file-name dir) "\n"))
207 (packages-find-packages-1 (expand-file-name dir) path-only) 214 (if (null (and suppress-user
215 (string-match "^~" dir)))
216 (progn
217 ;; (print dir)
218 (packages-find-packages-1 (expand-file-name dir) path-only)))
208 (setq path (cdr path))))) 219 (setq path (cdr path)))))
209 220
210 ;; Data-directory is really a list now. Provide something to search it for 221 ;; Data-directory is really a list now. Provide something to search it for
211 ;; directories. 222 ;; directories.
212 223
223 found)) 234 found))
224 235
225 ;; If we are being loaded as part of being dumped, bootstrap the rest of the 236 ;; If we are being loaded as part of being dumped, bootstrap the rest of the
226 ;; load-path for loaddefs. 237 ;; load-path for loaddefs.
227 (if (fboundp 'load-gc) 238 (if (fboundp 'load-gc)
228 (packages-find-packages package-path t)) 239 (packages-find-packages package-path t t))
229 240
230 (provide 'packages) 241 (provide 'packages)
231 242
232 ;;; packages.el ends here 243 ;;; packages.el ends here