make advice add work in old emacs versions.

This commit is contained in:
Ubuntu 2014-11-14 05:10:41 +00:00 committed by IvanMalison
parent 7be8a99428
commit aebc77996e

View File

@ -581,7 +581,14 @@ buffer is not visiting a file."
(set-my-font-for-frame nil) (set-my-font-for-frame nil)
(setq hl-line-mode nil)) (setq hl-line-mode nil))
(if (or
(and (>= emacs-major-version 24)
(>= emacs-minor-version 4))
(>= emacs-major-version 25))
(advice-add 'load-theme :after #'remove-fringe-and-hl-line-mode) (advice-add 'load-theme :after #'remove-fringe-and-hl-line-mode)
(defadvice load-theme (after name activate)
(remove-fringe-and-hl-line-mode)))
;; enable to set theme based on time of day. ;; enable to set theme based on time of day.
(run-at-time "00:00" 3600 'set-theme) (run-at-time "00:00" 3600 'set-theme)