Mercurial > emacs
comparison lisp/diff-mode.el @ 92618:42c38aef74a3
(diff-ignore-whitespace-hunk): Bind
inhibit-read-only before trying to change the buffer.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sat, 08 Mar 2008 07:56:13 +0000 |
parents | 4054054dd212 |
children | a7290e24873c |
comparison
equal
deleted
inserted
replaced
92617:56549e89b88c | 92618:42c38aef74a3 |
---|---|
1693 (point)))) | 1693 (point)))) |
1694 (opts (case (char-after) (?@ "-bu") (?* "-bc") (t "-b"))) | 1694 (opts (case (char-after) (?@ "-bu") (?* "-bc") (t "-b"))) |
1695 (line-nb (and (or (looking-at "[^0-9]+\\([0-9]+\\)") | 1695 (line-nb (and (or (looking-at "[^0-9]+\\([0-9]+\\)") |
1696 (error "Can't find line number")) | 1696 (error "Can't find line number")) |
1697 (string-to-number (match-string 1)))) | 1697 (string-to-number (match-string 1)))) |
1698 (inhibit-read-only t) | |
1698 (hunk (delete-and-extract-region | 1699 (hunk (delete-and-extract-region |
1699 (point) (save-excursion (diff-end-of-hunk) (point)))) | 1700 (point) (save-excursion (diff-end-of-hunk) (point)))) |
1700 (lead (make-string (1- line-nb) ?\n)) ;Line nums start at 1. | 1701 (lead (make-string (1- line-nb) ?\n)) ;Line nums start at 1. |
1701 (file1 (make-temp-file "diff1")) | 1702 (file1 (make-temp-file "diff1")) |
1702 (file2 (make-temp-file "diff2")) | 1703 (file2 (make-temp-file "diff2")) |
1703 (coding-system-for-read buffer-file-coding-system) | 1704 (coding-system-for-read buffer-file-coding-system) |
1704 (inhibit-read-only t) | |
1705 old new) | 1705 old new) |
1706 (unwind-protect | 1706 (unwind-protect |
1707 (save-excursion | 1707 (save-excursion |
1708 (setq old (diff-hunk-text hunk nil char-offset)) | 1708 (setq old (diff-hunk-text hunk nil char-offset)) |
1709 (setq new (diff-hunk-text hunk t char-offset)) | 1709 (setq new (diff-hunk-text hunk t char-offset)) |