diff lisp/eshell/esh-io.el @ 109697:672b957881a8

* lisp/eshell/esh-io.el (eshell-get-target): Better detection of read-only file (Bug#6762).
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 30 Jul 2010 19:25:06 -0400
parents 1d1d5d9bd884
children f57f72bb4757 376148b31b5e
line wrap: on
line diff
--- a/lisp/eshell/esh-io.el	Fri Jul 30 02:54:53 2010 +0200
+++ b/lisp/eshell/esh-io.el	Fri Jul 30 19:25:06 2010 -0400
@@ -343,8 +343,9 @@
 	(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)