X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/8c9dbabe64160ab8a31e04556014cf8c0a003dff..ddff3d800e7820d6d2d71f270afa90e5cc29ac71:/lisp/compare-w.el diff --git a/lisp/compare-w.el b/lisp/compare-w.el index 7a01c30209..495ff12d11 100644 --- a/lisp/compare-w.el +++ b/lisp/compare-w.el @@ -1,6 +1,6 @@ ;;; compare-w.el --- compare text between windows for Emacs. -;; Copyright (C) 1986, 1989, 1993 Free Software Foundation, Inc. +;; Copyright (C) 1986, 1989, 1993, 1997 Free Software Foundation, Inc. ;; Maintainer: FSF @@ -30,7 +30,12 @@ ;;; Code: -(defvar compare-windows-whitespace "[ \t\n]+" +(defgroup compare-w nil + "Compare text between windows." + :prefix "compare-" + :group 'tools) + +(defcustom compare-windows-whitespace "[ \t\n]+" "*Regexp that defines whitespace sequences for \\[compare-windows]. Changes in whitespace are optionally ignored. @@ -42,10 +47,14 @@ point; it should also advance past any whitespace. The function is passed one argument, the point where `compare-windows' was originally called; it should not consider any text before that point. If the function returns the same value for both buffers, then the -whitespace is considered to match, and is skipped.") +whitespace is considered to match, and is skipped." + :type '(choice regexp function) + :group 'compare-w) -(defvar compare-ignore-case nil - "*Non-nil means \\[compare-windows] ignores case differences.") +(defcustom compare-ignore-case nil + "*Non-nil means \\[compare-windows] ignores case differences." + :type 'boolean + :group 'compare-w) ;;;###autoload (defun compare-windows (ignore-whitespace) @@ -72,7 +81,7 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored." 'compare-windows-skip-whitespace compare-windows-whitespace)))) (setq p1 (point) b1 (current-buffer)) - (setq w2 (next-window (selected-window))) + (setq w2 (next-window (selected-window) nil 'visible)) (if (eq w2 (selected-window)) (error "No other window")) (setq p2 (window-point w2) @@ -98,7 +107,7 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored." (goto-char p2) (setq result2 (funcall skip-func opoint2)) (setq p2a (point)) - (if (or (stringp skip-whitespace) + (if (or (stringp compare-windows-whitespace) (and result1 result2 (eq result1 result2))) (setq p1 p1a p2 p2a)))))