3

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 Answers2

1

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)
(package-initialize)

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 :) – Gabriel Bénédict Dec 17 '20 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. :) –  Dec 18 '20 at 12:22
0

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.