From: John Wiegley <jwiegley@gmail.com>
To: Leo <sdl.web@gmail.com>
Cc: bug-gnu-emacs@gnu.org
Subject: bug#6762: 23.2; Eshell bug in detecting read-only file (patch included)
Date: Fri, 30 Jul 2010 06:15:52 -0400 [thread overview]
Message-ID: <9725718A-C8F6-4D99-8B60-507A82AC0FE9@gmail.com> (raw)
In-Reply-To: <m1k4odz389.fsf@cam.ac.uk>
Looks like a great patch to me.
John
On Jul 30, 2010, at 6:13 AM, Leo wrote:
> I have diff-default-read-only set to t and this prevents eshell from
> writing to diff files i.e.
>
> ESHELL$ git diff x..y > file.diff
>
> fails due to its use of buffer-read-only, which doesn't necessary
> reflects the read-only state of a file.
>
> The following patch tries to fix this.
>
> Leo
>
> commit b1dc6a427e43470981d4700b0c98aa21ecb03052
> Author: sdl.web@gmail.com
> Date: Sat May 1 17:50:21 2010 +0100
>
> Better detection of read-only file in eshell-get-target
>
> Modified lisp/eshell/esh-io.el
> diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
> index 1bcfe2b..3aa785c 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)
>
next prev parent reply other threads:[~2010-07-30 10:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 10:13 bug#6762: 23.2; Eshell bug in detecting read-only file (patch included) Leo
2010-07-30 10:15 ` John Wiegley [this message]
2010-07-30 23:25 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9725718A-C8F6-4D99-8B60-507A82AC0FE9@gmail.com \
--to=jwiegley@gmail.com \
--cc=bug-gnu-emacs@gnu.org \
--cc=sdl.web@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.