From: Henry M. Wu Date: Tue, 21 Apr 1992 17:27:36 +0000 (+0000) Subject: Added OS/COMPLETION-IGNORE-FILENAME? to unix.scm X-Git-Tag: 20090517-FFI~9469 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1dce70b1936d6226ab3c1d3d7c69fd20f9ebe3f6;p=mit-scheme.git Added OS/COMPLETION-IGNORE-FILENAME? to unix.scm --- diff --git a/v7/src/edwin/filcom.scm b/v7/src/edwin/filcom.scm index ca97f00bf..f7e1e9952 100644 --- a/v7/src/edwin/filcom.scm +++ b/v7/src/edwin/filcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.166 1992/04/08 17:57:43 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.167 1992/04/21 17:27:36 mhwu Exp $ ;;; ;;; Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology ;;; @@ -665,19 +665,7 @@ If a file with the new name already exists, confirmation is requested first." (if (os/file-directory? (os/make-filename directory (car filenames))) (set-car! filenames (os/filename-as-directory (car filenames))))) (sort filenames string 0." (pathname-type (->namestring (pathname-new-type pathname false))) type))) +(define (os/completion-ignore-filename? filename) + (and (not (os/file-directory? filename)) + (there-exists? (ref-variable completion-ignored-extensions) + (lambda (extension) + (string-suffix? extension filename))))) + (define (os/completion-ignored-extensions) (append '(".o" ".elc" ".bin" ".lbin" ".fasl" ".dvi" ".toc" ".log" ".aux" ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot") (list-copy unix/backup-suffixes))) +(define-variable completion-ignored-extensions + "Completion ignores filenames ending in any string in this list." + (os/completion-ignored-extensions) + (lambda (extensions) + (and (list? extensions) + (for-all? extensions + (lambda (extension) + (and (string? extension) + (not (string-null? extension)))))))) + (define (os/file-type-to-major-mode) (alist-copy `(("article" . text)