1

I'm seeing the following issue with emacs 25.

I'm confident there must be a workaround for this because I'm in the process of rewriting my emacs configuration, and my old, ugly configuration with the same version of emacs does not have this problem. Still, while with some effort I've been able to create a minimal failing case (see below), I've not yet been able to create a minimal working case.

Can anybody guess a workaround? I suspect the problem is related to the fact that monokai-theme configures the whitespace-space face with some custom elisp.

(By the way, I'd like to report this as a bug but I'm not sure if it's a monokai-theme issue or an emacs issue: any pointers there?)

customize-face and monokai-theme don't seem to be getting along for me with emacs 25:

  • Create ~/.emacs.d/init.el as quoted below and ensure no ~/.emacs exists
  • Ensure ~/.emacs.d/custom-settings.el does not exist
  • Start emacs (I'm using the daily emacs 25 snapshots from https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa on ubuntu xenial)
  • Open init.el
  • M-x customize-face <RET> whitespace-space <RET>
  • Edit foreground colour and "Save for future sessions" (I had to edit the colour in monokai-theme's lisp code to do this: that lisp code appears in the customize UI)
  • All good in custom-settings.el: my customization appears there
  • Quit emacs
  • Start emacs
  • No errors in Messages (and custom-settings.el is unchanged), but whitespace-space text now looks the way it did before I customized it, so...
  • M-x customize-face <RET> whitespace-space <RET>
  • Edit foreground colour and "Save for future sessions" (this time, the foreground colour appears in the UI explicitly and the lisp code is gone)
  • This time customize reports state "THEMED"
  • init.el buffer STILL lacks my customization
  • On "Save for future sessions", custom-settings.el was reset to an empty state (and no I didn't hand edit it!)

here is the "empty state" custom-settings.el I refer to above:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

and here's the init.el:

(require 'package)
(setq package-enable-at-startup nil)
(setq custom-file (concat user-emacs-directory "custom-settings.el"))
(load custom-file t)
(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
        ("melpa" . "http://melpa.org/packages/")))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(setq use-package-verbose t)
(setq use-package-always-ensure t)
(require 'use-package)

(use-package monokai-theme)

(use-package whitespace
  :init
  (global-whitespace-mode 1))
  • By the way, I tried manually creating a custom-settings.el, but have not been able to work around the problem that way – Croad Langshan Jun 21 '16 at 21:03
  • I also tried using the option in customize-face to wipe out the existing whitespace-space customization (and then set the foreground colour again), but I wasn't able to work around it that way either – Croad Langshan Jun 21 '16 at 21:06
1

In the end I worked around this with this code in the :config section in the use-package declaration for whitespace:

(set-face-attribute 'whitespace-space nil :foreground "#272822")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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