diff options
| author | Richard M. Stallman <rms@gnu.org> | 1993-07-26 05:55:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1993-07-26 05:55:40 +0000 |
| commit | a9fa0bd5a62b2a0f4405a917da759c014744b6f3 (patch) | |
| tree | 9531e9a1f99a47e18a74d7ca97eb33e7641efcb3 /lisp/files.el | |
| parent | 9fd7d808494d1c3e2782cea503cef2c623532fe3 (diff) | |
| download | emacs-a9fa0bd5a62b2a0f4405a917da759c014744b6f3.tar.gz | |
(insert-directory): Make sure default-directory is absolute.
(set-auto-mode): Fix backwards test involving inhibit-local-variables-regexps.
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/files.el b/lisp/files.el index 70e42d81bec..abdaca88fd5 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -833,12 +833,12 @@ If `enable-local-variables' is nil, this function does not check for a (if (and enable-local-variables ;; Don't look for -*- if this file name matches any ;; of the regexps in inhibit-local-variables-regexps. - (not (let ((temp inhibit-local-variables-regexps)) - (while (and temp - (not (string-match (car temp) - buffer-file-name))) - (setq temp (cdr temp))) - (not temp))) + (let ((temp inhibit-local-variables-regexps)) + (while (and temp + (not (string-match (car temp) + buffer-file-name))) + (setq temp (cdr temp))) + (not temp)) (search-forward "-*-" (save-excursion ;; If the file begins with "#!" ;; (exec interpreter magic), look @@ -1880,7 +1880,11 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (if (eq system-type 'vax-vms) (vms-read-directory file switches (current-buffer)) (if wildcard - (let ((default-directory (file-name-directory file))) + ;; Run ls in the directory of the file pattern we asked for. + (let ((default-directory + (if (file-name-absolute-p file) + (file-name-directory file) + (file-name-directory (expand-file-name file))))) (call-process shell-file-name nil t nil "-c" (concat insert-directory-program " -d " switches " " |
