comparison lisp/startup.el @ 22334:979317421863

(normal-top-level-add-subdirs-to-load-path): Ignore CVS directories too.
author Dave Love <fx@gnu.org>
date Tue, 02 Jun 1998 13:21:13 +0000
parents 050c1872b04b
children 38486c386abb
comparison
equal deleted inserted replaced
22333:8d612a46dac6 22334:979317421863
337 (defvar init-file-had-error nil) 337 (defvar init-file-had-error nil)
338 338
339 (defun normal-top-level-add-subdirs-to-load-path () 339 (defun normal-top-level-add-subdirs-to-load-path ()
340 "Add all subdirectories of current directory to `load-path'. 340 "Add all subdirectories of current directory to `load-path'.
341 More precisely, this uses only the subdirectories whose names 341 More precisely, this uses only the subdirectories whose names
342 start with letters or digits; it excludes any subdirectory named`RCS', 342 start with letters or digits; it excludes any subdirectory named `RCS'
343 and any subdirectory that contains a file named `.nosearch'." 343 or `CVS', and any subdirectory that contains a file named `.nosearch'."
344 (let (dirs 344 (let (dirs
345 (pending (list default-directory))) 345 (pending (list default-directory)))
346 ;; This loop does a breadth-first tree walk on DIR's subtree, 346 ;; This loop does a breadth-first tree walk on DIR's subtree,
347 ;; putting each subdir into DIRS as its contents are examined. 347 ;; putting each subdir into DIRS as its contents are examined.
348 (while pending 348 (while pending
349 (setq dirs (cons (car pending) dirs)) 349 (setq dirs (cons (car pending) dirs))
350 (setq pending (cdr pending)) 350 (setq pending (cdr pending))
351 (let ((contents (directory-files (car dirs))) 351 (let ((contents (directory-files (car dirs)))
352 (default-directory (car dirs))) 352 (default-directory (car dirs)))
353 (while contents 353 (while contents
354 (unless (member (car contents) '("." ".." "RCS")) 354 (unless (member (car contents) '("." ".." "RCS" "CVS"))
355 (when (and (string-match "\\`[a-zA-Z0-9]" (car contents)) 355 (when (and (string-match "\\`[a-zA-Z0-9]" (car contents))
356 (file-directory-p (car contents))) 356 (file-directory-p (car contents)))
357 (let ((expanded (expand-file-name (car contents)))) 357 (let ((expanded (expand-file-name (car contents))))
358 (unless (file-exists-p (expand-file-name ".nosearch" 358 (unless (file-exists-p (expand-file-name ".nosearch"
359 expanded)) 359 expanded))