aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorKaroly Lorentey2006-06-12 07:27:12 +0000
committerKaroly Lorentey2006-06-12 07:27:12 +0000
commit476e9367ec1f440aa23904b7bc482ea4a3b8041c (patch)
tree4f7f5a5e9a6668f908834bb6e216c8fa3727d4b3 /lisp/diff-mode.el
parenta13f8f50d4cc544d3bbfa78568e82ce09e68bded (diff)
parent6b519504c3297595101628e823e72c91e562ab45 (diff)
downloademacs-476e9367ec1f440aa23904b7bc482ea4a3b8041c.tar.gz
emacs-476e9367ec1f440aa23904b7bc482ea4a3b8041c.zip
Merged from emacs@sv.gnu.org.
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-294 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-295 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-296 Update from CVS: admin/FOR-RELEASE: Update refcard section. * emacs@sv.gnu.org/emacs--devo--0--patch-297 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-298 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-299 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-300 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-301 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-302 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-303 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-304 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-103 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-104 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-570
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 1a8402e06c4..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 +"
@@ -993,8 +996,7 @@ a diff with \\[diff-reverse-direction]."
993 ;; compile support 996 ;; compile support
994 (set (make-local-variable 'next-error-function) 'diff-next-error) 997 (set (make-local-variable 'next-error-function) 'diff-next-error)
995 998
996 (when (and (> (point-max) (point-min)) diff-default-read-only) 999 (setq buffer-read-only diff-default-read-only)
997 (toggle-read-only t))
998 ;; setup change hooks 1000 ;; setup change hooks
999 (if (not diff-update-on-the-fly) 1001 (if (not diff-update-on-the-fly)
1000 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t) 1002 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t)
@@ -1355,6 +1357,7 @@ For use in `add-log-current-defun-function'."
1355 (file1 (make-temp-file "diff1")) 1357 (file1 (make-temp-file "diff1"))
1356 (file2 (make-temp-file "diff2")) 1358 (file2 (make-temp-file "diff2"))
1357 (coding-system-for-read buffer-file-coding-system) 1359 (coding-system-for-read buffer-file-coding-system)
1360 (inhibit-read-only t)
1358 old new) 1361 old new)
1359 (unwind-protect 1362 (unwind-protect
1360 (save-excursion 1363 (save-excursion