0

I have a problem with creating my own custom theme. I'm new to doing this and my elisp knowledge is minimal.

I've used the customise-create-theme option and it was working well but it seems that at some point something went wrong.

When choosing the created theme in customise-themes the checkbox doesn't get selected (yet the theme's older version gets activated) and I get such a message:

set-face-attribute: Invalid face underline: :color, nil, :style, nil 

I have no idea where the source of the bug is. The theme itself is modelled off the Mac novel terminal theme.

Here is my test-novel-theme.el file:

(deftheme test-novel
  "Created 2020-12-31.")

(custom-theme-set-faces
 'test-novel
 '(cursor ((t (:background "#3b2322"))))
 '(fixed-pitch ((t (:background "grey90" :family "Monospace"))))
 '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
 '(escape-glyph ((t (:foreground "grey75"))))
 '(minibuffer-prompt ((t (:foreground "grey30" :weight bold))))
 '(highlight ((t (:background "#747350" :foreground "#3b2322"))))
 '(region ((t (:background "#747350" :foreground "#3b2322"))))
 '(shadow ((t (:foreground "grey50"))))
 '(secondary-selection ((t (:background "aquamarine"))))
 '(trailing-whitespace ((t (:background "#f99"))))
 '(font-lock-builtin-face ((t (:foreground "gray57"))))
 '(font-lock-comment-delimiter-face ((t (:foreground "gray40"))))
 '(font-lock-comment-face ((t (:foreground "gray40"))))
 '(font-lock-constant-face ((t (:foreground "#5f9900"))))
 '(font-lock-doc-face ((t (:foreground "#f99"))))
 '(font-lock-function-name-face ((t (:foreground "RoyalBlue4"))))
 '(font-lock-keyword-face ((t (:foreground "magenta3" :weight normal))))
 '(font-lock-negation-char-face ((t nil)))
 '(font-lock-preprocessor-face ((t (:foreground "gold3"))))
 '(font-lock-regexp-grouping-backslash ((t (:foreground "gray60"))))
 '(font-lock-regexp-grouping-construct ((t (:weight normal))))
 '(font-lock-string-face ((t (:foreground "tan3"))))
 '(font-lock-type-face ((t (:foreground "#bc0000"))))
 '(font-lock-variable-name-face ((t (:foreground "#985321"))))
 '(font-lock-warning-face ((t (:foreground "peru" :weight semi-bold))))
 '(button ((t (:inherit (link)))))
 '(link ((((class color) (min-colors 88) (background light)) (:underline (:color foreground-color :style line) :foreground "RoyalBlue3")) (((class color) (background light)) (:underline (:color foreground-color :style line) :foreground "blue")) (((class color) (min-colors 88) (background dark)) (:underline (:color foreground-color :style line) :foreground "cyan1")) (((class color) (background dark)) (:underline (:color foreground-color :style line) :foreground "cyan")) (t (:inherit (underline)))))
 '(link-visited ((t (:underline (:color nil :style nil) :foreground "magenta4"))))
 '(fringe ((t (:background "#d5d1ba"))))
 '(header-line ((t (:inherit mode-line :background "Grey90" :foreground "grey1" :box nil))))
 '(tooltip ((((class color)) (:inherit (variable-pitch) :foreground "black" :background "lightyellow")) (t (:inherit (variable-pitch)))))
 '(mode-line ((t (:background "#b12512" :foreground "#dfdbc3" :box (:line-width 1 :color "gray40" :style released-button)))))
 '(mode-line-buffer-id ((t (:foreground "#dfdbc3" :weight bold))))
 '(mode-line-emphasis ((t (:weight bold))))
 '(mode-line-highlight ((t (:box (:line-width 2 :color "grey40" :style released-button)))))
 '(mode-line-inactive ((t (:background "gray95" :foreground "gray60" :box (:line-width 1 :color "gray60")))))
 '(isearch ((t (:background "LightSlateBlue" :foreground "black"))))
 '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
 '(lazy-highlight ((t (:foreground "white" :background "coral4"))))
 '(match ((t (:background "LightPink1"))))
 '(next-error ((t (:inherit (region)))))
 '(query-replace ((t (:inherit (isearch)))))
 '(default ((t (:stipple nil :background "#dfdbc3" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "nil" :family "Menlo")))))

(provide-theme 'test-novel)

I'd be glad if someone pointed out the hidden error somewhere there. I suspect it may be caused by some inheriting thing that is not working properly but I'm new to creating themes and my elisp knowledge is minimal.

edit: it seems I found the issue. The link-visited line contained such details provided for the underline:

(:underline (:color nil :style nil)

so no colour and style defined for the underline. Changing it to

(:underline (:color foreground-color :style line)

fixed the issue.

sorry for bothering

2
  • To me looks as the message claims; underline (not :underline) isn't defined at the end of link line. – Muihlinn Dec 31 '20 at 12:33
  • it seems you're right, thank you. at least if you meant what I think you meant. It seems the issue was with the link-visited line actually. There (for whatever reason) the underline is defined as (:underline (:color nil :style nil) so no colour and no line style provided for the underline. Changing it to (:underline (:color foreground-color :style line) fixed the issue. I'm not sure if that's what you meant but thank you for guiding me towards the link part – ggegoge Dec 31 '20 at 13:33

Your Answer

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

Browse other questions tagged or ask your own question.