emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#6762: closed (23.2; Eshell bug in detecting read


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#6762: closed (23.2; Eshell bug in detecting read-only file (patch included))
Date: Fri, 30 Jul 2010 23:26:01 +0000

Your message dated Fri, 30 Jul 2010 19:25:44 -0400
with message-id <address@hidden>
and subject line Re: bug#6762: 23.2; Eshell bug in detecting read-only file 
(patch included)
has caused the GNU bug report #6762,
regarding 23.2; Eshell bug in detecting read-only file (patch included)
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
6762: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6762
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 23.2; Eshell bug in detecting read-only file (patch included) Date: Fri, 30 Jul 2010 11:13:58 +0100
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: address@hidden
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)




--- End Message ---
--- Begin Message --- Subject: Re: bug#6762: 23.2; Eshell bug in detecting read-only file (patch included) Date: Fri, 30 Jul 2010 19:25:44 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
John Wiegley <address@hidden> 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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]