切换主题时要怎么做才能彻底切换

有时候想切换下主题,在原有的模式下切换,主题就会混在一起,很难受

这是德古拉和Tao theme结合的产物
有没有方法彻底切换??

可以用 disable-theme,把之前应用的主题禁用掉。

蟹蟹,终于好了

提供一个更好的自动化的办法。 使用我写的advice添加到你的配置文件里。

(defcustom load-theme-before-hook nil
  "Functions to run before load theme."
  :type 'hook)

(defcustom load-theme-after-hook nil
  "Functions to run after load theme."
  :type 'hook)

(defun load-theme-hook-wrapper (origin-func theme &rest args)
  "A wrapper of hooks around `load-theme'."
  (mapc #'disable-theme custom-enabled-themes)
  (run-hook-with-args 'load-theme-before-hook theme)
  (apply origin-func theme args)
  (run-hook-with-args 'load-theme-after-hook theme))

(advice-add 'load-theme :around #'load-theme-hook-wrapper)

这样你就不需要手动disable-theme了。

4 个赞

哟系,蟹蟹指点