mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-04 22:00:34 +08:00
68b7a75f85
sources/tech/20181113 Eldoc Goes Global.md
1.7 KiB
1.7 KiB
Eldoc Goes Global
I recently noticed that Emacs 25.1 had added a global variant of the popular eldoc-mode
, called global-eldoc-mode
. What’s more - unlike eldoc-mode
, global-eldoc-mode
is enabled by default!
This means that you can get rid of all the code in your Emacs config that was wiring up eldoc-mode
for major modes that support it:
;; 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)
There are some reports that global-eldoc-mode
is causing performance issues in modes that don’t support it. I’ve never experienced this myself, but if you want to disable it you can simply do so like this:
(global-eldoc-mode -1)
Now it’s time to clean up my config! Deleting code always feels so good!
via: https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/
作者:Bozhidar Batsov 选题:lujun9972 译者:译者ID 校对:校对者ID