changeset 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 af81ea5c816e
children 831da9ea9a95
files lisp/files.el
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Mon Jul 26 05:34:46 1993 +0000
+++ b/lisp/files.el	Mon Jul 26 05:55:40 1993 +0000
@@ -833,12 +833,12 @@
       (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 (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 " "