Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacsclient broken on develop branch by commit 4562da2b5 #13766

Closed
jg-made opened this issue Jul 13, 2020 · 5 comments
Closed

emacsclient broken on develop branch by commit 4562da2b5 #13766

jg-made opened this issue Jul 13, 2020 · 5 comments

Comments

@jg-made
Copy link
Contributor

jg-made commented Jul 13, 2020

On latest develop branch, do this:

emacsclient -a '' -nqc .

to see this error:

Warning (initialization): An error occurred while loading ‘~/.emacs.d/init.el’:

Wrong type argument: number-or-marker-p, nil

I am quite sure the problem is somewhere in commit 4562da2 (I checked the commits before and after this).

@marienz
Copy link

marienz commented Jul 13, 2020

I just hit what I think is the same problem you're reporting. emacs --fg-daemon --debug-init prints:

(Spacemacs) + Configuring bootstrap packages...
(Spacemacs) evil -> pre-init (keyboard-layout)...
(Spacemacs) async -> init (spacemacs-bootstrap)...
(Spacemacs) bind-key -> init (spacemacs-bootstrap)...
(Spacemacs) bind-map -> init (spacemacs-bootstrap)...
(Spacemacs) diminish -> init (spacemacs-bootstrap)...
(Spacemacs) evil -> init (spacemacs-bootstrap)...
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  /(nil 256.0)
  (let* ((values (x-color-values color)) (r (/ (car values) 256.0)) (g (/ (car (cdr values)) 256.0)) (b (/ (car (cdr (cdr values))) 256.0))) (rainbow-color-luminance r g b))
  rainbow-x-color-luminance(nil)
  (> 0.5 (rainbow-x-color-luminance (face-background face)))
  (if (> 0.5 (rainbow-x-color-luminance (face-background face))) (face-background face) (face-foreground face))
  spacemacs/get-darker-color-of-face-fg-or-bg(mode-line)
  (cons (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line))
  (cons ':foreground (cons (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line)))
  (cons color (cons ':foreground (cons (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line))))
  (cons ':background (cons color (cons ':foreground (cons (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line)))))
  (backquote-list* ':background color ':foreground (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line))
  (list t (backquote-list* ':background color ':foreground (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line)))
  (list (list t (backquote-list* ':background color ':foreground (spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) '(:inherit 'mode-line))))
  `((t (:background ,color :foreground ,(spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) :inherit 'mode-line)))
  (custom-declare-face 'spacemacs-normal-face `((t (:background ,color :foreground ,(spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) :inherit 'mode-line))) (format "%s state face." state) :group 'spacemacs)
  (defface spacemacs-normal-face `((t (:background ,color :foreground ,(spacemacs/get-darker-color-of-face-fg-or-bg 'mode-line) :inherit 'mode-line))) (format "%s state face." state) :group 'spacemacs)
  eval((defface spacemacs-normal-face `((t (:background ,color :foreground ,(spacemacs/get-darker-color-of-face-fg-or-bg ...) :inherit 'mode-line))) (format "%s state face." state) :group 'spacemacs))
  spacemacs/define-evil-state-face("normal" "DarkGoldenrod2")
  spacemacs/add-evil-cursor("normal" "DarkGoldenrod2" box)
...
  (let* ((--cl-var-- spacemacs-evil-cursors) (state nil) (color nil) (shape nil) (--cl-var--)) (while (consp --cl-var--) (setq --cl-var-- (car --cl-var--) state (car-safe (prog1 --cl-var-- (setq --cl-var-- (cdr --cl-var--)))) color (car-safe (prog1 --cl-var-- (setq --cl-var-- (cdr --cl-var--)))) shape (car --cl-var--)) (spacemacs/add-evil-cursor state color shape) (setq --cl-var-- (cdr --cl-var--))) nil)
  spacemacs-bootstrap/init-evil()
  funcall(spacemacs-bootstrap/init-evil)
  (let* ((pkg-name (eieio-oref pkg ':name)) (owner (car (eieio-oref pkg ':owners)))) (spacemacs-buffer/message (format "%S -> init (%S)..." pkg-name owner)) (funcall (intern (format "%S/init-%S" owner pkg-name))))
  configuration-layer//configure-package(#<cfgl-package cfgl-package-93a3e0>)
  mapc(configuration-layer//configure-package (#<cfgl-package cfgl-package-939b20> #<cfgl-package cfgl-package-939f14> #<cfgl-package cfgl-package-930a5c> #<cfgl-package cfgl-package-93a17c> #<cfgl-package cfgl-package-93a3e0> #<cfgl-package cfgl-package-93af54> #<cfgl-package cfgl-package-93b1bc> #<cfgl-package cfgl-package-93b420>))
  (let (packages-to-configure) (let ((--dolist-tail-- packages) pkg-name) (while --dolist-tail-- (setq pkg-name (car --dolist-tail--)) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg ':lazy-install) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg ...) (not ...)) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg ...)) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (configuration-layer//package-reqs-used-p pkg)) (spacemacs-buffer/message (format ... pkg-name))) ((not (cfgl-package-enabled-p pkg)) (spacemacs-buffer/message (format "%S is disabled." pkg-name))) (t (let (...) (if dir ...)) (if (memq ... ...) nil (configuration-layer//activate-package pkg-name)) (cond (... ...) (t ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq packages-to-configure (reverse packages-to-configure)) (mapc 'configuration-layer//configure-package packages-to-configure) (mapc 'configuration-layer//post-configure-package packages-to-configure))
  configuration-layer//configure-packages-2((async bind-key bind-map diminish evil hydra use-package which-key))
  configuration-layer//configure-packages((abbrev ac-ispell ace-link ace-window add-node-modules-path aggressive-indent ansi-colors archive-mode async auto-compile auto-complete auto-highlight-symbol avy bind-key bind-map blacken bookmark bracketed-paste browse-at-remote cargo cc-mode clang-format clean-aindent-mode comint company company-box company-c-headers company-go company-lua company-quickhelp company-shell company-statistics company-web company-ycmd compile conf-mode counsel counsel-css counsel-projectile cperl-mode cpp-auto-include css-mode cython-mode dap-mode debug default-helm-config default-ivy-config default-org-config desktop devdocs ...))
  configuration-layer//load()
  (cond (changed-since-last-dump-p (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message "Layer list has changed since last dump.") (configuration-layer//dump-emacs)))) (spacemacs-force-dump (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message (concat "--force-dump passed on the command line, " "forcing a redump.")) (configuration-layer//dump-emacs)))) ((spacemacs-is-dumping-p) (configuration-layer//load)) ((and (spacemacs/emacs-with-pdumper-set-p) (spacemacs-run-from-dump-p)) (configuration-layer/message "Running from a dumped file. Skipping the loading p...")) (t (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message (concat "Layer list has not changed since last time. " "Skipping dumping process!"))))))
  configuration-layer/load()
  (let ((file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start)))))
  (if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %s or above.") emacs-version spacemacs-emacs-min-version) (let ((file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start))))))
  eval-buffer(#<buffer  *load*> nil "/home/marienz/.emacs.d/init.el" nil t)  ; Reading at buffer position 1880
  load-with-code-conversion("/home/marienz/.emacs.d/init.el" "/home/marienz/.emacs.d/init.el" t t)
  load("/home/marienz/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x3e6855>) #f(compiled-function () #<bytecode 0x3e686d>) t)
  command-line()
  normal-top-level()

With no commandline arguments or with -nw (no window system) Emacs starts normally.

This is failing in the code added by 4562da2. It looks like x-color-values returned nil, which it is documented to do "if FRAME cannot display COLOR". And we're running this before we have a frame, so it makes sense for it to return nil.

Maybe this code can use spacemacs|do-after-display-system-init?

@treymerkley
Copy link
Contributor

treymerkley commented Jul 13, 2020

Just tried that fix, running the daemon now returns:

Wrong type argument: stringp, ((lambda nil (if (> 0.5 (rainbow-x-color-luminance (face-background face))) (face-background face) (face-foreground face))) (lambda nil (kill-buffer (get-buffer spacemacs-buffer-name)) (spacemacs-buffer/goto-buffer)) (lambda nil (spacemacs-buffer/message Setting the font...) (if (spacemacs/set-default-font dotspacemacs-default-font) nil (spacemacs-buffer/warning Cannot find any of the specified fonts (%s)! Font settings may not be correct. (if (listp (car dotspacemacs-default-font)) (mapconcat (quote car) dotspacemacs-default-font , ) (car dotspacemacs-default-font))))) (lambda nil (load-theme (quote spacemacs-light) t)))

EDIT: obligatory link to the issue that requested this feature. #13731

duianto added a commit that referenced this issue Jul 13, 2020
This reverts commit 4562da2.

Revert reason:
emacsclient broken on develop branch by commit 4562da2
#13766
@duianto
Copy link
Collaborator

duianto commented Jul 13, 2020

The broken commit has been reverted: 1e677bb

Revert "[spacemacs-bootstrap] Fix mode-line evil state foreground"

This reverts commit 4562da2.

Revert reason:
emacsclient broken on develop branch by commit 4562da2
#13766

@smile13241324
Copy link
Collaborator

@jg-made the commit has been reverted, can you retry on latest develop and close this issue when it is gone?

@jg-made
Copy link
Contributor Author

jg-made commented Jul 20, 2020

This issue no longer happens. Closing.

@jg-made jg-made closed this as completed Jul 20, 2020
aam-at pushed a commit to aam-at/spacemacs that referenced this issue Mar 23, 2021
This reverts commit 4562da2.

Revert reason:
emacsclient broken on develop branch by commit 4562da2
syl20bnr#13766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants