]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-file-noselect-1): Do not bind `inhibit-read-only' to t during
authorLuc Teirlinck <teirllm@auburn.edu>
Sat, 29 May 2004 01:54:11 +0000 (01:54 +0000)
committerLuc Teirlinck <teirllm@auburn.edu>
Sat, 29 May 2004 01:54:11 +0000 (01:54 +0000)
execution of `find-file-not-found-functions'.

lisp/ChangeLog
lisp/files.el

index f748728d7fcebf9e601b61880cb823a0593cebe2..25093d8d764bcdc976b2525277d47b8fe2e7a407 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-28  Luc Teirlinck  <teirllm@auburn.edu>
+
+       * files.el (find-file-noselect-1): Do not bind
+       `inhibit-read-only' to t during execution of
+       `find-file-not-found-functions'.
+
 2004-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vc-mcvs.el (vc-mcvs-print-log, vc-mcvs-diff):
index 13145faeddb926b066fc7916485edace4976869d..27e0ded28e22c594295202ab5b3ad759c946a545 100644 (file)
@@ -1365,33 +1365,35 @@ that are visiting the various files."
       (kill-local-variable 'buffer-file-coding-system)
       (kill-local-variable 'cursor-type)
       (let ((inhibit-read-only t))
-       (erase-buffer)
-       (and (default-value 'enable-multibyte-characters)
-            (not rawfile)
-            (set-buffer-multibyte t))
-       (if rawfile
-           (condition-case ()
-               (insert-file-contents-literally filename t)
-             (file-error
-              (when (and (file-exists-p filename)
-                         (not (file-readable-p filename)))
-                (kill-buffer buf)
-                (signal 'file-error (list "File is not readable"
-                                          filename)))
-              ;; Unconditionally set error
-              (setq error t)))
+       (erase-buffer))
+      (and (default-value 'enable-multibyte-characters)
+          (not rawfile)
+          (set-buffer-multibyte t))
+      (if rawfile
          (condition-case ()
-             (insert-file-contents filename t)
+             (let ((inhibit-read-only t))
+               (insert-file-contents-literally filename t))
            (file-error
             (when (and (file-exists-p filename)
                        (not (file-readable-p filename)))
               (kill-buffer buf)
               (signal 'file-error (list "File is not readable"
                                         filename)))
-            ;; Run find-file-not-found-hooks until one returns non-nil.
-            (or (run-hook-with-args-until-success 'find-file-not-found-functions)
-                ;; If they fail too, set error.
-                (setq error t))))))
+            ;; Unconditionally set error
+            (setq error t)))
+       (condition-case ()
+           (let ((inhibit-read-only t))
+             (insert-file-contents filename t))
+         (file-error
+          (when (and (file-exists-p filename)
+                     (not (file-readable-p filename)))
+            (kill-buffer buf)
+            (signal 'file-error (list "File is not readable"
+                                      filename)))
+          ;; Run find-file-not-found-hooks until one returns non-nil.
+          (or (run-hook-with-args-until-success 'find-file-not-found-functions)
+              ;; If they fail too, set error.
+              (setq error t)))))
       ;; Record the file's truename, and maybe use that as visited name.
       (if (equal filename buffer-file-name)
          (setq buffer-file-truename truename)