Commit 16b0b347 authored by Leo Liu's avatar Leo Liu Committed by Chong Yidong
Browse files

* lisp/eshell/esh-io.el (eshell-get-target): Better detection of read-only file (Bug#6762).

parent b756c005
2010-07-30 Leo <sdl.web@gmail.com>
* eshell/esh-io.el (eshell-get-target): Better detection of
read-only file (Bug#6762).
2010-07-30 Juanma Barranquero <lekktu@gmail.com>
* align.el (align-default-spacing): Doc fix.
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment