Update FSF's address.
[bpt/emacs.git] / lisp / compare-w.el
index 717974b..ac56996 100644 (file)
@@ -17,8 +17,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -52,6 +53,12 @@ whitespace is considered to match, and is skipped.")
 Compares the text starting at point in each window,
 moving over text in each one as far as they match.
 
+This command pushes the mark in each window
+at the prior location of point in that window.
+If both windows display the same buffer,
+the mark is pushed twice in that buffer:
+first in the other window, then in the selected window.
+
 A prefix arg means ignore changes in whitespace.
 The variable `compare-windows-whitespace' controls how whitespace is skipped.
 If `compare-ignore-case' is non-nil, changes in case are also ignored."
@@ -72,7 +79,9 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored."
     (setq maxp1 (point-max))
     (save-excursion
       (set-buffer b2)
+      (push-mark p2 t)
       (setq maxp2 (point-max)))
+    (push-mark)
 
     (setq success t)
     (while success
@@ -99,9 +108,10 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored."
                         (compare-windows-skip-whitespace opoint2)
                       (funcall skip-whitespace opoint2)))
               (setq p2a (point))
-              (and result1 result2 (eq result1 result2)
-                   (setq p1 p1a
-                         p2 p2a)))))
+              (if (or (stringp skip-whitespace)
+                      (and result1 result2 (eq result1 result2)))
+                  (setq p1 p1a
+                        p2 p2a)))))
 
       ;; Try advancing comparing 1000 chars at a time.
       ;; When that fails, go 500 chars at a time, and so on.