comparison lisp/files.el @ 4283:f705c18c410d

(insert-directory): Make sure default-directory is absolute. (set-auto-mode): Fix backwards test involving inhibit-local-variables-regexps.
author Richard M. Stallman <rms@gnu.org>
date Mon, 26 Jul 1993 05:55:40 +0000
parents 6f940dcec978
children ebf146cb7720
comparison
equal deleted inserted replaced
4282:af81ea5c816e 4283:f705c18c410d
831 (goto-char (point-min)) 831 (goto-char (point-min))
832 (skip-chars-forward " \t\n") 832 (skip-chars-forward " \t\n")
833 (if (and enable-local-variables 833 (if (and enable-local-variables
834 ;; Don't look for -*- if this file name matches any 834 ;; Don't look for -*- if this file name matches any
835 ;; of the regexps in inhibit-local-variables-regexps. 835 ;; of the regexps in inhibit-local-variables-regexps.
836 (not (let ((temp inhibit-local-variables-regexps)) 836 (let ((temp inhibit-local-variables-regexps))
837 (while (and temp 837 (while (and temp
838 (not (string-match (car temp) 838 (not (string-match (car temp)
839 buffer-file-name))) 839 buffer-file-name)))
840 (setq temp (cdr temp))) 840 (setq temp (cdr temp)))
841 (not temp))) 841 (not temp))
842 (search-forward "-*-" (save-excursion 842 (search-forward "-*-" (save-excursion
843 ;; If the file begins with "#!" 843 ;; If the file begins with "#!"
844 ;; (exec interpreter magic), look 844 ;; (exec interpreter magic), look
845 ;; for mode frobs in the first two 845 ;; for mode frobs in the first two
846 ;; lines. You cannot necessarily 846 ;; lines. You cannot necessarily
1878 (funcall handler 'insert-directory file switches 1878 (funcall handler 'insert-directory file switches
1879 wildcard full-directory-p) 1879 wildcard full-directory-p)
1880 (if (eq system-type 'vax-vms) 1880 (if (eq system-type 'vax-vms)
1881 (vms-read-directory file switches (current-buffer)) 1881 (vms-read-directory file switches (current-buffer))
1882 (if wildcard 1882 (if wildcard
1883 (let ((default-directory (file-name-directory file))) 1883 ;; Run ls in the directory of the file pattern we asked for.
1884 (let ((default-directory
1885 (if (file-name-absolute-p file)
1886 (file-name-directory file)
1887 (file-name-directory (expand-file-name file)))))
1884 (call-process shell-file-name nil t nil 1888 (call-process shell-file-name nil t nil
1885 "-c" (concat insert-directory-program 1889 "-c" (concat insert-directory-program
1886 " -d " switches " " 1890 " -d " switches " "
1887 (file-name-nondirectory file)))) 1891 (file-name-nondirectory file))))
1888 ;; SunOS 4.1.3, SVr4 and others need the "." to list the 1892 ;; SunOS 4.1.3, SVr4 and others need the "." to list the