有没有办法根据主要模式更改字体?如果是这样,怎么做?我一般使用比例字体,但是只针对dired模式和shell模式,我想切换成非比例字体。这些模式没有特殊的面,只是使用默认的面,所以不能只通过设置字体来完成。我希望能够根据主要模式自动切换,也许使用钩子(Hook)。
最佳答案
使用模式 Hook ,使用 face remapping feature Hook 为当前缓冲区重新映射面的函数:
(defun use-monospace ()
"Switch the current buffer to a monospace font."
(face-remap-add-relative 'default '(:family "Monospace")))
(add-hook 'dired-mode-hook 'use-monospace)
...
关于emacs - 根据主要模式更改字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13179942/