;; Copyright (C) 1998 Free Software Foundation, Inc.
-;; Author: Richard Sharman <rsharman@magma.ca>
+;; Author: Richard Sharman <rsharman@pobox.com>
;; Keywords: faces
+;; This file is part of GNU Emacs.
+
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; You can "age" different sets of changes by using
;; `highlight-changes-rotate-faces'. This rotates different through a series
;; of different faces, so you can distinguish "new" changes from "older"
-;; changes. You can customize these "rotates" faces in two ways. You can
+;; changes. You can customize these "rotated" faces in two ways. You can
;; either explicitly define each face by customizing
;; `highlight-changes-face-list'. If, however, the faces differ from
;; `highlight-changes-face' only in the foreground colour, you can simply set
;; `highlight-changes-previous-change'.
;;
;;
-;; You can also use the command compare-with-file to show changes in this
-;; file compared with another file (typically the previous version of the
-;; file).
+;; You can also use the command highlight-compare-with-file to show changes
+;; in this file compared with another file (typically the previous version
+;; of the file).
;;
;;
;; There are currently three hooks run by `highlight-changes-mode':
;; highlight-changes-mode
;; highlight-changes-remove-highlight
;; highlight-changes-rotate-faces
-;; compare-with-file
+;; highlight-compare-with-file
;;
;; You can automatically rotate faces when the buffer is saved;
;; - having different faces for deletion and non-deletion: is it
;; really worth the hassle?
;; - should have better hooks: when should they be run?
-;; - compare-with-file should allow RCS files - e.g. nice to be able
-;; to say show changes compared with version 2.1.
+;; - highlight-compare-with-file should allow RCS files - e.g. nice to be
+;; able to say show changes compared with version 2.1.
;; - Maybe we should have compare-with-buffer as well. (When I tried
;; a while back I ran into a problem with ediff-buffers-internal.)
;; ====================== Customization =======================
(defgroup highlight-changes nil
"Highlight Changes mode."
+ :version "20.4"
:group 'faces)
;; These shouldn't be changed!
+;; Autoload for the benefit of `make-mode-line-mouse-sensitive'.
+;;;###autoload
(defvar highlight-changes-mode nil)
(defvar hilit-chg-list nil)
(defvar hilit-chg-string " ??")
(eval-and-compile
- ;; For compare-with-file
+ ;; For highlight-compare-with-file
(defvar ediff-number-of-differences)
(autoload 'ediff-setup "ediff")
(autoload 'ediff-with-current-buffer "ediff")
;;
;; This function is called by the `after-change-functions' hook, which
;; is how we are notified when text is changed.
- ;; It is also called from `compare-with-file'.
+ ;; It is also called from `highlight-compare-with-file'.
;;
;; We do NOT want to simply do this if this is an undo command, because
;; otherwise an undone change shows up as changed. While the properties
Functions:
\\[highlight-changes-next-change] - move point to beginning of next change
\\[highlight-changes-previous-change] - move to beginning of previous change
-\\[compare-with-file] - mark text as changed by comparing this buffer with
- the contents of a file
+\\[highlight-compare-with-file] - mark text as changed by comparing this
+ buffer with the contents of a file
\\[highlight-changes-remove-highlight] - remove the change face from the region
\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
through
;; This uses ediff to find the differences.
;;;###autoload
-(defun compare-with-file (file-b)
- "Compare this buffer with a file.
+(defun highlight-compare-with-file (file-b)
+ "Compare this buffer with a file, and highlight differences.
The current buffer must be an unmodified buffer visiting a file,
and not in read-only mode.