问题描述
我有emacs版本25.0,启用 prettify-symbols-mode
,并键入(lambda()t)
但它不会美化。如何使用这种模式?还有什么符号可用,如何配置它? 编辑: scratch
buffer and Markdown
模式,但是当我尝试了一个 Emacs-lisp
模式时,它已经过滤,但现在我有一个问号的lambda符号,我该如何解决?
编辑:我问相关问题。
编辑:解决了unicode问题。
prettify-symbols-mode
是本地缓冲区。如果要全局启用,请使用 global-prettify-symbols-mode
。
看到可能是因为Emacs找不到包含lambda字符的字体。尝试切换到像DejaVu Sans Mono这样的Unicode支持字体。
我相信只有Lambda才能开箱即用,只有在 emacs -lisp-mode
缓冲区。从启用 prettify-symbols
的缓冲区中检查 prettify-symbols-alist
的值以查看当前替换表。
如果你想添加其他符号的漂亮,你可以这样做,从 Chf prettify-symbols-mode RET
(add-hook'emacs-lisp-mode-hook
(lambda()
(push'(
I have emacs version 25.0, I enable prettify-symbols-mode
, and type (lambda () t)
but it doesn't prettify. How do I use this mode? Also what symbols are available and how can I configure it? Any references are appreciated.
Edit: Nothing happened in scratch
buffer and Markdown
mode, but when I tried in a Emacs-lisp
mode, It did prettify, but now I got a question mark instead of the lambda symbol, how do I fix that?
Edit: I asked the related question here.
Edit: This SO question solved the unicode problem.
prettify-symbols-mode
is buffer-local. If you want to enable it globally, use global-prettify-symbols-mode
.
The question mark you are seeing is probably because Emacs can't find a font that contains a lambda character. Try switching to a font with decent Unicode support like DejaVu Sans Mono.
I believe that only Lambda prettifies out of the box, and only in emacs-lisp-mode
buffers. Check the value of prettify-symbols-alist
from a buffer with prettify-symbols
enabled to see the current replacements table.
If you wish to add prettification of other symbols you can do something like this, from C-h f prettify-symbols-mode RET
:
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(push '("<=" . ?≤) prettify-symbols-alist)))
这篇关于如何使用emacs prettify-symbols-mode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!