Emacs:如何关闭非图形化显示下fira-code-mode的专属警告
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-typesis 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

