I have installed leuven with melpa a while ago and updated it as of 31st of August 2019. I found out there is a dark version. How do I activate it at loading of Emacs? I have tried:

(add-to-list 'custom-theme-load-path " ~/.emacs.d/elpa/leuven-theme-20190831.1008/")
(load-theme 'leuven-dark t)

Note that (load-theme 'leuven t) works for the light version. I have tried comparing leuven-theme.el and leuven-dark-theme.el but could not find a clue about what I am doing wrong.

2 Answers 2


Add MELPA to your .emacs file

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)

Restart Emacs.

Refresh package database and install the leuven theme:

M-x package-refresh-contents
M-x package-install leuven-theme

Add this startup hook to your .emacs file

(add-hook 'emacs-startup-hook
  (lambda ()
    (load-theme 'leuven-dark)

Restart Emacs again. Confirm that you want to run this theme ( asked only at the first start ).

  • I had to explicitly update it within the list-packages framework. Anything I tried that circumvented that would go back to the older version of Leuven. Thank you for giving me essentially another push to look back at it :) Commented Dec 17, 2020 at 10:14
  • This is the only method that worked for me. ( Latest Emacs version on Windows 10. ) It's a nice theme anyway, so I tried everything until I found this solution. :)
    – user14685
    Commented Dec 18, 2020 at 12:22

It seems you have to load leuven first and then switch to leuven-dark.So first do

  (load-theme 'leuven t)

Then load leuven-dark via

   M-x load-theme <RET> leuven-dark <RET>

Doing M-x describe-variable <RET> custom-enabled-themes <RET> shows that 'leuven-dark' is now installed.

My installation is via

 git clone git://github.com/fniessen/emacs-leuven-theme.git

I assume the same applies if you use the package manager.

  • I tried this and still got the same error: "error: Unknown theme ‘leuven’ " Commented Oct 4, 2019 at 16:11
  • I've altered my answer as above. Seem to work.
    – user16762
    Commented Oct 5, 2019 at 9:46
  • still doesn't work for me with your updated answer :( Commented Oct 13, 2019 at 10:27
  • Are you using the package from (MELPA?) or from git? I don't use any packages from MELPA since over the years I've had numerous installation problems with them.
    – user16762
    Commented Oct 15, 2019 at 10:33
  • it was MELPA. But I tried to install it over git (first having uninstalled my MELPA version), following your advice. But still no success. Commented Nov 5, 2019 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.