emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/hilit-chg.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/hilit-chg.el
Date: Thu, 24 Mar 2005 17:13:39 -0500

Index: emacs/lisp/hilit-chg.el
diff -c emacs/lisp/hilit-chg.el:1.26 emacs/lisp/hilit-chg.el:1.27
*** emacs/lisp/hilit-chg.el:1.26        Mon Jan 17 21:24:46 2005
--- emacs/lisp/hilit-chg.el     Thu Mar 24 22:13:39 2005
***************
*** 993,1004 ****
  
  ;; Global Highlight Changes mode is modeled after Global Font-lock mode.
  ;; Three hooks are used to gain control.  When Global Changes Mode is
! ;; enabled, `find-file-hooks' and `change-major-mode-hook' are set.
! ;; `find-file-hooks' is called when visiting a file, the new mode is
  ;; known at this time.
  ;; `change-major-mode-hook' is called when a buffer is changing mode.
  ;; This could be because of finding a file in which case
! ;; `find-file-hooks' has already been called and has done its work.
  ;; However, it also catches the case where a new mode is being set by
  ;; the user.  However, it is called from `kill-all-variables' and at
  ;; this time the mode is the old mode, which is not what we want.
--- 993,1004 ----
  
  ;; Global Highlight Changes mode is modeled after Global Font-lock mode.
  ;; Three hooks are used to gain control.  When Global Changes Mode is
! ;; enabled, `find-file-hook' and `change-major-mode-hook' are set.
! ;; `find-file-hook' is called when visiting a file, the new mode is
  ;; known at this time.
  ;; `change-major-mode-hook' is called when a buffer is changing mode.
  ;; This could be because of finding a file in which case
! ;; `find-file-hook' has already been called and has done its work.
  ;; However, it also catches the case where a new mode is being set by
  ;; the user.  However, it is called from `kill-all-variables' and at
  ;; this time the mode is the old mode, which is not what we want.
***************
*** 1080,1097 ****
        (setq global-highlight-changes t)
        (message "Turning ON Global Highlight Changes mode in %s state"
                 highlight-changes-global-initial-state)
!       (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
!       (add-hook 'find-file-hooks 'hilit-chg-check-global)
        (if highlight-changes-global-changes-existing-buffers
            (hilit-chg-update-all-buffers
             highlight-changes-global-initial-state)))
  
      (message "Turning OFF global Highlight Changes mode")
!     (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
!     (remove-hook 'find-file-hooks 'hilit-chg-check-global)
!     (remove-hook 'post-command-hook
!                'hilit-chg-post-command-hook)
!     (remove-hook 'find-file-hooks 'hilit-chg-check-global)
      (if highlight-changes-global-changes-existing-buffers
        (hilit-chg-update-all-buffers nil))))
  
--- 1080,1097 ----
        (setq global-highlight-changes t)
        (message "Turning ON Global Highlight Changes mode in %s state"
                 highlight-changes-global-initial-state)
!       ;; FIXME: Not sure what this was intended to do.  --Stef
!       ;; (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
!       (add-hook 'find-file-hook 'hilit-chg-check-global)
        (if highlight-changes-global-changes-existing-buffers
            (hilit-chg-update-all-buffers
             highlight-changes-global-initial-state)))
  
      (message "Turning OFF global Highlight Changes mode")
!     ;; FIXME: Not sure what this was intended to do.  --Stef
!     ;; (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
!     (remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
!     (remove-hook 'find-file-hook 'hilit-chg-check-global)
      (if highlight-changes-global-changes-existing-buffers
        (hilit-chg-update-all-buffers nil))))
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]