]> git.eshelyaron.com Git - emacs.git/commitdiff
* diff-mode.el (diff-hunk-kill, diff-file-kill, diff-split-hunk)
authorChong Yidong <cyd@stupidchicken.com>
Tue, 6 Jun 2006 14:17:31 +0000 (14:17 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 6 Jun 2006 14:17:31 +0000 (14:17 +0000)
(diff-refine-hunk): Set inhibit-read-only to t.

lisp/ChangeLog
lisp/diff-mode.el

index 0dc4bdbba450eec9e5479a13afb5da7c0a23527a..2aedcbc3280c99196d8f1523c7eed5b4ac2a99f9 100644 (file)
@@ -2,6 +2,8 @@
 
        * diff-mode.el (diff-mode): Set buffer-read-only to t when
        diff-default-read-only is non-nill.
+       (diff-hunk-kill, diff-file-kill, diff-split-hunk)
+       (diff-refine-hunk): Set inhibit-read-only to t.
 
        * diff.el (diff-sentinel, diff): Set inhibit-read-only to t when
        modifying the *Diff* buffer.
index f78ce1ae1555828939424730ed089b96c45583a3..7ea02352b0bc3f3a193d6781842a58c5d27a64b3 100644 (file)
@@ -438,7 +438,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
         (firsthunk (ignore-errors
                      (goto-char start)
                      (diff-beginning-of-file) (diff-hunk-next) (point)))
-        (nextfile (ignore-errors (diff-file-next) (point))))
+        (nextfile (ignore-errors (diff-file-next) (point)))
+        (inhibit-read-only t))
     (goto-char start)
     (if (and firsthunk (= firsthunk start)
             (or (null nexthunk)
@@ -457,7 +458,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
                     (ignore-errors
                       (diff-hunk-prev) (point))))
         (index (save-excursion
-                 (re-search-backward "^Index: " prevhunk t))))
+                 (re-search-backward "^Index: " prevhunk t)))
+        (inhibit-read-only t))
     (when index (setq start index))
     (diff-end-of-file)
     (if (looking-at "^\n") (forward-char 1)) ;`tla' generates such diffs.
@@ -497,7 +499,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
     (let* ((start1 (string-to-number (match-string 1)))
           (start2 (string-to-number (match-string 2)))
           (newstart1 (+ start1 (diff-count-matches "^[- \t]" (point) pos)))
-          (newstart2 (+ start2 (diff-count-matches "^[+ \t]" (point) pos))))
+          (newstart2 (+ start2 (diff-count-matches "^[+ \t]" (point) pos)))
+          (inhibit-read-only t))
       (goto-char pos)
       ;; Hopefully the after-change-function will not screw us over.
       (insert "@@ -" (number-to-string newstart1) ",1 +"
@@ -1354,6 +1357,7 @@ For use in `add-log-current-defun-function'."
         (file1 (make-temp-file "diff1"))
         (file2 (make-temp-file "diff2"))
         (coding-system-for-read buffer-file-coding-system)
+        (inhibit-read-only t)
         old new)
     (unwind-protect
        (save-excursion