Comments (11)
@seagle0128 @HouzuoGuo In doom-emacs modules/ui/modeline/config.el
, there is a advice
(defadvice! +modeline-disable-icon-in-daemon-a (fn &rest args)
:around #'doom-modeline-propertize-icon
(when (display-graphic-p)
(apply fn args)))
I disable this and It works! This advice results doom-modeline-propertize-icon returns nil in terminal.
from doom-modeline.
@HouzuoGuo Are you using doom-emacs? Can you please reproduce with emacs -Q
? I couldn't reproduce on macOS and Linux.
from doom-modeline.
@seagle0128
我写了简单的init.el
;; -*- lexical-binding: t -*-
(require 'package)
(setq package-archives '(("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
(setq package-enable-at-startup nil)
(package-initialize)
(package-refresh-contents)
(unless (package-installed-p 'compat)
(package-install 'compat))
(unless (package-installed-p 'nerd-icons)
(package-install 'nerd-icons))
(unless (package-installed-p 'doom-modeline)
(package-install 'doom-modeline))
(require 'doom-modeline)
(doom-modeline-mode 1)
from doom-modeline.
@seagle0128 你好,你的这个commit修复并不能解决问题。我这里clone了库测试了下,导致问题的根因在调用doom-modeline-propertize-icon这个函数时,不过我实在是没有找到原因。我在这个函数里面加了message,但是并没有执行到
看起来在调用 (doom-modeline-propertize-icon icon face) 的时候问题就已经出现了。我修改为(if icon icon "")就能正常在终端下展示图标了
from doom-modeline.
这样不能修复问题吗?
(if icon
(doom-modeline-propertize-icon icon face)
"")
from doom-modeline.
这样不能修复问题,最新的commit也不能修复问题。其实我这里看起来不是icon为nil的问题,而是在调用(doom-modeline-propertize-icon icon face)的时候,不知道中间发生了什么,导致还没进到这个函数里面去执行就已经出错了。我也不知道是不是doom那边的一些advice或者hook的问题。不过我改成直接使用时居然能正常work,但是其他地方还在使用这个函数
(if icon
(when-let ((props (get-text-property 0 'face icon)))
(when (listp props)
(cl-destructuring-bind (&key family height inherit :allow-other-keys) props
(propertize icon 'face `(:inherit (doom-modeline ,(or face inherit props))
:family ,(or family "")
:height ,(or height 1.0))))))
"")))
from doom-modeline.
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
propertize(nil help-echo "LSP Connected [gopls:1888/starting]\nC-mouse-1: Swi..." mouse-face doom-modeline-highlight local-map (keymap (mode-line keymap (mouse-3 . lsp-workspace-restart) (mouse-2 . lsp-works$
doom-modeline-update-lsp()
run-hooks(lsp-before-initialize-hook)
lsp--start-workspace(#s(lsp-session :folders ("~/Workspace/playground/gotest") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x1ff5caa2e07d> :folder->servers #<hash-table $
lsp--start-connection(#s(lsp-session :folders ("~/Workspace/playground/gotest") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x1ff5caa2e07d> :folder->servers #<hash-table$
#f(compiled-function (client) #<bytecode 0x1ae5a3ddf7144946>)(#s(lsp--client :language-id "go" :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn workspace) #<by$
mapcar(#f(compiled-function (client) #<bytecode 0x1ae5a3ddf7144946>) (#s(lsp--client :language-id "go" :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn workspa$
-map(#f(compiled-function (client) #<bytecode 0x1ae5a3ddf7144946>) (#s(lsp--client :language-id "go" :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn workspace$
lsp--ensure-lsp-servers(#s(lsp-session :folders ("~/Workspace/playground/gotest") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x1ff5caa2e07d> :folder->servers #<hash-tab$
lsp--try-project-root-workspaces(nil nil)
lsp()
lsp--init-if-visible()
#f(compiled-function () #<bytecode 0x73f1a6b086c831>)()
apply(#f(compiled-function () #<bytecode 0x73f1a6b086c831>) nil)
timer-event-handler([t 0 0 0 nil #f(compiled-function () #<bytecode 0x73f1a6b086c831>) nil idle 0 nil])
这个不知道对你有没有帮助
from doom-modeline.
@blithefeng 能用 emacs -Q
重现下吗?如果是doom内部改了什么就不好定位了。你提供的backtrace就是icon为nil(虽然我认为这是不可能的),所以我加了一层保护。如果这样还是这个错误就奇怪了。
from doom-modeline.
I'm still experiencing this issue after doom-modeline to 259ff6a
Error during redisplay: (eval (doom-modeline-segment--modals)) signaled (wrong-type-argument stringp nil) [42 times]
Projectile project root has been force-set to "/google/src/cloud/howardguo/uni-filter/google3/production/automation/autodash/" in workspace "uni-filter"
Error during redisplay: (eval (doom-modeline-segment--modals)) signaled (wrong-type-argument stringp nil) [5 times]
run-hooks: Wrong type argument: stringp, nilError during redisplay: (eval (doom-modeline-segment--modals)) signaled (wrong-type-argument stringp nil)
Error during redisplay: (eval (doom-modeline-segment--modals)) signaled (wrong-type-argument stringp nil) [26 times]
BTW, my emacs runs in a terminal instead of a graphical window, in case that helps.
See https://pastebin.com/6rUJSTCQ for the system information, there are also more details in doomemacs/doomemacs#7367
from doom-modeline.
@blithefeng many thanks!
from doom-modeline.
如果非要加advice,其实更应该override doom-modeline-icon-displayable-p
,或者直接不安装nerd-icons。但是nerd-icons既然支持terminal,为什么不用呢? 😄 给doom提issue吧
from doom-modeline.
Related Issues (20)
- Optionally show lsp server info next to the lsp segment icon
- [Feature Request] use builtin right align support for emacs >30 HOT 6
- Modeline won't display python version after using python-ts-mode
- [Feature Request] Show treemacs workspace name in modeline for treemacs HOT 9
- [Bug] `string-pixel-width` defined shadowing (emacs 29) builtin HOT 1
- [Bug] Flycheck broken by `doom-modeline-update-flycheck-text`
- [Bug] doom-modeline-def-segment results in void variable HOT 5
- Direnv integration HOT 2
- [Bug] Null vertical padding after update HOT 5
- [Bug] Buffer line number does not update consistently HOT 2
- [Bug] GitHub notifications are showing way too many HOT 3
- [Bug] How to get rid of the <N>, <I>, <V> in the centre of the icons? HOT 2
- [Bug] Potential commit 8d9815 or a2a6f53 breaking lsp-mode HOT 2
- [Feature Request] Show number of lines in the current file HOT 1
- Indicate modals everywhere HOT 1
- [Bug] Doom modeline a bit slow under wayland(pgtk build) HOT 4
- [Bug] Resizing window with doom-dashboard increasingly cuts off right side of modeline HOT 13
- [Feature request] Customize display of line and column numbers
- [Bug] Custom segment makes emacs lag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doom-modeline.