]> code.delx.au - gnu-emacs/blobdiff - lisp/files.el
(ido-ignore-directories-merge): Doc fix.
[gnu-emacs] / lisp / files.el
index 9d756bcfd29fdc94e39eb51756e2aab10d00cd55..321c52460c95a63625cb685bd24ab622f8b230a0 100644 (file)
@@ -675,18 +675,17 @@ Do not specify them in other calls."
     ;; it is stored on disk (expanding short name aliases with the full
     ;; name in the process).
     (if (eq system-type 'windows-nt)
-      (let ((handler (find-file-name-handler filename 'file-truename))
-           newname)
+      (let ((handler (find-file-name-handler filename 'file-truename)))
        ;; For file name that has a special handler, call handler.
        ;; This is so that ange-ftp can save time by doing a no-op.
        (if handler
            (setq filename (funcall handler 'file-truename filename))
          ;; If filename contains a wildcard, newname will be the old name.
-         (if (string-match "[[*?]" filename)
-             (setq newname filename)
-           ;; If filename doesn't exist, newname will be nil.
-           (setq newname (w32-long-file-name filename)))
-         (setq filename (or newname filename)))
+         (unless (string-match "[[*?]" filename)
+           ;; If filename exists, use the long name, otherwise
+           ;; canonicalize the name, to handle case differences.
+           (setq filename (or (w32-long-file-name filename)
+                              (untranslated-canonical-name filename)))))
        (setq done t)))
 
     ;; If this file directly leads to a link, process that iteratively
@@ -810,7 +809,7 @@ documentation for additional customization information."
               minibuffer-setup-hook))
          (add-hook 'minibuffer-setup-hook munge-default-fun)
          (read-file-name prompt nil default-directory mustmatch))
-       current-prefix-arg))
+       t))
 
 (defun find-file (filename &optional wildcards)
   "Edit file FILENAME.
@@ -1251,6 +1250,7 @@ that are visiting the various files."
       ;; Needed in case we are re-visiting the file with a different
       ;; text representation.
       (kill-local-variable 'buffer-file-coding-system)
+      (kill-local-variable 'cursor-type)
       (erase-buffer)
       (and (default-value 'enable-multibyte-characters)
           (not rawfile)
@@ -1486,7 +1486,9 @@ in that case, this function acts as if `enable-local-variables' were t."
                                        enable-local-variables)))
        (hack-local-variables))
     (error (message "File local-variables error: %s"
-                   (prin1-to-string err)))))
+                   (prin1-to-string err))))
+  (if (fboundp 'ucs-set-table-for-input) ; don't lose when building
+      (ucs-set-table-for-input)))
 
 (defvar auto-mode-alist
   (mapc
@@ -2067,7 +2069,10 @@ is specified, returning t if it is specified."
 (put 'mode-line-buffer-identification 'risky-local-variable t)
 (put 'mode-line-modes 'risky-local-variable t)
 (put 'mode-line-position 'risky-local-variable t)
+(put 'mode-line-process 'risky-local-variable t)
+(put 'mode-name 'risky-local-variable t)
 (put 'display-time-string 'risky-local-variable t)
+(put 'parse-time-rules 'risky-local-variable t)
 
 ;; This case is safe because the user gets to check it before it is used.
 (put 'compile-command 'safe-local-variable 'stringp)
@@ -2396,7 +2401,7 @@ BACKUPNAME is the backup file name, which is the old file renamed."
     ;                        (file-symlink-p buffer-file-name)
                              backup-by-copying
                              ;; Don't rename a suid or sgid file.
-                             (< 0 (logand modes #o6000))
+                             (and modes (< 0 (logand modes #o6000)))
                              (and backup-by-copying-when-linked
                                   (> (file-nlinks real-file-name) 1))
                              (and (or backup-by-copying-when-mismatch
@@ -4101,17 +4106,18 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
              (beginning-of-line)
              (delete-region (point) (progn (forward-line 2) (point)))))
 
-         ;; Try to insert the amount of free space.
-         (save-excursion
-           (goto-char beg)
-           ;; First find the line to put it on.
-           (when (re-search-forward "^ *\\(total\\)" nil t)
-             (let ((available (get-free-disk-space ".")))
-               (when available
-                 ;; Replace "total" with "used", to avoid confusion.
-                 (replace-match "total used in directory" nil nil nil 1)
-                 (end-of-line)
-                 (insert " available " available))))))))))
+         (if full-directory-p
+             ;; Try to insert the amount of free space.
+             (save-excursion
+               (goto-char beg)
+               ;; First find the line to put it on.
+               (when (re-search-forward "^ *\\(total\\)" nil t)
+                 (let ((available (get-free-disk-space ".")))
+                   (when available
+                     ;; Replace "total" with "used", to avoid confusion.
+                     (replace-match "total used in directory" nil nil nil 1)
+                     (end-of-line)
+                     (insert " available " available)))))))))))
 
 (defun insert-directory-safely (file switches
                                     &optional wildcard full-directory-p)