abougouffa / minemacs

MinEmacs: an Emacs configuration framework for daily use
https://abougouffa.github.io/minemacs/
MIT License
143 stars 16 forks source link

Unicode-font-setup void-variable error #33

Closed jonathanwilner closed 1 year ago

jonathanwilner commented 1 year ago

Hi there -

Been trying to figure this one out for a few days. It doesn't happen with the vanilla / first install of minemacs, but as soon as I seem to add a few modules, it appears. I get the full error when starting up with debugging enabled, but without it enabled, loading stops when the error hits - forcing me to then try to load the rest of the config by reloading init.el.

I'm totally stumped on how to get past this one & how to figure out what change / config is generating the problem, other than obviously the call to setup unicode-fonts.

My guess is that this is Mac related & has to do with trying to load a font weight. There's a similar seeming bug that was fixed for Spacemacs, but the workaround about weights/color doesn't seem to help, at least as I'm trying to apply it.

I'd love any help or direction to where to look in the configuration or how to give better debug feedback.

Thanks!


`Debugger entered--Lisp error: (void-variable ...) (progn (set-fontset-font "fontset-default" '(64256 . 64335) (font-spec :name "Arial Unicode MS:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(65856 . 65935) (font-spec :name "Apple Symbols:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Courier New:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Geeza Pro:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Baghdad:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Damascus:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Al Bayan:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Arial Unicode MS:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Nadeem:" :registry "iso10646-1") nil 'append) ...) eval((progn (set-fontset-font "fontset-default" '(64256 . 64335) (font-spec :name "Arial Unicode MS:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(65856 . 65935) (font-spec :name "Apple Symbols:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Courier New:" :registry "iso10646-1")) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Geeza Pro:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Baghdad:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Damascus:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Al Bayan:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Arial Unicode MS:" :registry "iso10646-1") nil 'append) (set-fontset-font "fontset-default" '(1536 . 1791) (font-spec :name "Nadeem:" :registry "iso10646-1") nil 'append) ...)) unicode-fonts--setup-1("fontset-default" nil) unicode-fonts-setup() (progn (select-frame frame 'norecord) (let ((unicode-font-family (and t (plist-get minemacs-fonts :unicode-font-family)))) (if unicode-font-family (let ((tail unicode-fonts-block-font-mapping)) (while tail (let ((unicode-block ...)) (let (...) (setcar ... ...)) (setq tail (cdr tail))))) nil)) (unicode-fonts-setup)) (unwind-protect (progn (select-frame frame 'norecord) (let ((unicode-font-family (and t (plist-get minemacs-fonts :unicode-font-family)))) (if unicode-font-family (let ((tail unicode-fonts-block-font-mapping)) (while tail (let (...) (let ... ...) (setq tail ...)))) nil)) (unicode-fonts-setup)) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer)))) (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame frame 'norecord) (let ((unicode-font-family (and t (plist-get minemacs-fonts :unicode-font-family)))) (if unicode-font-family (let ((tail unicode-fonts-block-font-mapping)) (while tail (let ... ... ...))) nil)) (unicode-fonts-setup)) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer))))) (progn (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame frame 'norecord) (let ((unicode-font-family (and t ...))) (if unicode-font-family (let (...) (while tail ...)) nil)) (unicode-fonts-setup)) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer)))))) (if (and frame (display-graphic-p frame)) (progn (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame frame 'norecord) (let ((unicode-font-family ...)) (if unicode-font-family (let ... ...) nil)) (unicode-fonts-setup)) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer))))))) +unicode-fonts-setup-font(#<frame minemacs-splash 0x12e1a0230>) (if (display-graphic-p) (+unicode-fonts-setup-font (selected-frame)) (add-hook 'after-make-frame-functions #'+unicode-fonts-setup-font)) +unicode-fonts-initialize() run-hooks(minemacs-after-startup-hook) (progn (setq minemacs-after-startup-hook (reverse minemacs-after-startup-hook)) nil (run-hooks 'minemacs-after-startup-hook)) (if minemacs-after-startup-hook (progn (setq minemacs-after-startup-hook (reverse minemacs-after-startup-hook)) nil (run-hooks 'minemacs-after-startup-hook))) eval-buffer(#<buffer load*> nil "/Users/Jonathan.Wilner/.emacs.d/core/minemacs-load..." nil t) ; Reading at buffer position 592 load-with-code-conversion("/Users/Jonathan.Wilner/.emacs.d/core/minemacs-load..." "/Users/Jonathan.Wilner/.emacs.d/core/minemacs-load..." nil t) require(minemacs-loaded) +minemacs--loaded-h() run-hooks(emacs-startup-hook term-setup-hook)

f(compiled-function () #<bytecode 0x41bcab4a44e7572>)()

normal-top-level() `

abougouffa commented 1 year ago

Hello @jonathanwilner ,

Thanks for the feedback,

It seems to be related to the unicode-fonts package.

Try to add this to your ~/.minemacs.d/config.el to disable loading the package:

(remove-hook 'minemacs-after-startup-hook #'+unicode-fonts-initialize)
jonathanwilner commented 1 year ago

Hi there- will do, I was trying to keep unicode-fonts in there, as I like having unicode / symbols around.

abougouffa commented 1 year ago

It seems that the issue is present on the upstream repo https://github.com/rolandwalker/unicode-fonts/issues/36. There is a potential fix (as described in https://github.com/rolandwalker/unicode-fonts/issues/36#issuecomment-1336049905); try this:

rm -r ~/.emacs.d/local/pcache/
jonathanwilner commented 1 year ago

Yes! That did it. Thank you for finding that upstream. I should have looked there first! :-(

abougouffa commented 1 year ago

Can I consider this issue as resolved?

jonathanwilner commented 1 year ago

Yes, thanks !

On Fri, Mar 17, 2023 at 18:03 Abdelhak Bougouffa @.***> wrote:

Can I consider this issue as resolved?

— Reply to this email directly, view it on GitHub https://github.com/abougouffa/minemacs/issues/33#issuecomment-1474554957, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEOIB4N4SV6AD42X4HVYF3W4UCVHANCNFSM6AAAAAAV7CQ46M . You are receiving this because you were mentioned.Message ID: @.***>