Coder Social home page Coder Social logo

Comments (21)

seagle0128 avatar seagle0128 commented on July 17, 2024

Thanks for the reporting. Actually the package has not been approved by Melpa so far.

Regarding this issue, I tested with your configurations. It seems the all-the-icons package is missing. Please add (use-package all-the-icons) and retry. It works well for me as below.

image

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

It still doesn't work for me. I am on Windows if that makes any difference.

udklip

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

I found this in the Messages buffer

../../../Users/Troels/.emacs.d/doom-modeline.el: ‘when-let’ is an obsolete macro (as of 26.1); use ‘when-let*’ instead. [3 times] Loading c:/Users/Troels/.emacs.d/doom-modeline.el (source)...done

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Does it work now?
Yes. I also noticed this warning. But for Emacs 24 and 25, there is no when-let*. Let me look into and address it.

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

It still doesn't work, but after changing when-let to when-let* I now get this error:
Error during redisplay: (eval (doom-modeline-format--main)) signaled (invalid-regexp "Trailing backslash") [4 times]

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

OK. Did you install all-the-icons fonts? Run M-x all-the-icons-install-fonts. It should be the fonts issue here.

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

Yes, I have run the command, and I'm afraid it doesn't change anything.

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

I think this might be an issue with the encoding in Windows. I'll be back.

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Please try other fonts or encodings. Hmm, I am not using Windows now :(

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

If the fonts are still not displayed correctly, please try to put these codes in init.el (after (require 'doom-modeline)) , and let me know the results.

(defun +doom-maybe-icon-octicon (&rest args)
  (when (and (display-graphic-p) (not (eq system-type 'windows-nt)))
    (apply 'all-the-icons-octicon args)))

(defun +doom-maybe-icon-faicon (&rest args)
  (when (and (display-graphic-p) (not (eq system-type 'windows-nt)))
    (apply 'all-the-icons-faicon args)))

(defun +doom-maybe-icon-material (&rest args)
  (when (and (display-graphic-p) (not (eq system-type 'windows-nt)))
    (apply 'all-the-icons-material args)))

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

I have now tested it on my work computer, and it's the same thing. The lisp code above doesn't change anything :-(

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Also on Windows? Any output in the Messages buffer?

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

Yes, my work computer runs Windows. And the output in *Messages* is exactly the same.

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

I tested on Windows just now. It works fine. Please update and retry. I am using consolas fonts with GNU Emacs 26.1 on Windows 10.

image

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

It's working! Turns out I was running 26.093 or something like that. I've now upgraded to 26.1. Thank you so much.

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Welcome! I disabled all-the-icons in Windows due to the bad performance and formats. Please refer to my latest commit. In my testing, the icons are not showed correctly.

I'm closing this issue. Please let me know if you still have questions. Thanks.

from doom-modeline.

trbjo avatar trbjo commented on July 17, 2024

Have you seen this?

Putting (setq inhibit-compacting-font-caches t) in my .emacs solves the issue for me.

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Thanks!

I tried this workaround, but seems it doesn't work. The icons in modeline are messy, and the Emacs is extremely slow after I updated all-the-icons. Actually the Emacs consumes 3GB memory if turning on all-the-icons on Windows 10. So I decided to disable it.

All icons are showed correctly on your side? Can I see the screenshot?

On my Windows laptop, the icons are like this

image

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

@VirgiliusHaufniensis I enabled all-the-icons on Windows now. The root cause is the font issue and it has been fixed in my config (seagle0128/.emacs.d@7e0e69e).

Please update and try on your env. For develop branch, it has been merged new codes, also stable now.

from doom-modeline.

yiufung avatar yiufung commented on July 17, 2024

Hmm I'm still having the same issue using Emacs 26.1 in Windows 10. All fonts from all-the-icons have been installed.

;; UTF-8 everywhere please
(setq locale-coding-system 'utf-8) ; pretty
(set-terminal-coding-system 'utf-8) ; pretty
(set-keyboard-coding-system 'utf-8) ; pretty
(set-selection-coding-system 'utf-8) ; please
(prefer-coding-system 'utf-8) ; with sugar on top
(set-language-environment 'utf-8)

;; Turn off mouse interface early in startup to avoid momentary display
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))

;; Define melpas
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives
             '("melpa2" . "http://www.mirrorservice.org/sites/melpa.org/packages/"))
(add-to-list 'package-archives
             '("melpa3" . "http://www.mirrorservice.org/sites/stable.melpa.org/packages/"))
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(package-initialize)

;; Bootstrap `use-package'
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; Load use-package
(eval-when-compile
  (require 'use-package))

;; Essentials starts.
(setq system-time-locale "C")
(winner-mode 1)

(use-package all-the-icons)
(use-package doom-modeline
  :ensure t
  :defer t
  :hook (after-init . doom-modeline-init))

Modeline is only shown on special buffers, *scratch* etc. The error message in *Message* is:

Error during redisplay: (eval (doom-modeline-format--main)) signaled (invalid-regexp "Trailing backslash") [9 times]

Have also tried putting (setq inhibit-compacting-font-caches t) before doom-modeline, doesn't work either.

from doom-modeline.

seagle0128 avatar seagle0128 commented on July 17, 2024

Hi @yiufung ,

  1. Please use the latest Emacs 26.1.
  2. Please update doom-modeline to the latest version.
  3. Run M-x all-the-icons-install-fonts and install the dwonloaded fonts manually.
  4. Try with these configs if using cnfonts.
(defun cnfonts--set-all-the-icons-fonts (&optional _)
    "Show icons in all-the-icons."
    (when (featurep 'all-the-icons)
      (dolist (charset '(kana han cjk-misc bopomofo gb18030))
        (set-fontset-font "fontset-default" charset "all-the-icons" nil 'append)
        (set-fontset-font "fontset-default" charset "github-octicons" nil 'append)
        (set-fontset-font "fontset-default" charset "FontAwesome" nil 'append)
        (set-fontset-font "fontset-default" charset "Material Icons" nil 'append))))

(add-hook 'cnfonts-set-font-finish  #'cnfonts--set-all-the-icons-fonts)
  1. Remove the suspicious sections in mode-line below, then re-evaluate (C-x C-e).
(doom-modeline-def-modeline main
                            (workspace-number window-number bar matches " " buffer-info buffer-position  " " selection-info)
                            (global buffer-encoding major-mode vcs flycheck))

if you still encounter this issue, try M-x toggle-debug-on-error, and provide more errors for troubleshooting.

from doom-modeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.