doomemacs / themes

A megapack of themes for GNU Emacs.
MIT License
2.18k stars 396 forks source link

doom-Iosvkem breaks counsel commands in an urxvt terminal. #276

Closed AmaiKinono closed 5 years ago

AmaiKinono commented 5 years ago

If loading the doom-Iosvkem theme in init.el, any counsel commands will throw an error says Wrong number of arguments: (3 . 4), 0. This only happens when using Emacs in an urxvt terminal, it's totally fine in xterm, in a text tty, or in the GUI version. Other themes seem work well, though I didn't test them all.

This is super weird, but it do happens to me. So I created a minimal init.el for you to reproduce the problem:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

;; Maybe you have to run `package-refresh-contents' once manually.

(package-install 'doom-themes)
(package-install 'counsel)

(require 'doom-themes)
(load-theme 'doom-Iosvkem t)

(require 'counsel)
(global-set-key (kbd "M-x") 'counsel-M-x)

Run emacs -nw in urxvt, there will be a warning says:

`Wrong number of arguments: (3 . 4), 0

and M-x runs execute-extended-command, not counsel-M-x. If you run any counsel command, the same error shows in the echo area. But if you load 'doom-one, not 'doom-Iosvkem, everything will work fine.

hlissner commented 5 years ago

I cannot reproduce this error. Could you create a backtrace from this error? E.g. running Emacs with --debug-init.

Side note: the author of doom-iosvkem has asked me to remove the theme, so the theme will be removed next week.

AmaiKinono commented 5 years ago

Sure. Here's it:

Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 0)
  color-rgb-to-hex()
  apply(color-rgb-to-hex nil)
  colir-blend(nil (1.0 1.0 1.0))
  #f(compiled-function (f1 f2) #<bytecode 0x4c4b69>)(swiper-match-face-1 swiper-background-match-face-1)
  cl-mapc(#f(compiled-function (f1 f2) #<bytecode 0x4c4b69>) (swiper-match-face-1 swiper-match-face-2 swiper-match-face-3 swiper-match-face-4) (swiper-background-match-face-1 swiper-background-match-face-2 swiper-background-match-face-3 swiper-background-match-face-4))
  swiper--recompute-background-faces()
  byte-code("\300 \210\301\302\303\304\305DD\306\307\310%\210\301\311\303\304\312DD\313\307\314\315\316&\007\210\301\317\303\304\320DD\321\307\314\315\316&\007\207" [swiper--recompute-background-faces custom-declare-variable swiper-min-highlight funcall function #f(compiled-function () #<bytecode 0x4c4b91>) "Only highlight matches for regexps at least this long." :type integer swiper-include-line-number-in-search #f(compiled-function () #<bytecode 0x4c4b9d>) "Include line number in text of search candidates." boolean :group swiper swiper-goto-start-of-match #f(compiled-function () #<bytecode 0x4c4ba9>) "When non-nil, go to the start of the match, not its end."] 8)
  require(swiper)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\007\210\314\315\316\306#\210\317\211\203?\0\211@\315\001N\2038\0\316\001N\2048\0\320\316\002\315\004N#\210\001A\266\202\202\036\0\210\321\315\316\322#\210\323\324\325\306#\210\326\324\325\322#\207" [require swiper compile dired custom-declare-group counsel nil "Completion functions using Ivy." :group matching :prefix "counsel-" defvaralias counsel-more-chars-alist ivy-more-chars-alist (saved-value saved-variable-comment) put make-obsolete-variable "0.10.0" defalias counsel-more-chars ivy-more-chars make-obsolete] 8)
  require(counsel)
  eval-buffer(#<buffer  *load*> nil "/home/kino/.emacs.d/init.el" nil t)  ; Reading at buffer position 538
  load-with-code-conversion("/home/kino/.emacs.d/init.el" "/home/kino/.emacs.d/init.el" t t)
  load("/home/kino/.emacs.d/init" t t)
  #f(compiled-function () #<bytecode 0x1df989>)()
  command-line()
  normal-top-level()
Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 0)
  color-rgb-to-hex()
  apply(color-rgb-to-hex nil)
  colir-blend(nil (1.0 1.0 1.0))
  #f(compiled-function (f1 f2) #<bytecode 0x4c4b69>)(swiper-match-face-1 swiper-background-match-face-1)
  cl-mapc(#f(compiled-function (f1 f2) #<bytecode 0x4c4b69>) (swiper-match-face-1 swiper-match-face-2 swiper-match-face-3 swiper-match-face-4) (swiper-background-match-face-1 swiper-background-match-face-2 swiper-background-match-face-3 swiper-background-match-face-4))
  swiper--recompute-background-faces()
  byte-code("\300 \210\301\302\303\304\305DD\306\307\310%\210\301\311\303\304\312DD\313\307\314\315\316&\007\210\301\317\303\304\320DD\321\307\314\315\316&\007\207" [swiper--recompute-background-faces custom-declare-variable swiper-min-highlight funcall function #f(compiled-function () #<bytecode 0x4c4b91>) "Only highlight matches for regexps at least this long." :type integer swiper-include-line-number-in-search #f(compiled-function () #<bytecode 0x4c4b9d>) "Include line number in text of search candidates." boolean :group swiper swiper-goto-start-of-match #f(compiled-function () #<bytecode 0x4c4ba9>) "When non-nil, go to the start of the match, not its end."] 8)
  require(swiper)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\007\210\314\315\316\306#\210\317\211\203?\0\211@\315\001N\2038\0\316\001N\2048\0\320\316\002\315\004N#\210\001A\266\202\202\036\0\210\321\315\316\322#\210\323\324\325\306#\210\326\324\325\322#\207" [require swiper compile dired custom-declare-group counsel nil "Completion functions using Ivy." :group matching :prefix "counsel-" defvaralias counsel-more-chars-alist ivy-more-chars-alist (saved-value saved-variable-comment) put make-obsolete-variable "0.10.0" defalias counsel-more-chars ivy-more-chars make-obsolete] 8)
  require(counsel)
  eval-buffer(#<buffer  *load*> nil "/home/kino/.emacs.d/init.el" nil t)  ; Reading at buffer position 538
  load-with-code-conversion("/home/kino/.emacs.d/init.el" "/home/kino/.emacs.d/init.el" t t)
  load("/home/kino/.emacs.d/init" t t)
  #f(compiled-function () #<bytecode 0x1df989>)()
  command-line()
  normal-top-level()
hlissner commented 5 years ago

It looks like swiper is trying to read the background off some faces that don't have a background. Are you somehow loading swiper before your theme?

AmaiKinono commented 5 years ago

I think no. As you can see I am testing using a very simple init.el, the only place I can think of for swiper to be load is (require 'counsel) since counsel depends on swiper, and this is after the theme was loaded. But you are right, it has something to do with swiper. I changed (require 'counsel) to (require 'swiper) and had the same error.

hlissner commented 5 years ago

I found the source of the error; a typo in doom-Iosevkm. e771d56 should resolve this issue. Let me know if that isn't the case!

AmaiKinono commented 5 years ago

Yes, that fixes it.

Unfortunately the theme itself will be gone from us anyway.