From 68b7a75f850fa40ecf872ef3ced241e24552f265 Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 19:48:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020181113=20Eldoc=20Go?= =?UTF-8?q?es=20Global?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20181113 Eldoc Goes Global.md --- sources/tech/20181113 Eldoc Goes Global.md | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sources/tech/20181113 Eldoc Goes Global.md diff --git a/sources/tech/20181113 Eldoc Goes Global.md b/sources/tech/20181113 Eldoc Goes Global.md new file mode 100644 index 0000000000..a16a4398d7 --- /dev/null +++ b/sources/tech/20181113 Eldoc Goes Global.md @@ -0,0 +1,45 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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 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][1] 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][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者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 From ead39a3de2d06b8578e3163dd794c59966d7c366 Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 19:49:17 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190524=20Spell=20Ch?= =?UTF-8?q?ecking=20Comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190524 Spell Checking Comments.md --- .../tech/20190524 Spell Checking Comments.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/tech/20190524 Spell Checking Comments.md diff --git a/sources/tech/20190524 Spell Checking Comments.md b/sources/tech/20190524 Spell Checking Comments.md new file mode 100644 index 0000000000..d6c34af73b --- /dev/null +++ b/sources/tech/20190524 Spell Checking Comments.md @@ -0,0 +1,39 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Spell Checking Comments) +[#]: via: (https://emacsredux.com/blog/2019/05/24/spell-checking-comments/) +[#]: author: (Bozhidar Batsov https://emacsredux.com) + +Spell Checking Comments +====== +I’m notorious for all the typos I make. Thankfully Emacs features an awesome built-in mode named `flyspell` to help poor typists like me. Flyspell highlights misspelled words as you type (a.k.a. on the fly) and has useful keybindings to quickly fix them. + +Most people typically enable `flyspell` only for major modes derived from `text-mode` (e.g. `markdown-mode`, `adoc-mode`), but it can really help programmers as well by pointing out typos they make in comments. All you need to do is enable `flyspell-prog-mode`. I typically enable it for all programming modes like this: + +``` +(add-hook 'prog-mode-hook #'flyspell-prog-mode) +``` + +Now you’ll get instant feedback when you make some typo in a comment. To fix a word just press `C-c $` (`M-x flyspell-correct-word-before-point`), while your cursor is behind it. + +![flyspell_prog_mode.gif][1] + +That’s all I have for you today! Keep fixing those nasty typos! + +-------------------------------------------------------------------------------- + +via: https://emacsredux.com/blog/2019/05/24/spell-checking-comments/ + +作者:[Bozhidar Batsov;Emacs Redux][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者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 From 7b4ee878c2d53e9e3bafc9d2582d21d11aa81a4d Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 19:51:44 +0800 Subject: [PATCH 3/6] translating by lujun9972 --- sources/tech/20181113 Eldoc Goes Global.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20181113 Eldoc Goes Global.md b/sources/tech/20181113 Eldoc Goes Global.md index a16a4398d7..20d0faa01f 100644 --- a/sources/tech/20181113 Eldoc Goes Global.md +++ b/sources/tech/20181113 Eldoc Goes Global.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lujun9972) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -35,7 +35,7 @@ via: https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/ 作者:[Bozhidar Batsov][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lujun9972](https://github.com/lujun9972) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 31db92bfb31baa074e29cd84d790bbce59eb3ac0 Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 19:54:04 +0800 Subject: [PATCH 4/6] translate done: 20181113 Eldoc Goes Global.md --- .../tech/20181113 Eldoc Goes Global.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {sources => translated}/tech/20181113 Eldoc Goes Global.md (63%) diff --git a/sources/tech/20181113 Eldoc Goes Global.md b/translated/tech/20181113 Eldoc Goes Global.md similarity index 63% rename from sources/tech/20181113 Eldoc Goes Global.md rename to translated/tech/20181113 Eldoc Goes Global.md index 20d0faa01f..8357841be1 100644 --- a/sources/tech/20181113 Eldoc Goes Global.md +++ b/translated/tech/20181113 Eldoc Goes Global.md @@ -7,11 +7,12 @@ [#]: via: (https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/) [#]: author: (Bozhidar Batsov https://emacsredux.com) -Eldoc Goes Global +Eldoc 全局化了 ====== -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: +最近我注意到 Emacs 25.1 增加了一个名为 `global-eldoc-mode` 的模式,它是流行的 `eldoc-mode` 的一个全局化的变体。而且与 `eldoc-mode` 不同的是,`global-eldoc-mode` 默认是开启的! + +这意味着你可以删除 Emacs 配置中为主模式开启 `eldoc-mode` 的代码了: ``` ;; That code is now redundant @@ -21,13 +22,12 @@ This means that you can get rid of all the code in your Emacs config that was wi (add-hook 'cider-repl-mode-hook #'eldoc-mode) ``` -There are [some reports][1] 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: +[有人说 ][1] `global-eldoc-mode` 在某些不支持的模式中会有性能问题。我自己重未遇到过,但若你像禁用它则只需要这样: ``` (global-eldoc-mode -1) ``` - -Now it’s time to clean up my config! Deleting code always feels so good! +现在是时候清理我的配置了!删除代码就是这么爽! -------------------------------------------------------------------------------- From a18d1882189bc41447d4ca0f9bb49337d5dc21df Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 20:06:56 +0800 Subject: [PATCH 5/6] translating by lujun9972 --- sources/tech/20190524 Spell Checking Comments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190524 Spell Checking Comments.md b/sources/tech/20190524 Spell Checking Comments.md index d6c34af73b..7cbef5619e 100644 --- a/sources/tech/20190524 Spell Checking Comments.md +++ b/sources/tech/20190524 Spell Checking Comments.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lujun9972) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -29,7 +29,7 @@ via: https://emacsredux.com/blog/2019/05/24/spell-checking-comments/ 作者:[Bozhidar Batsov;Emacs Redux][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lujun9972](https://github.com/lujun9972) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18aa88120862f911758404f170a66a4a7831362b Mon Sep 17 00:00:00 2001 From: darksun <lujun9972@gmail.com> Date: Sun, 1 Sep 2019 20:08:41 +0800 Subject: [PATCH 6/6] translate done: 20190524 Spell Checking Comments.md --- .../tech/20190524 Spell Checking Comments.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename {sources => translated}/tech/20190524 Spell Checking Comments.md (52%) diff --git a/sources/tech/20190524 Spell Checking Comments.md b/translated/tech/20190524 Spell Checking Comments.md similarity index 52% rename from sources/tech/20190524 Spell Checking Comments.md rename to translated/tech/20190524 Spell Checking Comments.md index 7cbef5619e..972ebbc940 100644 --- a/sources/tech/20190524 Spell Checking Comments.md +++ b/translated/tech/20190524 Spell Checking Comments.md @@ -7,21 +7,23 @@ [#]: via: (https://emacsredux.com/blog/2019/05/24/spell-checking-comments/) [#]: author: (Bozhidar Batsov https://emacsredux.com) -Spell Checking Comments +注释中的拼写检查 ====== -I’m notorious for all the typos I make. Thankfully Emacs features an awesome built-in mode named `flyspell` to help poor typists like me. Flyspell highlights misspelled words as you type (a.k.a. on the fly) and has useful keybindings to quickly fix them. -Most people typically enable `flyspell` only for major modes derived from `text-mode` (e.g. `markdown-mode`, `adoc-mode`), but it can really help programmers as well by pointing out typos they make in comments. All you need to do is enable `flyspell-prog-mode`. I typically enable it for all programming modes like this: +我出了名的容易拼错单词。谢天谢地 Emacs 内置了一个名为 `flyspell` 的超棒模式来帮助像我这样的可怜的打字员。 +Flyspell 会在你输入时突出显示拼错的单词 (也就是实时的) 并提供有用的快捷键来快速修复该错误。 + +大多输入通常会对派生自 `text-mode` (比如 `markdown-mode`,`adoc-mode` )的主模式启用 `flyspell`,但是它对程序员也有所帮助,可以指出他在注释中的错误。所需要的只是启用 `flyspell-prog-mode`。我通常在所有的编程模式中都启用它: ``` (add-hook 'prog-mode-hook #'flyspell-prog-mode) ``` -Now you’ll get instant feedback when you make some typo in a comment. To fix a word just press `C-c $` (`M-x flyspell-correct-word-before-point`), while your cursor is behind it. +现在当你在注释中输入错误时,就会得到即使反馈了。要修复单词只需要将光标置于单词后,然后按下 `C-c $` (`M-x flyspell-correct-word-before-point`)。 ![flyspell_prog_mode.gif][1] -That’s all I have for you today! Keep fixing those nasty typos! +今天的分享就到这里!我要继续修正这些讨厌的拼写错误了! --------------------------------------------------------------------------------