GNU bug report logs -
#6762
23.2; Eshell bug in detecting read-only file (patch included)
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Fri, 30 Jul 2010 10:14:01 UTC
Severity: normal
Found in version 23.2
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6762 in the body.
You can then email your comments to 6762 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6762
; Package
emacs
.
(Fri, 30 Jul 2010 10:14:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 30 Jul 2010 10:14:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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 <at> 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)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6762
; Package
emacs
.
(Fri, 30 Jul 2010 10:16:01 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
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 <at> 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)
>
Reply sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
You have taken responsibility.
(Fri, 30 Jul 2010 23:26:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Leo <sdl.web <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 30 Jul 2010 23:26:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 6762-done <at> debbugs.gnu.org (full text, mbox):
John Wiegley <jwiegley <at> gmail.com> writes:
> Looks like a great patch to me.
Checked in. Thanks.
> 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 28 Aug 2010 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.