TranslateProject/published/20181113 Eldoc Goes Global.md
2019-09-05 04:58:55 +08:00

49 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[#]: collector: (lujun9972)
[#]: translator: (lujun9972)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11306-1.html)
[#]: subject: (Eldoc Goes Global)
[#]: via: (https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/)
[#]: author: (Bozhidar Batsov https://emacsredux.com)
EmacsEldoc 全局化了
======
![](https://img.linux.net.cn/data/attachment/album/201909/05/045702d99v9vv4xy0aybmm.jpg)
最近我注意到 Emacs 25.1 增加了一个名为 `global-eldoc-mode` 的模式,它是流行的 `eldoc-mode` 的一个全局化的变体。而且与 `eldoc-mode` 不同的是,`global-eldoc-mode` 默认是开启的!
这意味着你可以删除 Emacs 配置中为主模式开启 `eldoc-mode` 的代码了:
```
;; That code is now redundant
(add-hook 'emacs-lisp-mode-hook #'eldoc-mode)
(add-hook 'ielm-mode-hook #'eldoc-mode)
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'eldoc-mode)
```
[有人说][1] `global-eldoc-mode` 在某些不支持的模式中会有性能问题。我自己从未遇到过,但若你像禁用它则只需要这样:
```
(global-eldoc-mode -1)
```
现在是时候清理我的配置了!删除代码就是这么爽!
--------------------------------------------------------------------------------
via: https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/
作者:[Bozhidar Batsov][a]
选题:[lujun9972][b]
译者:[lujun9972](https://github.com/lujun9972)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://emacsredux.com
[b]: https://github.com/lujun9972
[1]: https://emacs.stackexchange.com/questions/31414/how-to-globally-disable-eldoc