/[emacs]/emacs/lisp/hilit-chg.el
ViewVC logotype

Diff of /emacs/lisp/hilit-chg.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by lute, Mon Jul 4 23:08:54 2005 UTC revision 1.33 by lektu, Fri Jul 22 02:20:29 2005 UTC
# Line 81  Line 81 
81  ;;  ;;
82  ;; Example usage:  ;; Example usage:
83  ;; (defun my-highlight-changes-enable-hook ()  ;; (defun my-highlight-changes-enable-hook ()
84  ;;   (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)  ;;   (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t)
85  ;; )  ;; )
86  ;;  ;;
87  ;; (defun my-highlight-changes-disable-hook ()  ;; (defun my-highlight-changes-disable-hook ()
88  ;;   (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)  ;;   (remove-hook 'write-file-functions 'highlight-changes-rotate-faces t)
89  ;; )  ;; )
90  ;;  ;;
91  ;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook)  ;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook)
# Line 213  Line 213 
213  ;; indentation on inserts gets underlined (which can look pretty ugly!).  ;; indentation on inserts gets underlined (which can look pretty ugly!).
214    
215  (defface highlight-changes  (defface highlight-changes
216    '((((min-colors 88) (class color)) (:foreground "red1" ))    '((((min-colors 88) (class color)) (:foreground "red1"))
217      (((class color)) (:foreground "red" ))      (((class color)) (:foreground "red" ))
218      (t (:inverse-video t)))      (t (:inverse-video t)))
219    "Face used for highlighting changes."    "Face used for highlighting changes."
# Line 270  This variable must be set to one of the Line 270  This variable must be set to one of the
270  (defcustom highlight-changes-global-initial-state 'passive  (defcustom highlight-changes-global-initial-state 'passive
271    "*What state `global-highlight-changes' should start in.    "*What state `global-highlight-changes' should start in.
272  This is used if `global-highlight-changes' is called with no argument.  This is used if `global-highlight-changes' is called with no argument.
273  This variable must be set to either `active' or `passive'"  This variable must be set to either `active' or `passive'."
274    :type '(choice (const :tag "Active" active)    :type '(choice (const :tag "Active" active)
275                   (const :tag "Passive" passive))                   (const :tag "Passive" passive))
276    :group 'highlight-changes)    :group 'highlight-changes)
# Line 302  A list means the elements are major mode Line 302  A list means the elements are major mode
302  Changes mode, or a list whose first element is `not' followed by major  Changes mode, or a list whose first element is `not' followed by major
303  modes which are not suitable.  modes which are not suitable.
304    
305  t means the buffer is suitable if it is visiting a file and its name  A value of t means the buffer is suitable if it is visiting a file and
306  does not begin with ` ' or `*'.  its name does not begin with ` ' or `*'.
307    
308  A value of nil means no buffers are suitable for `global-highlight-changes'  A value of nil means no buffers are suitable for `global-highlight-changes'
309  \(effectively disabling the mode).  \(effectively disabling the mode).
# Line 488  This is the opposite of `hilit-chg-displ Line 488  This is the opposite of `hilit-chg-displ
488    "Fix change overlays in region between BEG and END.    "Fix change overlays in region between BEG and END.
489    
490  Ensure the overlays agree with the changes as determined from  Ensure the overlays agree with the changes as determined from
491  the text properties of type `hilit-chg' ."  the text properties of type `hilit-chg'."
492    ;; Remove or alter overlays in region beg..end    ;; Remove or alter overlays in region beg..end
493    (let (ov-start ov-end  props q)    (let (ov-start ov-end  props q)
494      ;; temp for debugging:      ;; temp for debugging:
# Line 641  Functions: Line 641  Functions:
641  \\[highlight-changes-remove-highlight] - remove the change face from the region  \\[highlight-changes-remove-highlight] - remove the change face from the region
642  \\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \  \\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
643  through  through
644          various faces.          various faces
645    
646  Hook variables:  Hook variables:
647  `highlight-changes-enable-hook'  - when enabling Highlight Changes mode.  `highlight-changes-enable-hook'  - when enabling Highlight Changes mode
648  `highlight-changes-toggle-hook'  - when entering active or passive state  `highlight-changes-toggle-hook'  - when entering active or passive state
649  `highlight-changes-disable-hook' - when turning off Highlight Changes mode."  `highlight-changes-disable-hook' - when turning off Highlight Changes mode"
650    (interactive "P")    (interactive "P")
651    (if (or (display-color-p)    (if (or (display-color-p)
652            (and (fboundp 'x-display-grayscale-p) (x-display-grayscale-p)))            (and (fboundp 'x-display-grayscale-p) (x-display-grayscale-p)))
# Line 781  of `highlight-changes-face-list', one le Line 781  of `highlight-changes-face-list', one le
781  face described by the second element, and so on.  Very old changes remain  face described by the second element, and so on.  Very old changes remain
782  shown in the last face in the list.  shown in the last face in the list.
783    
784  You can automatically rotate colors when the buffer is saved  You can automatically rotate colors when the buffer is saved by adding
785  by adding the following to `local-write-file-hooks', by evaling it in the  this function to `write-file-functions' as a buffer-local value.  To do
786  buffer to be saved):  this, eval the following in the buffer to be saved:
787    
788    \(add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)"    \(add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t)"
789    (interactive)    (interactive)
790    ;; If not in active mode do nothing but don't complain because this    ;; If not in active mode do nothing but don't complain because this
791    ;; may be bound to a hook.    ;; may be bound to a hook.
# Line 800  buffer to be saved): Line 800  buffer to be saved):
800          ;; and display them all if active          ;; and display them all if active
801          (if (eq highlight-changes-mode 'active)          (if (eq highlight-changes-mode 'active)
802              (hilit-chg-display-changes))))              (hilit-chg-display-changes))))
803    ;; This always returns nil so it is safe to use in    ;; This always returns nil so it is safe to use in write-file-functions
   ;; local-write-file-hook  
804    nil)    nil)
805    
806  ;; ========================================================================  ;; ========================================================================
# Line 886  The default is the current buffer and th Line 885  The default is the current buffer and th
885  If either buffer is modified and is visiting a file, you are prompted  If either buffer is modified and is visiting a file, you are prompted
886  to save the file.  to save the file.
887    
888  Unless the buffer is unmodified and visiting a file,  the buffer is  Unless the buffer is unmodified and visiting a file, the buffer is
889  written to a temporary file for comparison.  written to a temporary file for comparison.
890    
891  If a buffer is read-only, differences will be highlighted but no property  If a buffer is read-only, differences will be highlighted but no property
# Line 1110  variable `highlight-changes-global-chang Line 1109  variable `highlight-changes-global-chang
1109    
1110  A buffer is appropriate for Highlight Changes mode if all these are true:  A buffer is appropriate for Highlight Changes mode if all these are true:
1111  - the buffer is not a special buffer (one whose name begins with  - the buffer is not a special buffer (one whose name begins with
1112    `*' or ` ')    `*' or ` '),
1113  - the buffer's mode is suitable as per variable  - the buffer's mode is suitable as per variable
1114    `highlight-changes-global-modes'    `highlight-changes-global-modes',
1115  - Highlight Changes mode is not already on for this buffer.  - Highlight Changes mode is not already on for this buffer.
1116    
1117  This function is called from `hilit-chg-update-all-buffers' or  This function is called from `hilit-chg-update-all-buffers' or

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26