;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Tue Aug 18 03:25:01 1998
;;; from file /gd/gnu/emacs/lisp/hilit-chg.el
;;; in Emacs version 20.2.98.3
;;; with bytecomp version 2.48
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`hilit-chg.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\301\302!\210\303\304\305\306\307%\210\310\311\312\313\304%\210\310\314\315\316\304%\207" [:group require wid-edit custom-declare-group highlight-changes nil "Highlight Changes mode." faces custom-declare-face highlight-changes-face ((((class color)) (:foreground "red")) (t (:inverse-video t))) "Face used for highlighting changes." highlight-changes-delete-face ((((class color)) (:foreground "red" :underline t)) (t (:inverse-video t))) "Face used for highlighting deletions."] 6)
#@414 *Colours used by `highlight-changes-rotate-faces'.
The newest rotated change will be displayed in the first element of this list, 
the next older will be in the second element etc.

This list is used if `highlight-changes-face-list' is nil,  otherwise that
variable overrides this list.   If you only care about foreground
colours then use this,  if you want fancier faces then set
`highlight-changes-face-list'.
(custom-declare-variable 'highlight-changes-colours '(if (eq (frame-parameter nil 'background-mode) 'light) '("magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue") '("yellow" "magenta" "blue" "maroon" "firebrick" "green4" "DarkOrchid")) '(#$ . -1106) :type '(repeat color) :group 'highlight-changes)
#@207 *What state (active or passive) `highlight-changes' should start in.
This is used when `highlight-changes' is called with no argument.
This variable must be set to one of the symbols `active' or `passive'.
(custom-declare-variable 'highlight-changes-initial-state ''active '(#$ . -1835) :type '(choice (const :tag "Active" active) (const :tag "Passive" passive)) :group 'highlight-changes)
#@186 *What state `global-highlight-changes' should start in.
This is used if `global-highlight-changes' is called with no argument.
This variable must be set to either `active' or `passive'
(custom-declare-variable 'highlight-changes-global-initial-state ''passive '(#$ . -2232) :type '(choice (const :tag "Active" active) (const :tag "Passive" passive)) :group 'highlight-changes)
#@163 *The string used when Highlight Changes mode is in the active state.
This should be set to nil if no indication is desired,  or to
a string with a leading space.
(custom-declare-variable 'highlight-changes-active-string 'nil '(#$ . -2616) :type '(choice string (const :tag "None" nil)) :group 'highlight-changes)
#@164 *The string used when Highlight Changes mode is in the passive state.
This should be set to nil if no indication is desired,  or to
a string with a leading space.
(custom-declare-variable 'highlight-changes-passive-string '" Chg" '(#$ . -2936) :type '(choice string (const :tag "None" nil)) :group 'highlight-changes)
#@628 *Determine whether a buffer is suitable for global Highlight Changes mode.

A function means that function is called:  if it returns non-nil the
buffer is suitable.

A list is a list of modes for which it is suitable,  or a list whose
first element is 'not followed by modes which are not suitable.

t means the buffer is suitable if its name does not begin with ` ' nor
`*' and the buffer has a filename.

nil means no buffers are suitable for `global-highlight-changes'
(effectively disabling the mode).

Examples:
        (c-mode c++-mode)
means that Highlight Changes mode is turned on for buffers in C and C++
modes only.
(custom-declare-variable 'highlight-changes-global-modes 't '(#$ . -3261) :type '(choice (const :tag "all non-special buffers visiting files" t) (set :menu-tag "specific modes" :tag "modes" :value (not) (const :tag "All except these" not) (repeat :tag "Modes" :inline t (symbol :tag "mode"))) (function :menu-tag "determined by function" :value buffer-file-name) (const :tag "none" nil)) :group 'highlight-changes)
(byte-code "\302\300!\204 \303\300	B\303\207" [global-highlight-changes current-load-list boundp nil] 2)
#@399 *If non-nil toggling global Highlight Changes mode affects existing buffers.
Normally, `global-highlight-changes' means affects only new buffers (to be
created).  However, if highlight-changes-global-changes-existing-buffers
is non-nil then turning on `global-highlight-changes' will turn on
highlight-changes-mode in suitable buffers and turning the mode off will
remove it from existing buffers.
(custom-declare-variable 'highlight-changes-global-changes-existing-buffers 'nil '(#$ . -4418) :type 'boolean :group 'highlight-changes)
(defalias 'hilit-chg-cust-fix-changes-face-list #[(w wc &optional event) "\306!\307	\235\203c \310	!	G\311\211\211\211\203R @\312\313\314\"!\f=\204@ \307=\203; \315\316\f\"\210\202@ \315\f\"\210\317\fC\n\"SA\211\204 \n\306!\232\204b \320\n\"\210\321 \210-)\322\"\211\205x \323$)\207" [w old-list new-list old-name new-name n widget-value default reverse nil intern format "highlight-changes-face-%d" copy-face highlight-changes-face append widget-value-set widget-setup widget-get widget-apply p :parent parent :notify event] 6])
#@431 *A list of faces used when rotatating changes.
Normally the variable is initialized to nil and the list is created from
`highlight-changes-colours' when needed.  However, you can set this variable
to any list of faces.  You will have to do this if you want faces which
don't just differ from `highlight-changes-face' by the foreground colour.
Otherwise, this list will be constructed when needed from
`highlight-changes-colours'.
(custom-declare-variable 'highlight-changes-face-list 'nil '(#$ . -5528) :type '(choice (repeat :notify hilit-chg-cust-fix-changes-face-list face) (const :tag "Derive from highlight-changes-colours" nil)) :group 'highlight-changes)
(byte-code "\305\300!\204 \306\300	B\305\302!\204 \306\302	B\305\303!\204  \307\303	B\300\f\236\204. \310\fB\311\300!\210\311\303!\210\312	B\313\314\315\"\210\313\316\315\"\210\313\317\315\"\210\313\320\315\"\210\313\321\315\"\210\313\322\315\"\207" [highlight-changes-mode current-load-list hilit-chg-list hilit-chg-string minor-mode-alist boundp nil " ??" (highlight-changes-mode hilit-chg-string) make-variable-buffer-local ediff-number-of-differences autoload ediff-setup "ediff" ediff-with-current-buffer ediff-really-quit ediff-make-fine-diffs ediff-get-fine-diff-vector ediff-get-difference] 3)
#@68 Call function FUNC for each region used by Highlight Changes mode.
(defalias 'hilit-chg-map-changes #[(func &optional start-position end-position) "\206 e	\206\n d\306\211\211\205< \fW\205< \307\310\"\311\f\310$\2035 \n\n\2063 \f#\210\n\211\204 \306,\207" [start-position end-position end prop limit start nil get-text-property hilit-chg text-property-not-all func] 6 (#$ . 6808)])
#@209 Display face information for Highlight Changes mode.

An overlay containing a change face is added,  from the information
in the text property of type change.

This is the opposite of hilit-chg-hide-changes.
(defalias 'hilit-chg-display-changes #[(&optional beg end) "\302\303	#\207" [beg end hilit-chg-map-changes hilit-chg-make-ov] 4 (#$ . 7215)])
(defalias 'hilit-chg-make-ov #[(prop start end) "\306	\"\307\f\204 \310\311!\210\f\312=\203 \313\202  \f\235A@\n\2038 \314\302\n#\210\314\315\316#\210\314\317\316#\202< \310\320\f\"*\207" [start end face ov prop hilit-chg-list make-overlay nil error "hilit-chg-make-ov: prop is nil" hilit-chg-delete highlight-changes-delete-face overlay-put evaporate t hilit-chg "hilit-chg-make-ov: no face for prop: %s"] 4])
#@220 Remove face information for Highlight Changes mode.

The overlay containing the face is removed,  but the text property
containing the change information is retained.

This is the opposite of hilit-chg-display-changes.
(defalias 'hilit-chg-hide-changes #[(&optional beg end) "\206 e	\206\n d\306\211\307\f\"\211\205. \310@\311\"\203& \312@!\210A\211\204 \306,\207" [beg end ov p limit start nil overlays-in overlay-get hilit-chg delete-overlay] 5 (#$ . 7995)])
#@148 Fix change overlays in region beg .. end.

Ensure the overlays agree with the changes as determined from
the text properties of type `hilit-chg' .
(defalias 'hilit-chg-fixup #[(beg end) "\306\211\211\211\211\211\307\"\211\203u @\310\f!\311\f!W\203Y \312\f#\210\nV\203n \313\f!\314\n\"	\203n \315\f	@	A@#\210	AA\211\204E \202n \nV\203j \312\f\n#\210\202n \316\f!\210A\211\204 \317\".\207" [q props ov-end ov-start ov p nil overlays-in overlay-start overlay-end move-overlay overlay-properties make-overlay overlay-put delete-overlay hilit-chg-display-changes beg end] 7 (#$ . 8476)])
#@119 Remove the change face from the region.  
This allows you to manually remove highlighting from uninteresting changes.
(defalias 'highlight-changes-remove-highlight #[(beg end) "\303\304	\n\305#\210\306	\n\")\207" [after-change-functions beg end nil remove-text-properties (hilit-chg nil) hilit-chg-fixup] 4 (#$ . 9106) "r"])
#@140 Record changes and optionally display them in a distinctive face.
`hilit-chg-set' adds this function to the `after-change-functions' hook.
(defalias 'hilit-chg-set-face-on-change #[(beg end leng-before &optional no-proerty-change) "\306 \307\216\310\211\311\312\203! \313=\205\210 \314\"\202\210 U\203= \315V\203= \\d^\316\202g \317\311\"\316=\203g \320\211T\321#\210\322\211T\311\211$\210\313=\203g \314T\"\210\204u \322\311\n$\210\313=\204\201 \205\210 \323\n#.\207" [save-match-data-internal old type end-incr beg-decr undo-in-progress match-data ((set-match-data save-match-data-internal)) 1 hilit-chg nil active hilit-chg-fixup 0 hilit-chg-delete get-text-property remove-text-properties (hilit-chg nil) put-text-property hilit-chg-make-ov highlight-changes-mode beg end leng-before no-proerty-change] 5 (#$ . 9439)])
#@49 Turn on Highlight Changes mode for this buffer.
(defalias 'hilit-chg-set #[(value) "\306\307\310\311#\210\312 \210	\313=\203 \n\f\204& \314 \210\202& \f\204& \315 \210\316 \210\317\307!\210\320\307\310\321\311$\207" [value highlight-changes-mode highlight-changes-active-string hilit-chg-string buffer-read-only highlight-changes-passive-string remove-hook after-change-functions hilit-chg-set-face-on-change t hilit-chg-make-list active hilit-chg-display-changes hilit-chg-hide-changes force-mode-line-update make-local-hook add-hook nil] 5 (#$ . 10319)])
#@91 Remove Highlight Changes mode for this buffer.
This removes all saved change information.
(defalias 'hilit-chg-clear #[nil "\203\n \303\304\305 \"\207\306\301\307\310#\210\311\312 \210\313\314!\210)\311\315 \210\306\316\317\"\207" [buffer-read-only after-change-functions highlight-changes-mode message "Cannot remove highlighting from read-only mode buffer %s" buffer-name remove-hook hilit-chg-set-face-on-change t nil hilit-chg-hide-changes hilit-chg-map-changes (lambda (prop start stop) (remove-text-properties start stop '(hilit-chg nil))) force-mode-line-update post-command-hook hilit-chg-post-command-hook] 4 (#$ . 10888)])
#@1318 Toggle (or initially set) Highlight Changes mode.

Without an argument,  
  if Highlight Changes mode is not enabled, then enable it (to either active
  or passive as determined by variable highlight-changes-initial-state);
  otherwise, toggle between active and passive states.

With an argument,
  if just C-u  or  a positive argument,  set state to active;
  with a zero argument,  set state to passive;
  with a negative argument,  disable Highlight Changes mode completely.

Active state -  means changes are shown in a distinctive face.
Passive state - means changes are kept and new ones recorded but are
		not displayed in a different face.

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-changes-remove-highlight] - remove the change face from the region
\[highlight-changes-rotate-faces] - rotate different "ages" of changes through 
	various faces.


Hook variables:
highlight-changes-enable-hook - when Highlight Changes mode enabled.
highlight-changes-toggle-hook - when entering active or passive state
highlight-changes-disable-hook - when turning off Highlight Changes mode.

(defalias 'highlight-changes-mode #[(&optional arg) "\203l 	\n\204 	\203 	\306=\203 \307\202L \306\202L \202L \n\306=\203) \306\202L \n\307=\2033 \307\202L \310\n!\311V\203? \306\202L \310\n!\311W\203K \312\202L \307\f\203d \313\f!\210\204^ \314\315!\210\314\316!\202j \314\317!\210\320 *\207\321\322!\207" [window-system highlight-changes-mode arg highlight-changes-initial-state new-highlight-changes-mode was-on active passive prefix-numeric-value 0 nil hilit-chg-set run-hooks highlight-changes-enable-hook highlight-changes-toggle-hook highlight-changes-disable-hook hilit-chg-clear message "Highlight Changes mode only works when using a window system"] 3 (#$ . 11532) "P"])
#@73 Move to the beginning of the next change, if in Highlight Changes mode.
(defalias 'highlight-changes-next-change #[nil "\203- `\303\304`\305\"\211\203 \306`\305\"\n\203 \306\n\305\"\n\203( \nb\202+ \307\310!*\207\307\311!\207" [highlight-changes-mode prop start nil get-text-property hilit-chg next-single-property-change message "no next change" "This buffer is not in Highlight Changes mode."] 4 (#$ . 13544) nil])
#@77 Move to the beginning of the previous change, if in Highlight Changes mode.
(defalias 'highlight-changes-previous-change #[nil "\203F `\303o\204 \304`S\305\"	\203 \306`\305\"\n\203$ \306\n\305\"\n\2038 \306\n\305\"\2067 \304e\305\"\2057 e\n\203A \nb\202D \307\310!*\207\307\311!\207" [highlight-changes-mode prop start nil get-text-property hilit-chg previous-single-property-change message "no previous change" "This buffer is not in Highlight Changes mode."] 3 (#$ . 13975) nil])
#@59 Construct hilit-chg-list and highlight-changes-face-list.
(defalias 'hilit-chg-make-list #[(&optional force) "\203 	\2036 \n\306\307\307\2035 \310\311\312\f\"!\313\314\"\210\315@\"\210\316C\"A\fT\202 +\317\314D\306\307\211\203i \310\311\320\f\"!@\316D\"A\fT\202E \316D\"\211,\207" [highlight-changes-face-list force highlight-changes-colours name n p 1 nil intern format "highlight-changes-face-%d" copy-face highlight-changes-face set-face-foreground append hilit-chg "change-%d" hilit-chg-list last-face last-category] 4 (#$ . 14472)])
#@74 Increment (age) the Highlight Changes mode text property of type change.
(defalias 'hilit-chg-bump-change #[(prop start end) "\305	\306=\203 \307\n8\202 \307	\n\2358	\203\" \310\f\311$\202( \312\313\f	$)\207" [new-prop prop hilit-chg-list start end nil hilit-chg-delete 2 put-text-property hilit-chg message "%d-%d unknown property %s not changed"] 5 (#$ . 15068)])
#@527 Rotate the faces used by Highlight Changes mode.

Current changes will be display in the face described by the first element
of highlight-changes-face-list, those (older) changes will be shown in the
face described by the second element, and so on.  Very old changes remain
shown in the last face in the list.

You can automatically rotate colours when the buffer is saved
by adding this to local-write-file-hooks,  by evaling (in the
buffer to be saved):
  (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)

(defalias 'highlight-changes-rotate-faces #[nil "\302=\203 \303\304 \210\305 \210\306\307!\210\302=\203 \310 \210)\303\207" [highlight-changes-mode after-change-functions active nil hilit-chg-make-list hilit-chg-hide-changes hilit-chg-map-changes hilit-chg-bump-change hilit-chg-display-changes] 2 (#$ . 15449) nil])
#@573 Compare this buffer with a file.

The current buffer must be an unmodified buffer visiting a file,
and not in read-only mode.

If the backup filename exists, it is used as the default
when called interactively.

If a buffer is visiting the file being compared against,  it also will
have its differences highlighted.   Otherwise, the file is read in
temporarily but the buffer is deleted.

If a buffer is read-only,  differences will be highlighted but no property
changes made,  so \[highlight-changes-next-change] and
\[highlight-changes-previous-change] will not work.
(defalias 'compare-with-file #[(file-b) "p	`\306 \307!\211\206 \310!rq\210	)\311\311\311\311\311 \311!\311\"\311#\311$\311%\311&\312!\203[ \313\314\315\f\"!\203W \316!\210\202[ \317\320!\210\203| \312!\203| \313\314\315\"!\203x \316!\210\202| \317\321!\210\322\323!\210\203\217 rq\210\322\323!\210)\324\213\210@\211A@\211 \325 \210\203\n@@!@A@\" @@$ @A@%\"!Z#%$Z&q\210\326!\"&\n$\210\327\311!\210b\210\203\375 rq\210\326$%#$\210)A A \202\246 \203\327\311!\202\330!.\207" [buf-a buffer-read-only buf-a-read-only orig-pos file-a file-b buffer-file-name get-file-buffer find-file-noselect nil buffer-modified-p y-or-n-p format "OK to save %s?  " save-buffer error "Buffer must be saved before comparing with a file." "Cannot compare with a file in an unsaved buffer." highlight-changes-mode active ((byte-code "\305	\n$\305\207" [buf-a file-a buf-b file-b xy hilit-chg-get-diff-info] 5)) hilit-chg-make-list hilit-chg-set-face-on-change set-buffer-modified-p kill-buffer existing-buf buf-b buf-b-read-only xy xx yy p q a-start a-end len-a b-start b-end len-b] 6 (#$ . 16304) (list (read-file-name "File to compare with? " "" nil 'yes (let ((f (make-backup-file-name (or (buffer-file-name (current-buffer)) (error "no file for this buffer"))))) (if (file-exists-p f) f ""))))])
(defalias 'hilit-chg-get-diff-info #[(buf-a file-a buf-b file-b) "\306\211\211\307\f\306\211\310\311\312BC&\210\n\2034 \313\n!\2034 \314\313\n!!\2034 r\nq\210\315\306!\210)\202@ \316=\204@ \317!\210	+D\207" [y x e buf-a file-a buf-b nil ediff-setup hilit-chg-get-diff-list-hk ediff-job-name something get-buffer buffer-name ediff-really-quit ediff-quit error file-b this-command ediff-KILLED-VITAL-BUFFER] 10])
(defalias 'hilit-chg-get-diff-list-hk #[nil "\306B\307Bp\310\311\211\211\211\211\211\311\311W\205\371 \312!\210\313\314\"A*JH\315H\211\203P \316\311\"\202i \313\314\"A*JH\211\310\234C\203\217 \317@!\320@!DA\316C\"\202l \321\314\"A*JH\315H\211\203\261 \316\f\311\"\202\312 \321\314\"A*JH\211\310\234C\n\203\360 \317@!\320@!DA\316C\"\202\315 T\211\202# .\207" [current-load-list e b a vb va x y 0 nil ediff-make-fine-diffs A assoc 1 append overlay-start overlay-end B p extent n ediff-number-of-differences ediff-difference-vector-alist alist buf-type] 8])
(defalias 'hilit-chg-major-mode-hook #[nil "\300\301\302\"\207" [add-hook post-command-hook hilit-chg-post-command-hook] 3])
(defalias 'hilit-chg-post-command-hook #[nil "\302\303\304 \"?\205 \305\306\307\"\210\206 \310	!\207" [highlight-changes-mode highlight-changes-global-initial-state string-match "^[ *]" buffer-name remove-hook post-command-hook hilit-chg-post-command-hook hilit-chg-turn-on-maybe] 3])
(defalias 'hilit-chg-check-global #[nil "\301!\207" [highlight-changes-global-initial-state hilit-chg-turn-on-maybe] 2])
#@815 Turn on or off global Highlight Changes mode.

When called interactively:
- if no prefix, toggle global Highlight Changes mode on or off
- if called with a positive prefix (or just C-u) turn it on in active mode
- if called with a zero prefix  turn it on in passive mode
- if called with a negative prefix turn it off

When called from a program:
- if ARG is nil or omitted, turn it off
- if ARG is 'active,  turn it on in active mode
- if ARG is 'passive, turn it on in passive mode
- otherwise just turn it on 

When global Highlight Changes mode is enabled, Highlight Changes mode is turned
on for future "suitable" buffers (and for "suitable" existing buffers if
variable `highlight-changes-global-changes-existing-buffers' is non-nil).
"Suitablity" is determined by variable `highlight-changes-global-modes'.
(defalias 'global-highlight-changes #[(&optional arg) "\2030 \304=\203 \304\202 \305=\203 \305\306\307\310	\"\210\311\312\211\"\210\311\313\314\"\210\205O \315	!\207\307\316!\210\317\312\211\"\210\317\313\314\"\210\317\320\321\"\210\317\313\314\"\210\205O \315\322!\207" [arg highlight-changes-global-initial-state global-highlight-changes highlight-changes-global-changes-existing-buffers active passive t message "turning ON Global Highlight Changes mode in %s state" add-hook hilit-chg-major-mode-hook find-file-hooks hilit-chg-check-global hilit-chg-update-all-buffers "turning OFF global Highlight Changes mode" remove-hook post-command-hook hilit-chg-post-command-hook nil] 3 (#$ . 19904) (list (cond ((null current-prefix-arg) (setq global-highlight-changes (not global-highlight-changes))) ((> (prefix-numeric-value current-prefix-arg) 0) (setq global-highlight-changes t) 'active) ((= (prefix-numeric-value current-prefix-arg) 0) (setq global-highlight-changes t) 'passive) (t (setq global-highlight-changes nil) nil)))])
#@504 Turn on Highlight Changes mode if it is appropriate for this buffer.

A buffer is appropriate for Highlight Changes mode if all these are true:
- the buffer is not a special buffer (one whose name begins with 
  `*' or ` ')
- the buffer's mode is suitable as per variable highlight-changes-global-modes
- Highlight Changes mode is not already on for this buffer.

This function is called from hilit-chg-update-all-buffers 
from `global-highlight-changes' when turning on global Highlight Changes mode.

(defalias 'hilit-chg-turn-on-maybe #[(value) "\206D 	\204\n \304\207\305	!\203 	 \202: 	<\203/ 	\242\306=\203) \n	A>?\202: \n	>\202: \307\310\311 \"?\205D \312 \205D \313!\210\314\315!\207" [highlight-changes-mode highlight-changes-global-modes major-mode value nil functionp not string-match "^[ *]" buffer-name buffer-file-name hilit-chg-set run-hooks highlight-changes-enable-hook] 3 (#$ . 21767)])
(defalias 'hilit-chg-turn-off-maybe #[nil "\205\n \301\302!\210\303 \207" [highlight-changes-mode run-hooks highlight-changes-disable-hook hilit-chg-clear] 2])
(defalias 'hilit-chg-update-all-buffers #[(value) "\300\301\302 \"\207" [mapcar #[(buffer) "rq\210	\203 \302	!\202 \303 )\207" [buffer value hilit-chg-turn-on-maybe hilit-chg-turn-off-maybe] 2] buffer-list] 3])
(provide 'hilit-chg)
