diff options
Diffstat (limited to 'lisp/eshell/esh-io.el')
-rw-r--r-- | lisp/eshell/esh-io.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index 1bcfe2b46e7..3aa785c7c1b 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -343,8 +343,9 @@ it defaults to `insert'." (let* ((exists (get-file-buffer target)) (buf (find-file-noselect target t))) (with-current-buffer buf - (if buffer-read-only + (if buffer-file-read-only (error "Cannot write to read-only file `%s'" target)) + (setq buffer-read-only nil) (set (make-local-variable 'eshell-output-file-buffer) (if (eq exists buf) 0 t)) (cond ((eq mode 'overwrite) |