Mercurial > emacs
comparison lisp/compare-w.el @ 10031:324e027f01bc
(compare-windows): Push mark in both buffers at start.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 20 Nov 1994 21:55:55 +0000 |
parents | ec15948b9458 |
children | 83f275dcd93a |
comparison
equal
deleted
inserted
replaced
10030:f0264fb75509 | 10031:324e027f01bc |
---|---|
50 (defun compare-windows (ignore-whitespace) | 50 (defun compare-windows (ignore-whitespace) |
51 "Compare text in current window with text in next window. | 51 "Compare text in current window with text in next window. |
52 Compares the text starting at point in each window, | 52 Compares the text starting at point in each window, |
53 moving over text in each one as far as they match. | 53 moving over text in each one as far as they match. |
54 | 54 |
55 This command pushes the mark in each window | |
56 at the prior location of point in that window. | |
57 If both windows display the same buffer, | |
58 the mark is pushed twice in that buffer: | |
59 first in the other window, then in the selected window. | |
60 | |
55 A prefix arg means ignore changes in whitespace. | 61 A prefix arg means ignore changes in whitespace. |
56 The variable `compare-windows-whitespace' controls how whitespace is skipped. | 62 The variable `compare-windows-whitespace' controls how whitespace is skipped. |
57 If `compare-ignore-case' is non-nil, changes in case are also ignored." | 63 If `compare-ignore-case' is non-nil, changes in case are also ignored." |
58 (interactive "P") | 64 (interactive "P") |
59 (let* (p1 p2 maxp1 maxp2 b1 b2 w2 | 65 (let* (p1 p2 maxp1 maxp2 b1 b2 w2 |
70 b2 (window-buffer w2)) | 76 b2 (window-buffer w2)) |
71 (setq opoint2 p2) | 77 (setq opoint2 p2) |
72 (setq maxp1 (point-max)) | 78 (setq maxp1 (point-max)) |
73 (save-excursion | 79 (save-excursion |
74 (set-buffer b2) | 80 (set-buffer b2) |
81 (push-mark p2 t) | |
75 (setq maxp2 (point-max))) | 82 (setq maxp2 (point-max))) |
83 (push-mark) | |
76 | 84 |
77 (setq success t) | 85 (setq success t) |
78 (while success | 86 (while success |
79 (setq success nil) | 87 (setq success nil) |
80 ;; if interrupted, show how far we've gotten | 88 ;; if interrupted, show how far we've gotten |