(and (not rawfile)
(set-buffer-multibyte t))
(if rawfile
- (condition-case ()
+ (condition-case err
(let ((inhibit-read-only t)
(enable-local-variables nil))
(insert-file-contents-literally filename t))
(file-error
- (when (and (file-exists-p filename)
- (not (file-readable-p filename)))
+ (when (file-exists-p filename)
(kill-buffer buf)
- (signal 'file-error (list "File is not readable"
- filename)))
+ (signal 'file-error
+ (if (file-readable-p filename)
+ (cdr err)
+ (list "File is not readable" filename))))
;; Unconditionally set error
(setq error t)))
- (condition-case ()
+ (condition-case err
(let ((inhibit-read-only t))
(insert-file-contents filename t))
(file-error
- (when (and (file-exists-p filename)
- (not (file-readable-p filename)))
+ (when (file-exists-p filename)
(kill-buffer buf)
- (signal 'file-error (list "File is not readable"
- filename)))
+ (signal 'file-error
+ (if (file-readable-p filename)
+ (cdr err)
+ (list "File is not readable" filename))))
;; Run find-file-not-found-functions until one returns non-nil.
(or (run-hook-with-args-until-success 'find-file-not-found-functions)
;; If they fail too, set error.