# HG changeset patch # User Lars Hansen # Date 1123702772 0 # Node ID bde8cc177550902b1e911712b93f107e6226c3f8 # Parent aee8ba4e5b1ab16a7dee11bb5fd52d7cdbf7a116 Add handler to desktop-minor-mode-handlers. (hilit-chg-desktop-restore): New function. (highlight-changes-mode): Add highlight-changes-mode to desktop-locals-to-save. diff -r aee8ba4e5b1a -r bde8cc177550 lisp/hilit-chg.el --- a/lisp/hilit-chg.el Wed Aug 10 19:39:16 2005 +0000 +++ b/lisp/hilit-chg.el Wed Aug 10 19:39:32 2005 +0000 @@ -673,6 +673,7 @@ (if new-highlight-changes-mode ;; mode is turned on -- but may be passive (progn + (add-to-list 'desktop-locals-to-save 'highlight-changes-mode) (hilit-chg-set new-highlight-changes-mode) (or was-on ;; run highlight-changes-enable-hook once @@ -1154,6 +1155,16 @@ ))) (buffer-list))) +;;;; Desktop support. + +;; Called by `desktop-create-buffer' to restore `highlight-changes-mode'. +(defun hilit-chg-desktop-restore (desktop-buffer-locals) + (highlight-changes-mode + (or (cdr (assq 'highlight-changes-mode desktop-buffer-locals)) 1))) + +(add-to-list 'desktop-minor-mode-handlers + '(highlight-changes-mode . hilit-chg-desktop-restore)) + ;; ===================== debug ================== ;; For debug & test use: ;;