aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-06-06 14:17:31 +0000
committerChong Yidong2006-06-06 14:17:31 +0000
commitdd24cb375fc84ea98e672da58b5ba814ef8ba472 (patch)
tree3581c536179354c7098ccaea8db28290b95854f9
parent53dd481c3fc408b0ebf32ae37a5884b3bd47cfee (diff)
downloademacs-dd24cb375fc84ea98e672da58b5ba814ef8ba472.tar.gz
emacs-dd24cb375fc84ea98e672da58b5ba814ef8ba472.zip
* diff-mode.el (diff-hunk-kill, diff-file-kill, diff-split-hunk)
(diff-refine-hunk): Set inhibit-read-only to t.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/diff-mode.el10
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0dc4bdbba45..2aedcbc3280 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
2 2
3 * diff-mode.el (diff-mode): Set buffer-read-only to t when 3 * diff-mode.el (diff-mode): Set buffer-read-only to t when
4 diff-default-read-only is non-nill. 4 diff-default-read-only is non-nill.
5 (diff-hunk-kill, diff-file-kill, diff-split-hunk)
6 (diff-refine-hunk): Set inhibit-read-only to t.
5 7
6 * diff.el (diff-sentinel, diff): Set inhibit-read-only to t when 8 * diff.el (diff-sentinel, diff): Set inhibit-read-only to t when
7 modifying the *Diff* buffer. 9 modifying the *Diff* buffer.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index f78ce1ae155..7ea02352b0b 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -438,7 +438,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
438 (firsthunk (ignore-errors 438 (firsthunk (ignore-errors
439 (goto-char start) 439 (goto-char start)
440 (diff-beginning-of-file) (diff-hunk-next) (point))) 440 (diff-beginning-of-file) (diff-hunk-next) (point)))
441 (nextfile (ignore-errors (diff-file-next) (point)))) 441 (nextfile (ignore-errors (diff-file-next) (point)))
442 (inhibit-read-only t))
442 (goto-char start) 443 (goto-char start)
443 (if (and firsthunk (= firsthunk start) 444 (if (and firsthunk (= firsthunk start)
444 (or (null nexthunk) 445 (or (null nexthunk)
@@ -457,7 +458,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
457 (ignore-errors 458 (ignore-errors
458 (diff-hunk-prev) (point)))) 459 (diff-hunk-prev) (point))))
459 (index (save-excursion 460 (index (save-excursion
460 (re-search-backward "^Index: " prevhunk t)))) 461 (re-search-backward "^Index: " prevhunk t)))
462 (inhibit-read-only t))
461 (when index (setq start index)) 463 (when index (setq start index))
462 (diff-end-of-file) 464 (diff-end-of-file)
463 (if (looking-at "^\n") (forward-char 1)) ;`tla' generates such diffs. 465 (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."
497 (let* ((start1 (string-to-number (match-string 1))) 499 (let* ((start1 (string-to-number (match-string 1)))
498 (start2 (string-to-number (match-string 2))) 500 (start2 (string-to-number (match-string 2)))
499 (newstart1 (+ start1 (diff-count-matches "^[- \t]" (point) pos))) 501 (newstart1 (+ start1 (diff-count-matches "^[- \t]" (point) pos)))
500 (newstart2 (+ start2 (diff-count-matches "^[+ \t]" (point) pos)))) 502 (newstart2 (+ start2 (diff-count-matches "^[+ \t]" (point) pos)))
503 (inhibit-read-only t))
501 (goto-char pos) 504 (goto-char pos)
502 ;; Hopefully the after-change-function will not screw us over. 505 ;; Hopefully the after-change-function will not screw us over.
503 (insert "@@ -" (number-to-string newstart1) ",1 +" 506 (insert "@@ -" (number-to-string newstart1) ",1 +"
@@ -1354,6 +1357,7 @@ For use in `add-log-current-defun-function'."
1354 (file1 (make-temp-file "diff1")) 1357 (file1 (make-temp-file "diff1"))
1355 (file2 (make-temp-file "diff2")) 1358 (file2 (make-temp-file "diff2"))
1356 (coding-system-for-read buffer-file-coding-system) 1359 (coding-system-for-read buffer-file-coding-system)
1360 (inhibit-read-only t)
1357 old new) 1361 old new)
1358 (unwind-protect 1362 (unwind-protect
1359 (save-excursion 1363 (save-excursion