You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Emacs:如何关闭非图形化显示下fira-code-mode的专属警告

Suppress Fira Code Mode Non-Graphical Display Warning in Terminal Emacs

Absolutely! You can get rid of that annoying warning without modifying the fira-code-mode.el source code—Emacs has a built-in system for suppressing specific warning types that we can leverage here.

Here's how to do it:

The warning you're seeing is tagged with (fira-code-ligatures) (as confirmed by the source code snippet you shared). To suppress it, we just need to add this tag to Emacs's warning-suppress-types variable.

You can integrate this directly into your existing use-package configuration for fira-code-mode like this:

(use-package fira-code-mode
  :custom (fira-code-mode-disabled-ligatures '("[]" "www" "<-" "#{" "#(" "#_" "#_(" "x"))
  :hook prog-mode
  :config
  ;; Suppress the non-graphical display warning for fira-code-mode
  (add-to-list 'warning-suppress-types '(fira-code-ligatures)))

How this works:

  • warning-suppress-types is an Emacs variable that holds a list of warning tags to ignore. By adding (fira-code-ligatures) to this list, we tell Emacs to skip displaying any warnings from the fira-code-ligatures module.
  • This change applies globally, so the warning won't pop up whether you run Emacs in a GUI or terminal (including when mutt calls it).

If you need to re-enable the warning later:

You can temporarily remove the suppression with this command (run it via M-:):

(setq warning-suppress-types (delete '(fira-code-ligatures) warning-suppress-types))

Or just remove the add-to-list line from your .emacs file and restart Emacs.

内容的提问来源于stack exchange,提问作者larry77

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 19:28:11