diff --git a/translated/tech/20181113 Eldoc Goes Global.md b/translated/tech/20181113 Eldoc Goes Global.md new file mode 100644 index 0000000000..8357841be1 --- /dev/null +++ b/translated/tech/20181113 Eldoc Goes Global.md @@ -0,0 +1,45 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Eldoc Goes Global) +[#]: via: (https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/) +[#]: author: (Bozhidar Batsov https://emacsredux.com) + +Eldoc 全局化了 +====== + +最近我注意到 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) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [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 diff --git a/translated/tech/20190524 Spell Checking Comments.md b/translated/tech/20190524 Spell Checking Comments.md new file mode 100644 index 0000000000..972ebbc940 --- /dev/null +++ b/translated/tech/20190524 Spell Checking Comments.md @@ -0,0 +1,41 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Spell Checking Comments) +[#]: via: (https://emacsredux.com/blog/2019/05/24/spell-checking-comments/) +[#]: author: (Bozhidar Batsov https://emacsredux.com) + +注释中的拼写检查 +====== + +我出了名的容易拼错单词。谢天谢地 Emacs 内置了一个名为 `flyspell` 的超棒模式来帮助像我这样的可怜的打字员。 +Flyspell 会在你输入时突出显示拼错的单词 (也就是实时的) 并提供有用的快捷键来快速修复该错误。 + +大多输入通常会对派生自 `text-mode` (比如 `markdown-mode`,`adoc-mode` )的主模式启用 `flyspell`,但是它对程序员也有所帮助,可以指出他在注释中的错误。所需要的只是启用 `flyspell-prog-mode`。我通常在所有的编程模式中都启用它: + +``` +(add-hook 'prog-mode-hook #'flyspell-prog-mode) +``` + +现在当你在注释中输入错误时,就会得到即使反馈了。要修复单词只需要将光标置于单词后,然后按下 `C-c $` (`M-x flyspell-correct-word-before-point`)。 + +![flyspell_prog_mode.gif][1] + +今天的分享就到这里!我要继续修正这些讨厌的拼写错误了! + +-------------------------------------------------------------------------------- + +via: https://emacsredux.com/blog/2019/05/24/spell-checking-comments/ + +作者:[Bozhidar Batsov;Emacs Redux][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://emacsredux.com +[b]: https://github.com/lujun9972 +[1]: https://emacsredux.com/assets/images/flyspell_prog_mode.gif