2019-09-01 19:48:22 +08:00
|
|
|
|
[#]: collector: (lujun9972)
|
2019-09-01 19:51:44 +08:00
|
|
|
|
[#]: translator: (lujun9972)
|
2019-09-05 04:57:34 +08:00
|
|
|
|
[#]: reviewer: (wxy)
|
2019-09-01 19:48:22 +08:00
|
|
|
|
[#]: publisher: ( )
|
|
|
|
|
[#]: url: ( )
|
|
|
|
|
[#]: subject: (Eldoc Goes Global)
|
|
|
|
|
[#]: via: (https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/)
|
|
|
|
|
[#]: author: (Bozhidar Batsov https://emacsredux.com)
|
|
|
|
|
|
2019-09-05 04:57:34 +08:00
|
|
|
|
Emacs:Eldoc 全局化了
|
2019-09-01 19:48:22 +08:00
|
|
|
|
======
|
|
|
|
|
|
2019-09-05 04:57:34 +08:00
|
|
|
|
![](https://img.linux.net.cn/data/attachment/album/201909/05/045702d99v9vv4xy0aybmm.jpg)
|
|
|
|
|
|
2019-09-01 19:54:04 +08:00
|
|
|
|
最近我注意到 Emacs 25.1 增加了一个名为 `global-eldoc-mode` 的模式,它是流行的 `eldoc-mode` 的一个全局化的变体。而且与 `eldoc-mode` 不同的是,`global-eldoc-mode` 默认是开启的!
|
|
|
|
|
|
|
|
|
|
这意味着你可以删除 Emacs 配置中为主模式开启 `eldoc-mode` 的代码了:
|
2019-09-01 19:48:22 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
;; 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)
|
|
|
|
|
```
|
|
|
|
|
|
2019-09-05 04:57:34 +08:00
|
|
|
|
[有人说][1] `global-eldoc-mode` 在某些不支持的模式中会有性能问题。我自己从未遇到过,但若你像禁用它则只需要这样:
|
2019-09-01 19:48:22 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
(global-eldoc-mode -1)
|
|
|
|
|
```
|
2019-09-05 04:57:34 +08:00
|
|
|
|
|
2019-09-01 19:54:04 +08:00
|
|
|
|
现在是时候清理我的配置了!删除代码就是这么爽!
|
2019-09-01 19:48:22 +08:00
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
via: https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/
|
|
|
|
|
|
|
|
|
|
作者:[Bozhidar Batsov][a]
|
|
|
|
|
选题:[lujun9972][b]
|
2019-09-01 19:51:44 +08:00
|
|
|
|
译者:[lujun9972](https://github.com/lujun9972)
|
2019-09-05 04:57:34 +08:00
|
|
|
|
校对:[wxy](https://github.com/wxy)
|
2019-09-01 19:48:22 +08:00
|
|
|
|
|
|
|
|
|
本文由 [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
|