SHARE
TWEET

Untitled

a guest Mar 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defun my-set-theme-on-mode ()
  2.   (let* ((mode (cond
  3.                 ((memq major-mode '(clojure-mode clojurescript-mode))
  4.                  'zenburn)
  5.                 ((memq major-mode '(elisp-mode emacs-lisp-mode))
  6.                  'dracula)
  7.                 ((memq major-mode '(python-mode octave-mode))
  8.                  'solarized-dark)
  9.                 ((memq major-mode '(org-mode))
  10.                  'nord))))
  11.     (when mode
  12.       (load-theme mode))))
  13.  
  14. (defadvice switch-to-buffer (after activate)
  15.   (when buffer-file-name (my-set-theme-on-mode)))
  16. (defadvice other-window (after other-window-now activate)
  17.   (when buffer-file-name (my-set-theme-on-mode)))
  18. (defadvice other-frame (after other-frame-now activate)
  19.   (when buffer-file-name (my-set-theme-on-mode)))
  20.  
  21. (add-hook 'after-change-major-mode-hook 'my-set-theme-on-mode)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top