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

Error when trying to start emacs in daemon mode #16

Open
xqliu opened this issue Dec 4, 2019 · 5 comments
Open

Error when trying to start emacs in daemon mode #16

xqliu opened this issue Dec 4, 2019 · 5 comments

Comments

@xqliu
Copy link

xqliu commented Dec 4, 2019

Dear,

I faced follow issue when trying to start emacs in daemon mode

error: (error Face height does not produce a positive integer lambda (_x) (poet--height 1.23))

It works find when trying emacs -Q --daemon

Could it be some issue related to this theme?

Here are the software version and error information:

  • Emacs version: 26.3
  • OS: Redhat ES 8.1
  • Error message:
Warning: due to a long standing Gtk+ bug
https://gitlab.gnome.org/GNOME/gtk/issues/221
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Loading /home/developer/.emacs.d/core/core-versions.el (source)...
Loading /home/developer/.emacs.d/core/core-versions.el (source)...done
Loading /home/developer/.emacs.d/core/core-load-paths.el (source)...
Loading /home/developer/.emacs.d/core/core-load-paths.el (source)...done
Loading /home/developer/.emacs.d/core/core-dumper.el (source)...
Loading /home/developer/.emacs.d/core/core-dumper.el (source)...done
Loading /home/developer/.emacs.d/.lock...
Loading /home/developer/.emacs.d/.lock...done
Loading /home/developer/.spacemacs...
Loading /home/developer/.spacemacs...done
(Spacemacs) Calling dotfile init...
(Spacemacs) Calling dotfile user init...
(Spacemacs) Initializing Org early...
error: (error Face height does not produce a positive integer lambda (_x) (poet--height 1.23))
Entering debugger...

Thanks :)

@kunalb
Copy link
Owner

kunalb commented Dec 7, 2019

Thanks for the report! I'll take a look soon.

@kunalb
Copy link
Owner

kunalb commented Dec 15, 2019

I haven't had much luck reproducing this error, does it reproduce if you only have poet installed without anything else?

@sergeyklay
Copy link

Got the same issue.

Steps to reproduce:

;; Somewhere in the init.el
(use-package poet-theme)
#!/bin/sh -eu

echo "Attempting startup..."

EMACS=${EMACS:-emacs}

tpl='(let ((debug-on-error t)
          (url-show-status nil)
          (user-emacs-directory default-directory)
          (user-init-file (expand-file-name "init.el"))
          (load-path (delq default-directory load-path)))
      (load-file user-init-file)
      (run-hooks (quote after-init-hook)))'

${EMACS} \
    --no-window-system \
    --batch \
    --eval "$tpl"

Logs:

Attempting startup...
Loading /home/klay/.emacs.d/init.el (source)...
Parsing tar file...
Parsing tar file...done
Extracting poet-theme-20191215.201/
Extracting poet-theme-20191215.201/poet-dark-theme.el
Extracting poet-theme-20191215.201/poet-theme-pkg.el
Extracting poet-theme-20191215.201/poet-monochrome-theme.el
Extracting poet-theme-20191215.201/poet-dark-monochrome-theme.el
Extracting poet-theme-20191215.201/poet-theme.el
Generating autoloads for poet-dark-monochrome-theme.el...
Generating autoloads for poet-dark-monochrome-theme.el...done
Generating autoloads for poet-dark-theme.el...
Generating autoloads for poet-dark-theme.el...done
Generating autoloads for poet-monochrome-theme.el...
Generating autoloads for poet-monochrome-theme.el...done
Generating autoloads for poet-theme-pkg.el...
Generating autoloads for poet-theme-pkg.el...done
Generating autoloads for poet-theme.el...
Generating autoloads for poet-theme.el...done
Wrote /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-theme-autoloads.el
Wrote /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-theme-autoloads.el
Checking /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201...
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-dark-monochrome-theme.el...

In toplevel form:
poet-dark-monochrome-theme.el:53:1:Warning: defgroup for ‘poet-theme’ fails to
    specify containing group
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-dark-theme.el...

In toplevel form:
poet-dark-theme.el:53:1:Warning: defgroup for ‘poet-theme’ fails to specify
    containing group
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-monochrome-theme.el...

In toplevel form:
poet-monochrome-theme.el:53:1:Warning: defgroup for ‘poet-theme’ fails to
    specify containing group
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-theme-autoloads.el...
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-theme-pkg.el...
Compiling /home/klay/.local/share/emacs/elpa/26.3/poet-theme-20191215.201/poet-theme.el...

In toplevel form:
poet-theme.el:53:1:Warning: defgroup for ‘poet-theme’ fails to specify
    containing group
Done (Total of 4 files compiled, 2 skipped)
Debugger entered--Lisp error: (error "Face height does not produce a positive integer" lambda (_x) (poet--height 1.23))
  internal-set-lisp-face-attribute(variable-pitch :height (lambda (_x) (poet--height 1.23)) #<frame F1 0xd3f7b0>)
  set-face-attribute(variable-pitch #<frame F1 0xd3f7b0> :family "Sans Serif" :height (lambda (_x) (poet--height 1.23)))
  apply(set-face-attribute variable-pitch #<frame F1 0xd3f7b0> (:family "Sans Serif" :height (lambda (_x) (poet--height 1.23))))
  face-spec-set-2(variable-pitch #<frame F1 0xd3f7b0> (:family "Sans Serif" :height (lambda (_x) (poet--height 1.23))))
  face-spec-recalc(variable-pitch #<frame F1 0xd3f7b0>)
  face-spec-set(variable-pitch ((t (:family "Sans Serif" :height (lambda (_x) (poet--height 1.23))))) t)
  custom-theme-set-faces(poet (variable-pitch ((t (:family "Sans Serif" :height (lambda (_x) (poet--height 1.23)))))) (default ((t (:background "#e1d9c2" :foreground "#444444")))) (italic ((t (:foreground "#222222" :slant italic)))) (highlight ((t (:background "#efefef" :overline nil)))) (region ((t (:background "#fff8e1")))) (fringe ((t (:background "#e1d9c2")))) (button ((t (:inherit default :foreground "#616161")))) (escape-glyph ((t (:foreground "#673AB7")))) (link ((t (:underline (:color "#304ffe" :style line) :foreground "#303f9f")))) (link-visited ((t (:inherit link :foreground "#303f9f" :underline (:color "#1a237e" :style line))))) (cursor ((t (:background "#333333")))) (show-paren-match ((t (:background "#ffffff" :foreground "#ff1744")))) (isearch ((t (:foreground "#c2185b" :background "#ffffff")))) (isearch-fail ((t (:background "#f8bbd0")))) (query-replace ((t (:inherit isearch)))) (tooltip ((t (:inherit default :foreground "#111111" :background "#fff176")))) (shadow ((t (:foreground "#999999")))) (secondary-selection ((t (:background "#fff59d")))) (trailing-whitespace ((t (:background "#ff8a65")))) (lazy-highlight ((t (:foreground "#000000" :background "#ffffff")))) (next-error ((t (:inherit region)))) (window-divider ((t (:background "#eeeeee" :foreground "#eeeeee")))) (vertical-border ((t (:background "#eeeeee" :foreground "#eeeeee")))) (evil-ex-substitute-replacement ((t (:foreground "#ffffff" :background "#4e342e" :underline nil)))) (minibuffer-prompt ((t (:inherit fixed-pitch :weight bold :foreground "#4e342e")))) (mode-line ((t (:inherit fixed-pitch :foreground "#111111" :background "#e1d9c2" :overline "#eeeeee" :box (:line-width 3 :color "#e1d9c2"))))) (header-line ((t (:overline nil :background "#e0e0e0" :box (:line-width 3 :color "#e0e0e0") :underline "#eeeeee" :inherit mode-line)))) (mode-line-buffer-id ((t (:weight bold)))) (mode-line-emphasis ((t (:weight bold)))) (mode-line-highlight ((t (:background "#ffffff")))) (mode-line-inactive ((t (:inherit mode-line :background "#e1d9c2" :foreground "#888888" :box (:color "#e1d9c2" :line-width 3))))) (error ((t (:foreground "#df5286" :inherit fixed-pitch)))) (font-lock-comment-face ((t (:foreground "#795548" :inherit fixed-pitch)))) (font-lock-builtin-face ((t (:foreground "#795548" :inherit fixed-pitch)))) (font-lock-string-face ((t (:inherit fixed-pitch :foreground "#6C3082")))) (font-lock-function-name-face ((t (:inherit fixed-pitch :foreground "#388E3C")))) (font-lock-keyword-face ((t (:inherit fixed-pitch :foreground "#bf360c")))) (font-lock-comment-delimiter-face ((t (:inherit fixed-pitch :inherit font-lock-comment-face)))) (font-lock-constant-face ((t (:inherit fixed-pitch :foreground "#0288D1")))) (font-lock-doc-face ((t (:inherit fixed-pitch :inherit font-lock-string-face)))) (font-lock-preprocessor-face ((t (:inherit fixed-pitch :inherit font-lock-builtin-face)))) (font-lock-regexp-grouping-backslash ((t (:inherit fixed-pitch :inherit bold)))) (font-lock-regexp-grouping-construct ((t (:inherit fixed-pitch :inherit bold)))) (font-lock-type-face ((t (:foreground "#3f51b5" :inherit fixed-pitch)))) (font-lock-variable-name-face ((t (:inherit fixed-pitch :foreground "#455A64")))) (font-lock-warning-face ((t (:inherit error)))) (org-level-1 ((t (:inherit default :foreground "#770b0b" :height (lambda (_x) (poet--height 1.5)))))) (org-level-2 ((t (:inherit default :foreground "#770b0b" :height (lambda (_x) (poet--height 1.4)))))) (org-level-3 ((t (:inherit default :foreground "#770b0b" :height (lambda (_x) (poet--height 1.3)))))) ...)
  byte-code("\306\307\310\311#\210\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\332\334\335\336\337\340\341\342\343\332\211\321\335\344\332\345\346\320\347\350\351\352\353\354\355\320\344\356\344\312\357\360\211\330\335\350\361\362\363\344\364\344\343\315\362\365\362\316\364\360\355\362\366\343\344\211\355\321\030\031\032\033\034\035\036@\036A\036B\036C\036D\036E\036F\036G\036H\036I\036J\036K\036L\036M\036N\036O\036P\036Q\036R\036S\036T\036U\036V\036W\036X\036Y\036Z\036[\036\\\036]\036^\036_\036`\036a\036b\036c\036d\036e\036f\036g\036h\036i\036j\036k\036l\036m\036n\036o\036p\036q\036r\036s\036t\036u\036v\036w\036x\036y\036z\036{\036|\036}\036~\036\177\036\200\036\201\036\202\036\203\036\204\036\205\367\307\370\371\372\373\370\372\"\374BBDCD\375\371\376\016\204\377\016\205FDCD\201\207\0\371\377\016\203\201\210\0\ BBDCD\201\211\0\371\376\016\201\201\212\0\ BBDCD\201\213\0\371\376\016\200DDCD\201\214\0\371\376\016\204DDCD\201y\0\371\201\215\0\375\377\016yFDCD\201\216\0\371\377\016xDDCD\201}\0\371\201\217\0\201\220\0\016|\201\221\0\ BB\377\016}FDCD\201\222\0\371\201\215\0\201}\0\377\016}\201\217\0\201\220\0\016{\201\223\0\ BB\257\006DCD\201w\0\371\376\016wDDCD\201\224\0\371\376\016u\377\016vFDCD\201\225\0\371\377\016t\376\016sFDCD\201\226\0\371\376\016rDDCD\201\227\0\201\230\0\371\201\215\0\375\377\016q\376\016p\257\006DCD\201o\0\371\377\016oDDCD\201\231\0\371\376\016nDDCD\201\232\0\371\376\016mDDCD\201\233\0\371\377\016k\376\016jFDCD\201\234\0\201\235\0\371\376\016\202\377\016\202FDCD\201\236\0\371\376\016\202\377\016\202FDCD\201\237\0\371\377\016i\376\016h\201\240\0\ BBBBDCD\201\241\0\371\201\215\0\201\242\0\201\243\0\201\244\0\377\016~\257\006DCD\201\245\0\371\201\215\0\201\242\0\377\016g\376\016\204\201\246\0\016\202\201\247\0\201\250\0\201\251\0\201\220\0\016\204F\257\nDCD\201\252\0\371\201\246\0\201\253\0\376\016f\201\247\0\201\250\0\201\251\0\201\220\0\016fF\201\217\0\016\202\201\254\0\ BBBBBBBBDCD\201\255\0\201\256\0\201\257\0\371\376\016eDDCD\201d\0\371\201\215\0\201\245\0\376\016\204\377\016d\201\247\0\201\220\0\016\204\201\260\0\ BB\257\010DCD\201c\0\371\377\016c\201\261\0\ BBDCD\201\262\0\371\377\016\177\201\263\0\ BBDCD\201\264\0\371\377\016b\201\265\0\ BBDCD\201\266\0\371\201\215\0\201\242\0\377\016aFDCD\201\267\0\371\201\215\0\201\242\0\377\016`FDCD\201\270\0\371\201\215\0\201\242\0\377\016_FDCD\201\271\0\201\272\0\371\201\215\0\201\242\0\377\016^FDCD\201\273\0\201\274\0\201\275\0\201\276\0\201\277\0\371\377\016]\201\300\0\ BBDCD\201\301\0\371\201\215\0\201\242\0\377\016\\FDCD\201\302\0\201\303\0\371\201\215\0\375\377\016z\201\304\0\ BBBBDCD\201\305\0\371\201\215\0\375\377\016z\201\306\0\ BBBBDCD\201\307\0\371\201\215\0\375\377\016z\201\310\0\ BBBBDCD\201\311\0\371\201\215\0\375\377\016z\201\312\0\ BBBBDCD\201\313\0\371\201\215\0\375\377\016z\201\314\0\ BBBBDCD\201\315\0\371\201\215\0\375\377\016z\201\316\0\ BBBBDCD\201\317\0\371\201\215\0\375\377\016z\201\320\0\ BBBBDCD\201\321\0\371\201\215\0\375\377\016z\201\322\0\ BBBBDCD\201\323\0\371\201\215\0\201\242\0\377\016[FDCD\201\324\0\371\201\215\0\201\242\0\377\016ZFDCD\201Z\0\371\201\215\0\375\377\016ZFDCD\201\325\0\201\326\0\201Y\0\371\201\215\0\201\242\0\376\016YFDCD\201\327\0\201\330\0\371\201\215\0\375\377\016X\376\016W\257\006DCD\201\331\0\371\201\215\0\375\377\016X\376\016W\257\006DCD\201\332\0\371\201\215\0\201\242\0\377\016\204FDCD\201\333\0\201V\0\371\201\215\0\201\242\0\377\016V\201\334\0\ BBBBDCD\201\335\0\371\201\215\0\375\377\016U\201\336\0\201\337\0\201\217\0\201\220\0\016TD\257\010DCD\201S\0\371\201\215\0\201\242\0\201\243\0\201\244\0\377\016S\257\006DCD\201P\0\371\201\215\0\201\242\0\377\016PFDCD\201O\0\371\201\215\0\201\242\0\377\016OFDCD\201N\0\371\201\215\0\201\242\0\201\336\0\201\340\0\377\016N\257\006DCD\201\341\0\371\201\215\0\201\242\0\376\016MFDCD\201\342\0\371\201\215\0\201\242\0\376\016MFDCD\201\343\0\371\376\016L\201\344\0\ BBDCD\201\345\0\201\346\0\371\377\016K\376\016\204\201\247\0\201\250\0\201\251\0\201\220\0\016\204F\201\217\0\016J\257\010DCD\201R\0\371\377\016RDDCD\201Q\0\371\377\016QDDCD\201\347\0\201\350\0\371\201\247\0\201\250\0\201\251\0\201\220\0\016HF\377\016I\376\016H\257\006DCD\201G\0\371\201\215\0\201\242\0\377\016GFDCD\201\351\0\371\377\016FDDCD\201E\0\371\377\016EDDCD\201\352\0\371\377\016}DDCD\201D\0\371\376\016DDDCD\201\353\0\371\201\215\0\201\242\0\377\016CFDCD\201B\0\371\201\215\0\201\242\0\377\016BFDCD\201\354\0\371\201\215\0\201\242\0\377\016BFDCD\201\355\0\371\201\215\0\201\242\0\377\016CFDCD\201\356\0\371\377\016z\201\357\0\ BBDCD\201\360\0\371\377\016z\201\361\0\ BBDCD\201\362\0\371\377\016z\201\363\0\ BBDCD\201\364\0\371\377\016z\201\365\0\ BBDCD\201\366\0\371\377\016z\201\367\0\ BBDCD\201\370\0\371\377\016z\201\371\0\ BBDCD\201\372\0\371\377\016z\201\373\0\ BBDCD\201\374\0\371\377\016z\201\375\0\ BBDCD\201\376\0\371\201\215\0\201\242\0\377\016AFDCD\201\377\0\201\0\001\371\201\215\0\201\242\0\201\336\0\201\001\001\377\016@\257\006DCD\201\002\001\371\201\215\0\201\242\0\201\336\0\201\003\001\377\016\205\257\006DCD\201\004\001\371\377\015DDCD\201\005\001\371\201\215\0\201\242\0\377\fFDCD\201\006\001\371\201\215\0\201\242\0\377\016\205\376\013\257\006DCD\201\007\001\371\201\215\0\201\242\0\201\220\0\016\205\376\n\257\006DCD\201\010\001\371\201\215\0\201\242\0\377\011FDCD\201\011\001\371\201\215\0\201\242\0\377\011FDCD\201\n\001\371\201\215\0\201\242\0\377\016}FDCD\201\013\001\371\377\010DDCD\201\f\001\371\377\010DDCD\201\015\001\371\377\010DDCD\201\016\001\371\377\010DDCD\201\017\001\371\377\010DDCD\201\020\001\371\377\010DDCD\201\021\001\201\022\001\371\376\016LDDCD\201\023\001\371\377\016N\376\016\204FDCD\201\024\001\371\377\016N\376\016\204FDCD&w\210\201\025\001\307\201\026\001\201\027\001\016lD#\210.L\201\030\001\201\031\001!\203\004\010\016\206\203\004\010\201\032\001\201\031\001\201\033\001\201\034\001\016\206!!\"\210\201\035\001\307!\207" [imenu markdown-header-delimiter markdown-pre-bg markdown-code-bg markdown-list markdown-language custom-declare-theme poet poet-theme "A prose friendly theme." "#444444" "#e1d9c2" "#222222" "#eeeeee" "#efefef" "#fff8e1" "#795548" "#4e342e" "#303f9f" "#304ffe" "#1a237e" "#770b0b" "#616161" "#673AB7" "#333333" "#ff1744" "#ffffff" "#c2185b" "#f8bbd0" "#111111" "#fff176" "#999999" "#fff59d" "#ff8a65" "#dedede" "#000000" "#e0e0e0" "#888888" "#df5286" "#6C3082" "#388E3C" "#bf360c" "#0288D1" "#3f51b5" "#455A64" "#8D6E63" "#4A148C" "#B71C1C" "#aaaaaa" "#BF360C" ...] 125)
  require(poet-theme nil t)
  (not (require (quote poet-theme) nil t))
  (if (not (require (quote poet-theme) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote poet-theme)) :error))
  (condition-case err (if (not (require (quote poet-theme) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote poet-theme)) :error)) ((debug error) (funcall use-package--warning2 :catch err)))
  eval-buffer(#<buffer  *load*-701632> nil "/home/klay/.emacs.d/settings/appearance.el" nil t)  ; Reading at buffer position 2808
  load-with-code-conversion("/home/klay/.emacs.d/settings/appearance.el" "/home/klay/.emacs.d/settings/appearance.el" nil t)
  require(appearance)
  eval-buffer(#<buffer  *load*> nil "/home/klay/.emacs.d/init.el" nil t)  ; Reading at buffer position 693
  load-with-code-conversion("/home/klay/.emacs.d/init.el" "/home/klay/.emacs.d/init.el" nil nil)
  load("/home/klay/.emacs.d/init.el" nil nil t)
  load-file("/home/klay/.emacs.d/init.el")
  (let ((debug-on-error t) (url-show-status nil) (user-emacs-directory default-directory) (user-init-file (expand-file-name "init.el")) (load-path (delq default-directory load-path))) (load-file user-init-file) (run-hooks (quote after-init-hook)))
  eval((let ((debug-on-error t) (url-show-status nil) (user-emacs-directory default-directory) (user-init-file (expand-file-name "init.el")) (load-path (delq default-directory load-path))) (load-file user-init-file) (run-hooks (quote after-init-hook))))
  command-line-1(("--eval" "(let ((debug-on-error t)\n          (url-show-status nil)\n          (user-emacs-directory default-directory)\n          (user-init-file (expand-file-name \"init.el\"))\n          (load-path (delq default-directory load-path)))\n      (load-file user-init-file)\n      (run-hooks (quote after-init-hook)))"))
  command-line()
  normal-top-level()

@kunalb
Copy link
Owner

kunalb commented May 31, 2020

Does emacs -Q --daemon --eval "(load-theme 'poet)" with poet in .emacs.d also fail?
Or is this something that only happens through use-package?

I can always force-fix this by making sure poet-theme--height always returns an integer

@Twey
Copy link

Twey commented Jun 29, 2020

I think this is problematic under daemon mode:

(defvar poet-theme-monospace-height
 (face-attribute 'fixed-pitch :height nil 'default)
 "The original height stored as a defvar to stay constant across reloads.")

In my case (I use daemon mode exclusively) if I start up poet-theme first in daemon mode this results in poet-theme-monospace-height getting stuck as 1, which is really tiny and results in headings being rendered really small. I want to guess that in this error for whatever reason it ended up as 0.

As a hackaround I just re-evaluate a bit later:

(add-hook
 'window-setup-hook
 (lambda ()
   (setq poet-theme-monospace-height
         (face-attribute 'fixed-pitch :height nil 'default))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants