├── .gitignore
├── Emacs on Windows--getting started.org
├── Emacs on Windows--invoking external programs.org
├── GNUS.org
├── LICENSE
├── Mew.org
├── README.org
├── Sapcemacs FAQ.org
├── Shimbun.org
├── WanderLust.org
└── site-start.el
/.gitignore:
--------------------------------------------------------------------------------
1 | # macOS
2 | .DS_Store
3 | # Emacs Lisp
4 | *.elc
5 | # namazu
6 | index*
7 |
--------------------------------------------------------------------------------
/Emacs on Windows--getting started.org:
--------------------------------------------------------------------------------
1 | #+TITLE: Emacs On Windows 新手指南
2 | #+AUTHOR: Zhixing & LdBeth
3 | #+STARTUP: showall
4 |
5 | * 目录 :TOC:
6 | - [[#我对-emacs-的理解][我对 =Emacs= 的理解]]
7 | - [[#网上的优秀资源待补充][网上的优秀资源(待补充)]]
8 | - [[#一年成为-emacs-高手像神一样使用编辑器-from-陈斌][一年成为 Emacs 高手(像神一样使用编辑器) from 陈斌。]]
9 | - [[#spacemacs-rocks-from-子龙山人][Spacemacs-rocks from 子龙山人]]
10 | - [[#emacs-中文论坛][Emacs 中文论坛]]
11 | - [[#planet-emacsen][Planet Emacsen]]
12 | - [[#必须知道的知识点][必须知道的知识点]]
13 | - [[#三个命令][三个命令]]
14 | - [[#emacs-on-windows-下载与图片支持][=Emacs on Windows= 下载与图片支持]]
15 | - [[#emacs-on-windows-启动][=Emacs on Windows= 启动]]
16 | - [[#设置-home-目录与-portable-emacs][设置 =HOME= 目录与 =Portable Emacs=]]
17 | - [[#对-emacs-进行简单配置][对 =Emacs= 进行简单配置]]
18 | - [[#安装-package][安装 =package=]]
19 | - [[#使用-aspell-来检查拼写][使用 =Aspell= 来检查拼写]]
20 | - [[#在emacs中写latex][在Emacs中写LaTeX]]
21 | - [[#如何使用大牛的配置][如何使用大牛的配置]]
22 | - [[#如何使用-spacemacs][如何使用 Spacemacs]]
23 | - [[#如何使用子龙山人的配置][如何使用子龙山人的配置]]
24 | - [[#如何使用陈斌的配置][如何使用陈斌的配置]]
25 | - [[#编码问题][编码问题]]
26 | - [[#为不同的程序设置编码][为不同的程序设置编码]]
27 | - [[#修改编码][修改编码]]
28 | - [[#待补充尽管提意见][待补充(尽管提意见)……]]
29 |
30 | * 我对 =Emacs= 的理解
31 | 1. 只要是关于文本的,它就能实现,前提是你会 lisp 语言。
32 | 2. Emacs 对 Windows 的支持是因为它的开发者想让大家体验自由软件,并希望大家可以
33 | 转向 Linux 系统。
34 | 3. 它是一个文本编辑器,只适合做关于文本类的事情,拿它去听音乐、看视频不是一个
35 | 好的选择。尽管 Hack Emacs 是一件有趣的事。
36 | 4. 请读一读[[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-zh.org][一年成为 Emacs 高手(像神一样使用编辑器)]],坚定信仰。
37 | 5. 待补充……
38 |
39 | * 网上的优秀资源(待补充)
40 | ** [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-zh.org][一年成为 Emacs 高手(像神一样使用编辑器)]] from 陈斌。
41 | 这是不得不推荐的资源,因为他讲的真的很好。也包括一些 FAQ。
42 |
43 | ** [[https://github.com/emacs-china/Spacemacs-rocks][Spacemacs-rocks]] from 子龙山人
44 | 一系列视频 (Season 2),Emacs 入门&专业配置都讲的很好。
45 |
46 | ** [[https://emacs-china.org/][Emacs 中文论坛]]
47 | 可能是最好的中文论坛。
48 |
49 | ** [[http://planet.emacsen.org][Planet Emacsen]]
50 | 学习 Lisp 有成以后可以来这里找些小众技巧,锻练英语阅读。
51 |
52 | * 必须知道的知识点
53 | ** 三个命令
54 | M-x describe-variable, 快捷键 C-h v, =查看变量=
55 | M-x describe-function, 快捷键 C-h f, =查看命令=
56 | M-x describe-key, 快捷键 C-h k, =查看快捷键=
57 | 上面的三个命令配合Smex来使用可以让你快速了解你想知道的事情。Smex可以在你不知道整
58 | 个命令或者函数名的时候进行模糊搜索。
59 |
60 | * =Emacs on Windows= 下载与图片支持
61 | 直接从[[https://www.gnu.org/software/emacs/][官网]] 下载是比较好的,选择一个临近的站点,直接下载即可。在下载页面都有官
62 | 方的文件说明。官网现在提供Emacs25.1的软件包和支持包:
63 | =emacs-n-x86_64-w64-mingw32.zip (64 bit)= and =emacs-n-i686-w64-mingw32.zip (32
64 | bit)= 下载后直接解压即可。还有相对应的支持包=emacs-n-x-deps.zip= , 把里面的文件复
65 | 制进上面解压后的文件夹里,直接提供了图片的 dll 文件支持。在前面的版本(如
66 | Emacs24.5)里,下载后的软件里 =\share\emacs\24.5\= 文件夹下的README文件里可以找到
67 | 支持图片的dll文件下载地址。
68 |
69 | * =Emacs on Windows= 启动
70 | 解压后的文件里有四个文件夹:bin,libexec,share,var。直接运行 bin 文件夹里的
71 | =runemacs.exe= 即可。如果没有用过 Emacs, 请运行快捷键 ~Ctrl-h t~ ,查看 Emacs 自
72 | 带的文档,很短,很实用。需要说明的是,Emacs 运行时有一个 Home 目录,它存放你的
73 | Emacs 配置,比如快捷键设定、主题设定、package(可以理解为插件)下载之类的。查
74 | 看它也很简单, ~C-x C-f~ 后输入 ~/ 回车后看到的目录就是你的 HOME 目录,不过这
75 | 没有必要。在 Windows 平台上建议直接设定 Emacs 的工作目录:
76 | share/emacs/site-lisp/subdirs.el 里面设定它的工作目录即可。
77 |
78 | * 设置 =HOME= 目录与 =Portable Emacs=
79 | 可以参考[[https://emacs-china.org/t/windows-emacs/797/11][在 windows 平台将 emacs 绿色化的方法]]。
80 | 1. 设置HOME目录(需修改Emacs程序内文件)
81 | 新建文件 U:/Emacs/share/emacs/site-lisp/site-start.el
82 | 或者把下面的代码追加到此目录的subdirs.el文件里。
83 |
84 | #+begin_src emacs-lisp
85 | ;; 设定Emacs程序的HOME路径
86 | (defvar emacs-home
87 | (replace-regexp-in-string "bin/" "HOME/" invocation-directory :from-end))
88 |
89 | (unless (file-exists-p emacs-home)
90 | (make-directory emacs-home :parents))
91 |
92 | ;; 设定$HOME
93 | (setenv "HOME" (concat emacs-home))
94 | #+end_src
95 | 或者可以这样做:
96 | #+begin_src emacs-lisp
97 | ;; 可以直接获取优盘的盘符U:/ 设定为变量 disk
98 | (defvar disk (concat (substring data-directory 0 3)))
99 | (setenv "HOME" (concat disk "Home/"))
100 | ;; 上面的 home 和 home-spacemacs 用来存放两份不同的配置。
101 | #+end_src
102 |
103 | 2. 还有一种方法也可以实现 *Emacs* 的绿色化,而且不用修改 *Emacs* 的原文件。
104 | 1) 新建文件 *.emacs*
105 | 文件位置可以自己定。写入下面的代码:
106 | #+BEGIN_SRC emacs-lisp
107 | ;; 获取优盘的盘符,并设置home路径
108 | (defvar emacs-home (concat (substring data-directory 0 3) "HOME/"))
109 | ;; 创建目录
110 | (unless (file-exists-p emacs-home)
111 | (make-directory emacs-home :parents))
112 | ;; 设置$HOME目录:如 g:/Home/
113 | (setenv "HOME" (concat emacs-home))
114 | (load-file "~/.emacs.d/init.el")
115 | #+END_SRC
116 |
117 | 2) 新建 *emacs.bat* 文件。
118 | #+BEGIN_SRC shell
119 | runemacs.exe -l g:/.emacs
120 | #+END_SRC
121 | 上面的 *runemacs.exe* 和 *.emacs* 分别替换成相应的路径即可。
122 |
123 | 3) 双击 *bat* 文件运行即可。
124 |
125 | * 对 =Emacs= 进行简单配置
126 | HOME 目录怎么存放配置呢?打开 Emacs, ~C-x C-f~ 输入 =~/.emacs.d/init.el= 或者
127 | =~/.emacs= 提示是否要新建文件,yes 就可以了(我主要用 init.el,后面提到配置文件
128 | 也是指这个文件,这两个文件没有区别)。然后输入配置(举例):
129 |
130 | #+begin_src emacs-lisp
131 | ;; 开启行号
132 | (global-linum-mode 1)
133 | #+end_src
134 |
135 | 输入之后在代码末尾 ~C-x C-e~ ,可以立即开启行号。或者, ~M-x eval-buffer~ 也可以。
136 | 以后你的配置都可以这样做,如果没有效果,请重启试试。
137 |
138 | * 安装 =package=
139 | 要想让 Emacs 可以高效的工作,可以 DIY(通过编辑 init.el),也可以站在巨人的肩
140 | 膀上(安装 package)。已经有许多人写了各种各样的 package,你可以安装它,来使得
141 | Emacs 更加好用。[[http://www.melpa.org/][Melpa]] 上列了许多 package,每个 package 都有简单的说明和源代码
142 | 链接。找到需要的 package,然后安装即可。
143 |
144 | 把下面的代码放进你的配置(init.el)里。有的时候 package 下载的时候需要翻墙的,这
145 | 里使用的是子龙山人做的镜像,体验会更好。
146 | #+begin_src emacs-lisp
147 | (require 'package)
148 | (setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")
149 | ("melpa" . "http://elpa.emacs-china.org/melpa/")))
150 | (package-initialize)
151 | #+end_src
152 | 重启 Emacs,运行命令: ~M-x package-list-package~; ~M-x package-refresh-contents~;
153 | ~C-s NAME~ (你需要安装的 package 名字),找到后用鼠标点击,安装即可。
154 | 或者 ~M-x package-install RET NAME(package) RET~
155 |
156 | 还有一种方法比较新颖,也很方便:使用 use-package(也是一个 package)
157 | 在上面的代码后面加上如下代码即可:
158 |
159 | #+begin_src emacs-lisp
160 | ;; Install use-package
161 | (unless (package-installed-p 'use-package)
162 | (package-refresh-contents)
163 | (package-install 'use-package))
164 | ;; Automatically install package, such as cnfonts
165 | (use-package cnfonts
166 | :config
167 | (cnfonts-enable)
168 | (add-hook 'after-make-frame-functions #'cnfonts-set-font-with-saved-step)
169 | #+end_src
170 | 建议每个人都安装这个 package,或者通过网络上的其它方法来设置中英文字体,否则
171 | Emacs 会很卡。
172 |
173 | * 使用 =Aspell= 来检查拼写
174 | 在 Windows 平台,可以使用 Aspell 等程序来实现对 Emacs 中 org 文件内容检查拼写。
175 | 配置也很简单,而且依然可以便携,因为安装好的 Aspell 程序是便携的(可以直接拷贝
176 | 它的安装文件,放在优盘里),Emacs 只要调用它就可以了。我会把我使用的 Aspell 程
177 | 序压缩后放在群文件里。安装 =flyspell-correct= 后,添加下面的代码即可:
178 | #+begin_src emacs-lisp
179 | (add-to-list 'exec-path "~/Aspell/bin/")
180 | (setq ispell-program-name "aspell")
181 | (use-package flyspell-correct-ido
182 | :config
183 | (require 'flyspell-correct-ido)
184 | (setq flyspell-correct-interface #'flyspell-correct-ido))
185 | #+end_src
186 | 具体 flyspell-correct 的使用见它的 README
187 |
188 | * 在Emacs中写LaTeX
189 | 在Emacs里直接安装Auctex即可。(前提是安装了texlive,并加进了$PATH中,同时安装了use-package)
190 | #+BEGIN_SRC emacs-lisp
191 | (use-package tex
192 | :ensure t
193 | :config
194 | )
195 | #+END_SRC
196 | 打开任意一个.tex文件,C-c C-c,即可选择编译程序并进行编译,C-c C-l来预览。
197 |
198 | * 如何使用大牛的配置
199 | 强烈推荐使用 [[https://github.com/redguardtoo/emacs.d][陈斌的配置]] 或者是 [[https://github.com/syl20bnr/spacemacs/tree/develop][Spacemacs]] 。 [[https://github.com/zilongshanren/spacemacs-private][子龙山人的配置]] 是私人定制的,使用
200 | Spacemacs 的用户建议把他的配置下载下来看看代码,会对自己配置 Spacemacs 有很好
201 | 的借鉴。
202 |
203 | ** 如何使用 [[http://spacemacs.org][Spacemacs]]
204 | 直接下载 [[https://github.com/syl20bnr/spacemacs/tree/develop][Spacemacs]] 的 [[https://github.com/syl20bnr/spacemacs/archive/develop.zip][Zip]] 文件,然后放到 HOME/.emacs.d/下面即可。按照说明进行
205 | 操作即可。如果出现错误可能是墙的原因,请添加下面的代码到 HOME 目录下.spacemacs
206 | 文件里=dotspacemacs/user-init= 部分
207 |
208 | #+begin_src emacs-lisp
209 | (setq configuration-layer--elpa-archives
210 | '(("melpa-cn" . "http://elpa.emacs-china.org/melpa/")
211 | ("org-cn" . "http://elpa.emacs-china.org/org/")
212 | ("gnu-cn" . "http://elpa.emacs-china.org/gnu/")))
213 | #+end_src
214 | 然后重启。
215 |
216 | 详见 [[http://spacemacs.org/doc/FAQ][FAQ]] ([[https://github.com/LdBeth/Emacs-for-Noobs/blob/master/Sapcemacs%2520FAQ.org][中文]])
217 |
218 | ** 如何使用子龙山人的配置
219 | 直接下载 Spacemacs 的 zip 文件,解压到 HOME/.emacs.d/下面。
220 | 然后下载 [[https://github.com/zilongshanren/spacemacs-private][子龙山人]] 的 [[https://github.com/zilongshanren/spacemacs-private/archive/develop.zip][配置文件]] ,解压到 HOME/.spacemacs.d/下面
221 | 然后运行 runemacs.exe。
222 |
223 | ** 如何使用陈斌的配置
224 | 他的 [[https://github.com/redguardtoo/emacs.d][github]] 上面详细说明了他的配置安装方法。
225 |
226 | 安装过程中如果无法安装package,可能是源的问题,需要更改源。
227 | 更改 =~/.emacs.d/lisp/init-elpa.el= 里面设置 *package-archives* 的部分
228 | 把 https://melpa.org/packages/ 换成 http://elpa.emacs-china.org/melpa/
229 | 把 https://stable.melpa.org/packages/ 换成 http://elpa.emacs-china.org/melpa-stable/
230 |
231 | * 编码问题
232 | ** 为不同的程序设置编码
233 | 许多程序是由Linux系统上移植过来的,所以对Windows用户可能并不友好。
234 | 常见的编码问题是Emacs中的Eshell和Shell中出现乱码。可以使用下面 =修改编码= 的方法来
235 | 解决问题。
236 | 如果是rg,pt,git等小程序导致的问题,可以使用论坛上网友提供的一种方法。通过设置
237 | 程序的输入输出编码来解决问题。
238 | #+BEGIN_SRC emacs-lisp
239 | ;; https://emacs-china.org/t/topic/3894/22
240 | (when (eq system-type 'windows-nt)
241 | (set-default 'process-coding-system-alist
242 | '(("[pP][lL][iI][nN][kK]" gbk-dos . gbk-dos)
243 | ("[cC][mM][dD][pP][rR][oO][xX][yY]" gbk-dos . gbk-dos)
244 | ("[rR][gG]" utf-8-dos . gbk-dos)
245 | ("[pP][tT]" utf-8-dos . gbk-dos)
246 | ("[gG][iI][tT]" utf-8-dos . gbk-dos)
247 | )))
248 | #+END_SRC
249 |
250 | ** 修改编码
251 | Windows 中文系统的编码是 GBK,也就是说新建的文件默认编码是 GBK,这可能会导致
252 | Emacs 或者其它 Unix 系应用在处理这些文件的时候出现乱码。同时,将 Emacs 中默认
253 | 文件编码设置为 UTF-8 并设置 Unix 风格的换行符,有助于文件能被其它操作系统正常
254 | 处理。
255 | #+BEGIN_SRC emacs-lisp
256 | ;; 转自 http://blog.csdn.net/bbeikke/article/details/8629677
257 | ;; 编码设置 begin
258 | (set-language-environment 'Chinese-GB)
259 | ;; default-buffer-file-coding-system 变量在 emacs23.2 之后已被废弃,使用 buffer-file-coding-system 代替
260 | (set-default buffer-file-coding-system 'utf-8-unix)
261 | (set-default-coding-systems 'utf-8-unix)
262 | (setq-default pathname-coding-system 'euc-cn)
263 | (setq file-name-coding-system 'euc-cn)
264 | ;; 另外建议按下面的先后顺序来设置中文编码识别方式。
265 | ;; 重要提示:写在最后一行的,实际上最优先使用; 最前面一行,反而放到最后才识别。
266 | ;; utf-16le-with-signature 相当于 Windows 下的 Unicode 编码,这里也可写成
267 | ;; utf-16 (utf-16 实际上还细分为 utf-16le, utf-16be, utf-16le-with-signature 等多种)
268 | (prefer-coding-system 'cp950)
269 | (prefer-coding-system 'gb2312)
270 | (prefer-coding-system 'cp936)
271 | ;;(prefer-coding-system 'gb18030)
272 | ;(prefer-coding-system 'utf-16le-with-signature)
273 | (prefer-coding-system 'utf-16)
274 | ;; 新建文件使用 utf-8-unix 方式
275 | ;; 如果不写下面两句,只写
276 | ;; (prefer-coding-system 'utf-8)
277 | ;; 这一句的话,新建文件以 utf-8 编码,行末结束符平台相关
278 | (prefer-coding-system 'utf-8-dos)
279 | (prefer-coding-system 'utf-8-unix)
280 | ;; 编码设置 end
281 | #+END_SRC
282 |
283 | * 待补充(尽管提意见)……
284 |
285 | #+BEGIN_QUOTE
286 | 不过在没有一年的修炼之前 千万不要猜 Emacs 不能做什么... 重点是头脑灵活,既坚信
287 | Emacs 无所不能,也适当变通
288 |
289 | -- 陈斌《一年成为 Emacs 高手》
290 | #+END_QUOTE
291 |
292 |
--------------------------------------------------------------------------------
/Emacs on Windows--invoking external programs.org:
--------------------------------------------------------------------------------
1 | #+TITLE: Emacs on Windows 外部程序调用
2 | #+AUTHOR: Zhixing
3 | #+STARTUP: showall
4 |
5 | * 目录 :TOC:
6 | - [[#程序调用][程序调用]]
7 | - [[#gnupg][GnuPG]]
8 | - [[#git][Git]]
9 | - [[#texlive][TexLive]]
10 |
11 | * 程序调用
12 | =Emacs= 在 =Windows= 上使用时要不可避免的调用外部程序,一般情况下是要把可执行文件的路
13 | 径加入到 =exec-path= 里面即可。如:
14 | #+BEGIN_SRC emacs-lisp
15 | (add-to-list 'exec-path "path/to/program/")
16 | #+END_SRC
17 |
18 | 但是,对某些程序来说,上面的方法没有产生应有的效果。winterTTr 提供了
19 | 一个比较省事的方法: [[http://www.voidcn.com/blog/winterttr/article/p-3231165.html][emacs 调用外部命令的环境设置]] ,主要原因是外部程序的调
20 | 用有时也需要 emacs 的子进程去调用,所以需要把路径加入到 =PATH= 里面。
21 | 把下面的代码加进配置即可。
22 |
23 | #+BEGIN_SRC emacs-lisp
24 | (defun wttr/prepend-to-exec-path (path)
25 | "prepand the path to the emacs intenral `exec-path' and \"PATH\" env variable.
26 | Return the updated `exec-path'"
27 | (setenv "PATH" (concat (expand-file-name path)
28 | path-separator
29 | (getenv "PATH")))
30 | (setq exec-path
31 | (cons (expand-file-name path)
32 | exec-path)))
33 |
34 | (mapc #'wttr/prepend-to-exec-path
35 | (reverse ( list
36 | ;; your path to program
37 | "~/.emacs.d/extra-bin/clang"
38 | (concat Emacs "program/Aspell/bin/")
39 | )))
40 | #+END_SRC
41 |
42 |
43 | * GnuPG
44 | 默认:加密时选择加密方法,修改文件后保存时需要重新输入密码(重新加密)。
45 | 在 =Windows= 上可以把这个软件做成便携软件直接放在优盘等地方,换电脑时不必重新安装。
46 | 官网直接提供了制件便携版的方法。
47 |
48 | 调用这个程序时,上面的方法没有产生应有的效果,可以使用下面的代码:
49 | #+BEGIN_SRC emacs-lisp
50 | (custom-set-variables '(epg-gpg-program "path/to/program/"))
51 | #+END_SRC
52 |
53 |
54 | * Git
55 | =Git= 做为一个轻量、高效的版本控制工具,是 =Emacser= 应该掌握的工具之一。
56 | 它的学习也非常简单,官网提供的 =Pro Git 中文版= 可以让你在一晚上学会它的使用。
57 | 它的初始配置也非常简单,只需要运行 =config= 来设置一下自己的用户名和邮箱就可以了。
58 | 我这里要说的是 =Portable Git= 的初始设置。
59 | 首先运行 =git-bash.exe= ,直接运行手册上的命令即可:
60 | #+BEGIN_SRC emacs-lisp
61 | $ git config --system user.name "yourname"
62 | $ git config --system user.email youremail
63 | #+END_SRC
64 |
65 | 运行上面的命令之后,配置会自动加在系统配置里面(
66 | =\PortableGit\mingw64\etc\gitconfig=)
67 | 这不在重启或者移动到另一个电脑上时发生改变。
68 | 如果想在不同的电脑上使用不同的配置,只需要把上面的命令中 =system= 换成 =global= 即可。不
69 | 过不建议这么做,因为它会把配置放在电脑上。想分别设置的话可以放在你的 =Repository= 的文件
70 | 夹 =.git= 里面。
71 |
72 | * TexLive
73 | 使用 =LaTeX= 可以非常方便的把 =org= 文件导成 =PDF= 文件。
74 | 官网提供了各种安装方法,安装之后把路径加入到上面的代码中即可。
75 |
76 |
--------------------------------------------------------------------------------
/GNUS.org:
--------------------------------------------------------------------------------
1 | #+TITLE: GNUS 使用简介
2 | #+AUTHOR: LdBeth
3 | #+STARTUP: showall
4 |
5 | GNUS 常常用来作为 Emacs 中的邮件客户端,但是我不是很推荐用它来看邮件。因为它的默
6 | 认行为和其它邮件客户端相比有些奇怪,用 IMAP 连接超慢等,种种问题。不过用它来上新
7 | 闻组,看 Mailing List 倒很不错。
8 |
9 | * 基本配置
10 | 没什么额外可以说的,创建 =~/.gnus.el= 文件,里面配置如下:
11 |
12 | #+begin_src emacs-lisp
13 | ;; 这是我现在正在使用的配置,直接拿来做范例
14 |
15 | ;;;;;;;;;;;;;;;;;;;;
16 | ;; USER
17 | ;;;;;;;;;;;;;;;;;;;;
18 | ;; 先像这样配置新闻组
19 | (setq gnus-select-method '(nntp "news.gwene.org"))
20 | (add-to-list 'gnus-secondary-select-methods '(nntp "news.newsfan.net"))
21 | ;; 下面是 Maildir 配置的范例。可以成功使用,但是我觉得对 GNUS 来说不是很适合的方案
22 | ;; (add-to-list 'gnus-secondary-select-methods '(nnml ""))
23 | ;; (eval-after-load "mail-source"
24 | ;; '(add-to-list 'mail-sources '(maildir :path "~/Mail/inbox/"
25 | ;; :subdirs ("cur" "new"))))
26 |
27 | ;;;;;;;;;;;;;;;;;;;;
28 | ;; LANGUAGE
29 | ;;;;;;;;;;;;;;;;;;;;
30 | (setq gnus-default-charset 'gbk;; 编码设置,鉴于一些中文的新闻组还在用 GBK,而且文本和标题用的是不同编码,设置得复杂点
31 | gnus-group-name-charset-group-alist;; 关于编码设置,有篇不错的说明:http://blog.chinaunix.net/uid-45094-id-3011974.html
32 | '((".*" . cn-gb-2312)
33 | ("\\.com\\.cn" . gbk)
34 | ("news\\.newsfan\\.net" . gb18030))
35 | gnus-summary-show-article-charset-alist
36 | '((1 . cn-gb-2312)
37 | (2 . gb18030)
38 | (3 . chinese-iso-8bit)
39 | (4 . gbk)
40 | (5 . big5)
41 | (6 . utf-8))
42 | gnus-newsgroup-ignored-charsets
43 | '(unknown-8bit x-unknown iso-8859-1))
44 |
45 | (setq mm-coding-system-priorities '(iso-8859-1 gb18030 utf-8))
46 |
47 | (defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter)
48 | (add-to-list 'rfc2047-charset-encoding-alist '(gb18030 . B))
49 | (add-to-list 'rfc2047-charset-encoding-alist '(gbk . B))
50 |
51 | ;;;;;;;;;;;;;;;;;;;;
52 | ;; TITLE
53 | ;;;;;;;;;;;;;;;;;;;;
54 | (add-to-list 'nnmail-extra-headers nnrss-description-field)
55 | (setq gnus-visible-headers
56 | "^\\(^From:\\|^Subject:\\|^Date:\\|^Followup-To:
57 | \\|^X-Newsreader:\\|^User-Agent:\\|^X-Mailer:
58 | \\|Line:\\|Lines:\\|Content-Type:\\|NNTP-Posting-Host\\)")
59 |
60 | ;;;;;;;;;;;;;;;;;;;;
61 | ;; FRAME
62 | ;;;;;;;;;;;;;;;;;;;;
63 |
64 | ;; (gnus-add-configuration
65 | ;; '(article
66 | ;; (vertical 1.0
67 | ;; (summary .40 point)
68 | ;; (article 1.0))))
69 |
70 | (gnus-add-configuration;; 显示侧边栏的窗口布局
71 | '(article
72 | (horizontal 1.0
73 | (vertical 25
74 | (group 1.0))
75 | (vertical 1.0
76 | (summary 0.25 point)
77 | (article 1.0)))))
78 | (gnus-add-configuration
79 | '(summary
80 | (horizontal 1.0
81 | (vertical 25
82 | (group 1.0))
83 | (vertical 1.0
84 | (summary 1.0 point)))))
85 | ;;;;;;;;;;;;;;;;;;;;
86 | ;; PICTURES
87 | ;;;;;;;;;;;;;;;;;;;;
88 | ;; 加了这些配置就能显示图片了,macOS 用户推荐用 MacPort,用平滑滚动看图比较爽
89 | (auto-image-file-mode)
90 | (setq mm-inline-large-images t)
91 | (add-to-list 'mm-attachment-override-types "image/*")
92 |
93 |
94 | (setq gnus-posting-styles;; 解决某些乱码问题
95 | '((".*"
96 | (name "LdBeth")
97 | (address "andpuke@foxmail.com")
98 | (signature "macOS Sierra, Emacs+Gnus\n")
99 | (eval (setq mm-coding-system-priorities
100 | '(iso-8859-1 utf-8))))
101 | ("^cn\\.comp"
102 | (name "LdBeth 好船")
103 | (address "andpuke@foxmail.com")
104 | (eval (setq mm-coding-system-priorities
105 | '(iso-8859-1 gb2312 utf-8))))
106 | ("^tw\\.comp"
107 | (name "LdBeth")
108 | (address "andpuke@foxmail.com")
109 | (eval (setq mm-coding-system-priorities
110 | '(iso-8859-1 big5 utf-8))))))
111 |
112 | #+end_src
113 |
114 | 为了方便起见,以下两行应该放在 =init.el= 里面。
115 |
116 | #+begin_src emacs-lisp
117 | (setq user-full-name "LdBeth")
118 | (setq user-mail-address "andpuke@foxmail.com")
119 | #+end_src
120 |
121 | * 发信收信
122 | 因为我自己没有用 GNUS 收信,所以也不好讲什么细节。
123 |
124 | 推荐看 [[https://www.emacswiki.org/emacs/MultipleSMTPAccounts][EmacsWiKi]] 里面的介绍。
125 |
126 | * 常见问题
127 | http://blog.csdn.net/lujun9972/article/details/46002803
128 |
129 | 来自 暗日 的博客。比较详细了。
130 |
131 | * 待续
132 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Mew.org:
--------------------------------------------------------------------------------
1 | #+TITLE: Mail in Emacs World
2 | #+AUTHOR: Ldbeth
3 | #+STARTUP: showall
4 |
5 | 本文内容节选自 Emacs 中文化指南 以及 Mew 使用手册等资料。主要针对 Windows 用户。因为在
6 | BSD 或 Linux 上我更推荐用 notmuch。
7 |
8 | * 目录 :TOC:
9 | - [[#为什么使用-mew][为什么使用 Mew?]]
10 | - [[#开始安装][开始安装]]
11 | - [[#使用][使用]]
12 | - [[#一些高级技巧][一些“高级”技巧]]
13 | - [[#多个邮箱][多个邮箱]]
14 | - [[#自动输入密码][自动输入密码]]
15 | - [[#待续][待续]]
16 |
17 | * 为什么使用 Mew?
18 | 1. Mew 是由日本人编写的,对中文支持不错。
19 | 2. 用外部可执行文件收信,比 Gnus 快。而且 Gnus 的默认配置不适合看邮件。
20 | 3. 可以在 Windows 上使用。不像 mu4e 或者 notmuch 需要其它工具来负责收发信件。
21 | 4. 邮件分类功能很强(其实我没认真用过)。
22 | 5. 老牌软件。
23 |
24 | * 开始安装
25 | 1. 从 [[http://www.mew.org/en/][官网]] 下载打包好的文件。把 exe 文件放在 =/bin= 文件夹里。把 el 文件放在
26 | =load-path= 里。
27 | 2. 在 [[http://www.stunnel.org/downloads.html?extra=/binaries.html][这里]] 下载并安装 stunnel,记得再下个 openSSL。如果你不需要 SSL 的话跳过这步
28 | 也没关系。
29 | 3. 配置参考:
30 | #+begin_src emacs-lisp
31 | ;;==== .init.el =====
32 | (autoload 'mew "mew" nil t)
33 | (autoload 'mew-send "mew" nil t)
34 |
35 | ;; Optional setup (Read Mail menu for Emacs 21):
36 | (if (boundp 'read-mail-command)
37 | (setq read-mail-command 'mew))
38 |
39 | ;; Optional setup (e.g. C-xm for sending a message):
40 | (autoload 'mew-user-agent-compose "mew" nil t)
41 | (if (boundp 'mail-user-agent)
42 | (setq mail-user-agent 'mew-user-agent))
43 | (if (fboundp 'define-mail-user-agent)
44 | (define-mail-user-agent
45 | 'mew-user-agent
46 | 'mew-user-agent-compose
47 | 'mew-draft-send-message
48 | 'mew-draft-kill
49 | 'mew-send-hook))
50 | (setq mew-pop-delete nil)
51 | (setq user-full-name "xxxx")
52 | (setq user-mail-address "xxxx@gmail.com")
53 | (setq mew-cite-fields '("Date:" "From:"))
54 | (setq mew-cite-format "On %s %s wrote:\n\n")
55 |
56 | ;;==== .mew.el ====
57 | (setq mew-prog-ssl "C:/Program Files/stunnel/stunnel.exe");改为你安装的路径
58 | (setq mew-ssl-verify-level 0)
59 | (setq mew-user "xxxx")
60 | (setq mew-mail-domain "gmail.com")
61 | (setq mew-pop-user "xxxx@gmail.com")
62 | (setq mew-pop-auth 'pass)
63 | (setq mew-pop-ssl t)
64 | (setq mew-pop-delete nil)
65 | (setq mew-pop-server "pop.gmail.com")
66 | (setq mew-pop-ssl-port "995")
67 | (setq mew-smtp-user "gutianhit@gmail.com")
68 | (setq mew-smtp-ssl t)
69 | (setq mew-smtp-server "smtp.gmail.com")
70 | (setq mew-smtp-ssl-port "465")
71 | #+end_src
72 |
73 | * 使用
74 | 这里给出一些常用命令。
75 |
76 | | 按键 | 命令 |
77 | |---------------------+------------------------------------------------|
78 | | W | 撰写新邮件 |
79 | | a | 回复邮件,不带引用 |
80 | | A | 回复邮件,带引用 |
81 | | r | 重新发送邮件 |
82 | | f | 转发邮件 |
83 | | SPC(空格) | 阅读邮件 |
84 | | y | 保存文件(可以保存信件全文,信件正文,附件) |
85 | | C-c C-l | 转换当前邮件的编码格式 |
86 | | C-c C-a | 加入地址薄 |
87 | | C-u C-c C-a | 比 C-c C-a 多加入昵称和名字 |
88 | | C-c C-q | 不保存退出 |
89 | | C-c C-a | 准备插入附件 |
90 | | mew-attach-copy | 用复制方式加入附件 |
91 | | mew-attach-link | 用链接方式加入附件 |
92 | | mew-attach-delete | 删除附件 |
93 | | C-c C-c | 发送邮件 |
94 | | C-c RET(回车) | 保存邮件到发送队列 |
95 | | C | 如果设置了多个邮箱,用 C 命令切换 |
96 | | Q | 退出 Mew |
97 |
98 | * 一些“高级”技巧
99 | ** 多个邮箱
100 | #+begin_src emacs-lisp
101 | ;; 需要注意, =mailbox-type= 和 =pop-auth= 设置的值是没有引号的
102 | (setq mew-config-alist
103 | '(("yahoo"
104 | ("name" . "Jerry")
105 | ("user" . "myname")
106 | ("smtp-server" . "127.0.0.1")
107 | ("smtp-port" . "5059")
108 | ("pop-server" . "127.0.0.1")
109 | ("pop-port" . "5058")
110 | ("smtp-user" . "myname")
111 | ("pop-user" . "myname")
112 | ("mail-domain" . "nonexist.com")
113 | ("mailbox-type" . pop)
114 | ("pop-auth" . pass)
115 | ("smtp-auth-list" . ("PLAIN" "LOGIN" "CRAM-MD5"))
116 | )
117 | ("default"
118 | ("name" . "Jerry")
119 | ("user" . "sample")
120 | ("smtp-server" . "127.0.0.1")
121 | ("smtp-port" . "25")
122 | ("pop-server" . "127.0.0.1")
123 | ("pop-port" . "110")
124 | ("smtp-user" . "sample")
125 | ("pop-user" . "sample")
126 | ("mail-domain" . "sample.net")
127 | ("mailbox-type" . pop)
128 | ("pop-auth" . pass)
129 | ("smtp-auth-list" . ("PLAIN" "LOGIN" "CRAM-MD5"))
130 | )))
131 |
132 | ;; 另外一种格式。然而我没有配置成功过,你可以实验几次。:P
133 | (setq mew-config-alist
134 | '(
135 | ;; Default fetch mailbox is IMAP
136 | (default
137 | (mailbox-type imap)
138 | (proto "%")
139 | (imap-server "imap.gmail.com")
140 | (imap-user "imapuser@gmail.com")
141 | (name "User Mew")
142 | (user "user")
143 | (mail-domain "gmail.com")
144 | (imap-size 0)
145 | (imap-delete t)
146 | (imap-queue-folder "%queue")
147 | (imap-trash-folder "%Trash") ;; This must be in concile with your IMAP box setup
148 | (smtp-auth-list ("PLAIN" "LOGIN" "CRAM-MD5"))
149 | (smtp-user "smtpuser@gmail.com")
150 | (smtp-server "smtp.gmail.com")
151 |
152 | ;; news group comp.lang.c
153 | (usenet
154 | (mailbox-type . mbox)
155 | (proto . -)
156 | (nntp-server "news.aioe.org")
157 | (nntp-user nil) ;; should be nil defaulty
158 | (nntp-header-only nil)
159 | (nntp-newsgroup "-comp.lang.c") ;; little '-'
160 | (nntp-size 0)
161 | (nntp-msgid-user "User Mew")
162 | (smtp-auth-list ("PLAIN" "LOGIN" "CRAM-MD5"))
163 | (smtp-user "smtpuser@gmail.com")
164 | (smtp-server "smtp.gmail.com")
165 |
166 | (mailinglist
167 | (mailbox-type pop)
168 | (proto +)
169 | (pop-server "pop.gmail.com")
170 | (name "User Mew")
171 | (user "user")
172 | (mail-domain "gmail.com")
173 | (pop-auth pass)
174 | (pop-user "popuser@gmail.com")
175 | (smtp-user "smtpuser@gmail.com")
176 | (smtp-server "smtp.gmail.com")
177 | ))
178 | #+end_src
179 |
180 | ** 自动输入密码
181 | 比较让人无语的是,为了安全,Mew 没有提供设置密码的地方。顶多只能让你把密码储
182 | 存在缓存文件里。如果密码是一些容易记住的有规律的东西,倒也没什么大不了的。
183 | 然而某些邮箱只能允许通过把密码设置为随机生成的 token 来使用邮
184 | 件客户端登录。这时密码就是 jdsdos432aojdsads 之类的蛋疼玩意了。即使你能把缓存有效时间设置得
185 |
186 | 但是,通过一些奇技淫巧,你可以实现启动 Mew 时自动输入密码。
187 | #+begin_src emacs-lisp
188 | (add-hook 'mew-init-hook
189 | (lambda ()
190 | (mew-passwd-set-passwd
191 | "john@foxmail.com@pop.qq.com:pop3"
192 | "disajdskadsjakld")))
193 | #+end_src
194 |
195 | 你应该可以看出来,前面一个 String 是 =邮箱账号@邮箱服务器地址:连接方式(pop3 或者 imap)= ,
196 | 后面一个就是密码了。
197 |
198 | * 待续
199 | 目前我正在使用 [[https://github.com/wanderlust/wanderlust][WanderLust]] ,这是一个同样非常强大的邮件的邮件客户端,完全由 Emacs Lisp 构成,但是缺乏详细的说明。
200 |
--------------------------------------------------------------------------------
/README.org:
--------------------------------------------------------------------------------
1 | #+TITLE: Emacs-on-Windows-for-Noobs
2 | #+STARTUP: showall
3 |
4 | 新手指南
5 |
6 | [[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
7 |
8 | 时常更新
9 |
10 | ** Windows 平台 Emacs 新手入门 QQ 群
11 | 群号: =623122498=
12 |
13 | 点击链接加入群 【Emacs on Windows 入门】:https://jq.qq.com/?\_wv=1027&k=46CEVpJ
14 |
15 | ** TODO Todo List
16 | + Mail Client
17 | - [ ] GNUS
18 | + [ ] Score
19 | - [X] Mew
20 | - [X] WanderLust
21 | + [ ] Eshell
22 | + [ ] Emacs Lisp
23 | + [ ] Wiki
24 | + [ ] Magit
25 |
26 | ** GNU General Public License v3.0
27 |
--------------------------------------------------------------------------------
/Sapcemacs FAQ.org:
--------------------------------------------------------------------------------
1 | #+TITLE: Spacemacs FAQ
2 | #+AUTHOR: LdBeth & Zhixing
3 | #+STARTUP: showall
4 |
5 | * 目录 :TOC:
6 | - [[#介绍][介绍]]
7 | - [[#常见问题][常见问题]]
8 | - [[#为什么我自己安装的插件在启动时被删除了呢][为什么我自己安装的插件在启动时被删除了呢?]]
9 | - [[#下载插件过程中一直出错怎么办][下载插件过程中一直出错,怎么办?]]
10 | - [[#状态栏的分界符有些奇怪][状态栏的分界符有些奇怪]]
11 | - [[#个人配置该放到哪里-user-init-还是-user-config][个人配置该放到哪里? =user-init= 还是 =user-config=]]
12 | - [[#如何][如何:]]
13 | - [[#安装现有-layer-没有提供的-package][安装现有 Layer 没有提供的 package?]]
14 | - [[#禁用某个-package][禁用某个 package?]]
15 | - [[#在选定的-major-mode-里面禁用某个-package][在选定的 Major-mode 里面禁用某个 package?]]
16 | - [[#在特定的-major-mode-中禁用自动补全-company][在特定的 major-mode 中禁用自动补全 company?]]
17 | - [[#直接启用-vim-的-vitual-line-移动][直接启用 vim 的 vitual line 移动?]]
18 | - [[#禁用某个-mode-的-evil-状态][禁用某个 mode 的 evil 状态]]
19 | - [[#设置-path-emacs-调用程序的路径][设置 =$PATH= (Emacs 调用程序的路径)]]
20 | - [[#防止选择文本占用系统剪贴板][防止选择文本占用系统剪贴板?]]
21 | - [[#使用-spacemacs-作为-git-提交信息的编辑器][使用 Spacemacs 作为 Git 提交信息的编辑器]]
22 | - [[#在-x11-终端下使用鼠标来复制粘贴][在 X11 终端下,使用鼠标来复制/粘贴]]
23 | - [[#重映射粘贴键使其能够多次粘贴复制过的文本][重映射粘贴键使其能够多次粘贴复制过的文本?]]
24 | - [[#windows][Windows]]
25 | - [[#为什么字体很难看][为什么字体很难看?]]
26 | - [[#如何让-emacs-显示图片收邮件上-irc][如何让 Emacs 显示图片、收邮件、上 IRC?]]
27 | - [[#为什么-spacemacs-logo-图片不显示][为什么 Spacemacs Logo 图片不显示?]]
28 | - [[#为什么有的插件无法安装][为什么有的插件无法安装?]]
29 |
30 | * 介绍
31 | 鉴于很多同学都是从 Spacemacs 直接开始上手 Emacs,这里提供了一些对于常见问题的
32 | 解答。(主要是从 Spacemacs 的官方文档翻译过来的。对于英语没问题的同学可以直接
33 | 在 Spacemacs 内按 ~SPC h SPC~ =helm-spacemacs-help= 查看文档。 )
34 |
35 | * 常见问题
36 | ** 为什么我自己安装的插件在启动时被删除了呢?
37 | 默认情况下 Spacemacs 只会保留在 Layer 中使用到的 Package(即插件)。你需要自
38 | 己写一个 Layer 来安装它。
39 |
40 | - 要安装一个不属于任何 Layer 的 Package,你可以把它加入
41 | =dotspacemacs-additional-packages= 。
42 | - 或者在配置文件中把 =dotspacemacs-install-packages= 设置成
43 | =used-but-keep-unused= 。这样 Sapcemacs 就不会删除你的任何插件。
44 |
45 | ** 下载插件过程中一直出错,怎么办?
46 | 如果你在国内,可以使用 emasc-china 的镜像,[[https://elpa.emacs-china.org][这里]] 有具体方法。请确保你所在的公
47 | 司/学校允许连接到镜像网站。同时你可能需要确保能够从 github 下载,因为有一部
48 | 分插件使用的是 github 而不是 elpa 源,必要时可以开代理。如果你没有办法用
49 | https,请把 =dotspacemacs-elpa-https= 设置成 =nil= 。
50 |
51 | 然后,多重启几次就可以了。
52 |
53 | ** 状态栏的分界符有些奇怪
54 | 设置 =dotspacemacs-default-font= 里面的 =:powerline-scale= 。
55 |
56 | ** 个人配置该放到哪里? =user-init= 还是 =user-config=
57 | 除非你知道这配置怎么起作用,或者在 =user-config= 里不起作用,不然就加到
58 | =user-init= 里面去。
59 |
60 | * 如何:
61 | ** 安装现有 Layer 没有提供的 package?
62 | 在.spacemacs 配置文件里, =dotspacemacs-additional-packages= 下添加所需
63 | package 名字即可。使用 ~SPC f e R~ 重新加载配置或者重启 Emacs 都会自动安装
64 | package。
65 |
66 | ** 禁用某个 package?
67 | 即使一个 package 存在于你 layer 里面,你也可以卸载这个 package,只需要把 package
68 | 的名字加进配置中的变量 =dotspacemacs-excluded-packages= 里面即可。
69 |
70 | #+BEGIN_SRC emacs-lisp
71 | (setq-default dotspacemacs-excluded-packages '(package1 package2 ...))
72 | #+END_SRC
73 |
74 | ** 在选定的 Major-mode 里面禁用某个 package?
75 | 可以通过移除 hook 来实现这个功能。例如:在 python 的模式中禁用 flycheck,只
76 | 需要在配置中 =dotspacemacs/user-config= 添加如下代码即可:
77 |
78 | #+BEGIN_SRC emacs-lisp
79 | (remove-hook 'python-mode-hook 'flycheck-mode)
80 | #+END_SRC
81 |
82 | 提示: ~SPC h d v major-mode RET~ 即可查看当前 buffer 的 major-mode
83 |
84 |
85 | ** 在特定的 major-mode 中禁用自动补全 company?
86 | 你可以很容易的禁用掉 =company= ,而自己去配置 =auto-complete= . 可以在
87 | spacemacs 的配置文件中 =dotspacemacs/user-config= 函数下添加宏
88 | =spacemacs|disable-company=来实现。下面是在 =python-mode= 中禁用 =company=
89 | 的代码:
90 | #+BEGIN_SRC emacs-lisp
91 | (spacemacs|disable-company python-mode)
92 | #+END_SRC
93 |
94 | ** 直接启用 vim 的 vitual line 移动?
95 | 在 =dotspacemacs/user-config= 函数下添加以下代码即可:
96 |
97 | #+BEGIN_SRC emacs-lisp
98 | ;; Make evil-mode up/down operate in screen lines instead of logical lines
99 | (define-key evil-motion-state-map "j" 'evil-next-visual-line)
100 | (define-key evil-motion-state-map "k" 'evil-previous-visual-line)
101 | ;; Also in visual mode
102 | (define-key evil-visual-state-map "j" 'evil-next-visual-line)
103 | (define-key evil-visual-state-map "k" 'evil-previous-visual-line)
104 | #+END_SRC
105 |
106 | ** 禁用某个 mode 的 evil 状态
107 | 可以使用 =evil-set-initial-state= 来定义某个 mode 下打开时的初始状态(evil
108 | 模式或者 Emacs 模式):
109 |
110 | #+BEGIN_SRC emacs-lisp
111 | (evil-set-initial-state 'magit-status-mode 'emacs)
112 | #+END_SRC
113 |
114 | 也可以通过使用 buffer 名字的正则表达式来实现。
115 |
116 | ** 设置 =$PATH= (Emacs 调用程序的路径)
117 | 当软件没有安装在 Emacs 的默认路径(exec-path)时,需要加入程序的安装路径,以
118 | 便 Emacs 来调用它。可以在 =dotspacemacs/user-config= 中添加如下代码(可以添
119 | 加多行类似代码来调用外部程序):
120 | #+BEGIN_SRC emacs-lisp
121 | (add-to-list 'exec-path "~/.local/bin/")
122 | #+END_SRC
123 |
124 | ** 防止选择文本占用系统剪贴板?
125 | 在一些系统中,只有一个剪贴板来存放 复制 和 选择 的文本,这会导致 Emacs 中
126 | 选择 的文本占用系统剪贴板。在 =dotspacemacs/user-config= 中来修正:
127 |
128 | #+BEGIN_SRC emacs-lisp
129 | (fset 'evil-visual-update-x-selection 'ignore)
130 | #+END_SRC
131 |
132 | ** 使用 Spacemacs 作为 Git 提交信息的编辑器
133 | 只需要在 =dotspacemacs/user-config= 中加上:
134 |
135 | #+BEGIN_SRC emacs-lisp
136 | (global-git-commit-mode t)
137 | #+END_SRC
138 |
139 | ** 在 X11 终端下,使用鼠标来复制/粘贴
140 | 在 =dotspacemacs/user-config= 中添加如下代码:
141 |
142 | #+begin_src emacs-lisp
143 | (xterm-mouse-mode -1)
144 | #+end_src
145 |
146 | ** 重映射粘贴键使其能够多次粘贴复制过的文本?
147 | 在 vim 和 evil 模式下,在选中的文本上粘贴复制的文本会导致被替换的文本放在剪
148 | 贴板,导致不能连续多次粘贴复制的文本。可以使用下面的代码来修正:
149 |
150 | #+BEGIN_SRC emacs-lisp
151 | (defun evil-paste-after-from-0 ()
152 | (interactive)
153 | (let ((evil-this-register ?0))
154 | (call-interactively 'evil-paste-after)))
155 |
156 | (define-key evil-visual-state-map "p" 'evil-paste-after-from-0)
157 | #+END_SRC
158 |
159 | * Windows
160 | **** 为什么字体很难看?
161 | 你可以装 [[https://code.google.com/archive/p/gdipp/][GDIPP]] (轻量)或者 [[https://code.google.com/p/mactype/][MacType]] (重量)来显示漂亮的平滑字体。
162 | 同时建议你把 =dotspacemacs-smooth-scrolling= 设置为 =nil= 。
163 |
164 | **** 如何让 Emacs 显示图片、收邮件、上 IRC?
165 | 要做到这些,你需要安装额外的依赖包。
166 | 1. 前往最近的 Emacs 镜像站,比如
167 | http://mirrors.ustc.edu.cn/gnu/emacs/windows/。
168 | 2. 找到如下两个压缩文件:
169 | #+begin_example
170 | emacs-25-i686-deps.zip
171 | emacs-25-x86_64-deps.zip
172 | #+end_example
173 | 4. 如果你用的是 32 位系统,下前一个,反之 64 位系统用户下载后一个。
174 | 5. 解压到 Emacs 文件夹即可。
175 | 6. 或者解压 bin 文件夹里的内容到 Emacs/bin 文件夹(也就是 Emacs.exe 所在的
176 | 那个),启动 Emacs。完成!
177 |
178 | **** 为什么 Spacemacs Logo 图片不显示?
179 | 见上一问。
180 |
181 | **** 为什么有的插件无法安装?
182 | 可能是缺少 GnuTLS,按 =M-:= (Alt 键+Shift 键+;键),输入:
183 | #+begin_src emacs-lisp
184 | (gnutls-available-p)
185 | #+end_src
186 | 回车。 如果返回值是 =nil= ,你需要安装额外的依赖包。
187 |
188 | 解决方法同上一问。
189 |
--------------------------------------------------------------------------------
/Shimbun.org:
--------------------------------------------------------------------------------
1 | #+TITLE: W3M Shimbun - A tool for reading a newspaper
2 | #+AUTHOR: LdBeth
3 | #+STARTUP: showall
4 |
5 | * 目录 :TOC:
6 | - [[#什么是-shimbun][什么是 Shimbun?]]
7 | - [[#安装和开始][安装和开始]]
8 | - [[#gnus][GNUS]]
9 | - [[#mew][Mew]]
10 | - [[#wanderlust][WanderLust]]
11 | - [[#rss][RSS]]
12 |
13 | * 什么是 Shimbun?
14 | Shimbun,日文为 新聞(しん ぶん)。顾名思义,这是用来阅读新闻的。它是属于 w3m
15 | 的一个模块,用于将各种网站、BBS 上的文章收取并转换成可供邮件客户端阅读的格式。
16 | 本质上类似于更加常见的 RSS Feed、Atom Feed。至于为什么 w3m 会提供这种功能,好
17 | 吧,很多人眼里 w3m 是一个终端下的浏览器,其实它实质上是一个阅读器(Pager),只
18 | 是顺带支持了 http 协议而已。
19 |
20 | * 安装和开始
21 | 想要在 Emacs 中使用 Shimbun,需要安装 =w3m= 可执行文件和 Emacs 界面 =w3m.el=
22 | 。如果你是用 elpa 安装的插件,还需要额外从安装 =shimbun.el= ,因为这个包在
23 | melpa 是和 w3m 是分开的。而从官方下载的 =w3m.el= 除了包含了 =shimbun.el= 以外,
24 | 还提供了 texi 格式的使用文档。你可以用 =texi2pdf= 把它转化成 PDF 格式。
25 |
26 | 具体的安装就不用解释了。
27 |
28 | ** GNUS
29 | 如果用 Gnus 阅读 Shimbun,需要在 =.gnus.el= 里加上如下配置:
30 | #+BEGIN_SRC emacs-lisp
31 | (require 'nnshimbun)
32 | (eval-after-load "gnus-group"
33 | '(define-key gnus-group-mode-map "Gn"
34 | 'gnus-group-make-shimbun-group))
35 | #+END_SRC
36 |
37 | 然后就可以用 ~G n~ 创建 Shimbun 条目了。需要注意的是,一般在重新启动后创建的
38 | 条目才会生效。
39 |
40 | ** Mew
41 | 这个的配置就有点麻烦了。
42 | #+BEGIN_SRC emacs-lisp
43 | ;;; Loading mew-shimbun, defining keys.
44 | ;; (setq mew-shimbun-use-unseen t) ;;;5
45 | (require ’mew-shimbun)
46 | (define-key mew-summary-mode-map "G" (make-sparse-keymap))
47 | (define-key mew-summary-mode-map "Gg" 'mew-shimbun-goto-folder)
48 | (define-key mew-summary-mode-map "GG" 'mew-shimbun-goto-unseen-folder)
49 | (define-key mew-summary-mode-map "Gi" 'mew-shimbun-retrieve)
50 | (define-key mew-summary-mode-map "GI" 'mew-shimbun-retrieve-all)
51 | (define-key mew-summary-mode-map "Gr" 'mew-shimbun-re-retrieve)
52 | (define-key mew-summary-mode-map "GR" 'mew-shimbun-re-retrieve-all)
53 | (define-key mew-summary-mode-map "Ge" 'mew-shimbun-expire)
54 | (define-key mew-summary-mode-map "GE" 'mew-shimbun-expire-all)
55 |
56 | ;; Specifying ‘shimbun’ servers and groups to be read with Mew in the
57 | ;; mew-shimbun-folder-groups variable. Each element has the form
58 | ;; ("folder" ("server.group" . range) ...). You can use all,
59 | ;; last, and a number for the range item.
60 | (setq mew-shimbun-folder-groups
61 | ’(;; Fetching ‘yomiuri.shakai’, ‘yomiuri.sports’, etc.
62 | ;; into the ‘+shimbun/yomiuri’ folder collectively.
63 | ("yomiuri"
64 | ("yomiuri.shakai" . 2) ("yomiuri.sports". 2) ("yomiuri.kokusai". 2))
65 | ;; Fetching ‘security-memo.memo’
66 | ;;
67 | ;; into ‘+shimbun/security-memo’.
68 | ("security-memo"
69 | ("security-memo.memo" . 2)) ("slashdot-jp"
70 | ("slashdot-jp.story" . last))
71 | ;; You can read several groups in one folder (‘+shimbun/emacs’)
72 | ;; as follows even if each group comes from a different server.
73 | ("emacs"
74 | ("airw.wl" . last)
75 | ("emacs-w3m.emacs-w3m" . last))
76 | ;; Fetching diaries into ‘+shimbun/hns/arisawa’ and
77 | ;; ‘+shimbun/hns/miyoshi’ respectively.
78 | ("hns/arisawa"
79 | ("hns.arisawa" . last)) ("hns/miyoshi"
80 | ("hns.miyoshi" . last))))
81 | #+END_SRC
82 |
83 | 具体的配置可以看 =customize-group= 。
84 |
85 | ** WanderLust
86 | WanderLust 内建对 Shimbun 的支持,用 =@= 来定义的邮件文件夹就是 Shimbun 文件
87 | 夹,具体细节文档中已经有说明。
88 |
89 | * RSS
90 | Shimbun 提供了 =sb-rss-hash= 和 =sb-atom-hash= 来处理 RSS。
91 |
92 | 在配置中加入如下。
93 |
94 | #+BEGIN_SRC emacs-lisp
95 | (setq shimbun-rss-hash-group-path-alist
96 | '(("xkcd" "https://xkcd.com/rss.xml")
97 | ("acgpiping" "http://www.acgpiping.net/feed/")
98 | ("moonlight" "http://feed.williamlong.info/")))
99 | #+END_SRC
100 |
101 | 然后根据 MUA 设置 shimbun 模块,比如用 WanderLust,在 .folder 中加上:
102 |
103 | #+BEGIN_SRC conf-unix
104 | NEWS {
105 | @rss-hash.xkcd "xkcd"
106 | @rss-hash.acgpiping "ACG"
107 | @rss-hash.moonlight "MoonLight"
108 | }
109 | #+END_SRC
110 |
111 |
--------------------------------------------------------------------------------
/WanderLust.org:
--------------------------------------------------------------------------------
1 | #+TITLE: WanderLust
2 | #+AUTHOR: LdBeth
3 | #+STARTUP: showall
4 |
5 | #+begin_quote
6 | All mail clients suck. -cira, the author of another mail client, mutt
7 | #+end_quote
8 |
9 | #+begin_quote
10 | 但是后来我发现其它 email 程序都有某种我不喜欢的怪毛病。-- 《Mutt 使用指南》
11 | #+end_quote
12 |
13 | * 目录 :TOC:
14 | - [[#简介][简介]]
15 | - [[#wanderlust-的特点][WanderLust 的特点]]
16 | - [[#超强的信件分类功能][超强的信件分类功能]]
17 | - [[#信件打分排序功能][信件打分排序功能]]
18 | - [[#几乎任意条件的彩色设置][几乎任意条件的彩色设置]]
19 | - [[#可以随意绑定热键][可以随意绑定热键]]
20 | - [[#设置条件挂钩][设置条件挂钩]]
21 | - [[#批量邮件处理][批量邮件处理]]
22 | - [[#任选编辑器][+任选编辑器+]]
23 | - [[#高级的-mime-支持][高级的 MIME 支持]]
24 | - [[#支持-pgp-加密][支持 PGP 加密]]
25 | - [[#mutt-wanderlust-是免费的][+Mutt+ WanderLust 是免费的]]
26 | - [[#开始][开始]]
27 | - [[#配置收信方式][配置收信方式]]
28 | - [[#一个相对复杂的范例][一个相对复杂的范例]]
29 | - [[#举例][举例]]
30 | - [[#配置发信方式][配置发信方式]]
31 | - [[#使用内置-smtp-发信][使用内置 SMTP 发信]]
32 | - [[#使用-sendmailmsmtp][使用 =sendmail/msmtp=]]
33 | - [[#maildir-设置][MailDir 设置]]
34 | - [[#faq][FAQ]]
35 | - [[#密码][密码]]
36 | - [[#邮件头显示了一大堆乱七八糟的东西][邮件头显示了一大堆乱七八糟的东西]]
37 | - [[#如何在读信时显示邮件列表][如何在读信时显示邮件列表]]
38 | - [[#自动删除邮件和自动归类邮件][自动删除邮件和自动归类邮件]]
39 | - [[#如何插入附件][如何插入附件]]
40 | - [[#如何利用-org-mode-发送-html-邮件][如何利用 Org-mode 发送 html 邮件]]
41 | - [[#x-face][X-face]]
42 | - [[#乱码][乱码?]]
43 |
44 | * 简介
45 | WanderLust 是一个完全用 Emacs Lisp 实现的一个不需要在 Emacs 之外进行配置的邮件客
46 | 户端。难能可贵的是,即使作为和 GNUS 同样的一个单线程应用,IMAP 收信速度仍然碾压
47 | 绝大部分其它客户端。
48 |
49 | 和 Mew 一样,这个包最早是由日本人构建的,所以不需要额外配置字体就能正常显示中文。
50 | 同时 WanderLust 也支持 NNTP,MailDir,POP,RSS 等多种协议。
51 |
52 | 兼顾了 GNUS 的纯 Emacs Lisp 实现和 Mew 的 IMAP 优化、强大的邮件分类功能,同时
53 | 还具备一个优秀的邮箱界面,这就是 WanderLust。
54 |
55 | 为了向《Mutt 使用指南》致敬,我在这里列出了一些不错的特性。
56 |
57 | ** WanderLust 的特点
58 | WanderLust 具有以下特点:
59 |
60 | *** 超强的信件分类功能
61 | 这也是和 Mew/Mutt 相似的地方。
62 |
63 | *** 信件打分排序功能
64 | 令人惊讶的是,和 Mutt 一样,它也有这种功能。
65 |
66 | *** 几乎任意条件的彩色设置
67 | 是的。
68 |
69 | *** 可以随意绑定热键
70 | 因为你在用 Emacs!
71 |
72 | *** 设置条件挂钩
73 | 同样这也仰仗于 Emacs。
74 |
75 | *** 批量邮件处理
76 | 当然可以了!你可以通过标记系统批量处理邮件,也可以用 Emacs Lisp 自动化邮件处
77 | 理。
78 |
79 | *** +任选编辑器+
80 | 额,这个好像做不到。不过你用的 Emacs 已经是最好的编辑器(为了防止被打我得加个
81 | “之一”)了,而且你也可以用 Evil。
82 |
83 | *** 高级的 MIME 支持
84 | WangderLust 依赖于用 Emacs Lisp 实现的 MIME —— SEMI,能够很好地处理各种文件。
85 |
86 | *** 支持 PGP 加密
87 | Emacs 内建的几个包能作为 PGP 的前端。你可以用 =EasyPG= 或 =PGG= 来用 GPG 加密
88 | 邮件。
89 |
90 | *** +Mutt+ WanderLust 是免费的
91 | 听了上面那么多好处之后,还有比这更好的消息吗?
92 |
93 |
94 | * 开始
95 | 好吧,实际上这个插件极度缺少说明,你几乎无法找到任何介绍这个包的中文资料,甚至
96 | 英文资料也几乎仅限于 EmacsWiki 上模糊不清的几段说明。
97 |
98 | 但是至少有自带的 Emacs Manual 可以看。据说日文版的使用手册比英文版的还要详细一
99 | 点。
100 |
101 | 因为这个包可以直接在 melpa 上找到,安装部分就略过。唯一值得注意的是因为依赖包
102 | 比较多,可能要重启几次 Emacs 才能保证安装成功。
103 |
104 | 然后,和 Mew 一样,记得在 =init.el= 里面加几行:
105 |
106 | #+begin_src emacs-lisp
107 | (if (boundp 'mail-user-agent)
108 | (setq mail-user-agent 'wl-user-agent))
109 | (if (fboundp 'define-mail-user-agent)
110 | (define-mail-user-agent
111 | 'wl-user-agent
112 | 'wl-user-agent-compose
113 | 'wl-draft-send
114 | 'wl-draft-kill
115 | 'mail-send-hook))
116 | #+end_src
117 |
118 |
119 | * 配置收信方式
120 | WanderLust 用 =~/.folders= 来配置收信方式。非常令人无语的是,这个文件是
121 | unix-rc 格式的。但是不要被吓退,其实这是很容易弄懂的。
122 |
123 | #+begin_src conf-unix
124 | %INBOX:johndoe/clear@mail.domain.com:993! "收件箱"
125 | INBOX {
126 | %INBOX/Family:johndoe/clear@mail.domain.com:993! "家庭"
127 | %INBOX/Work:johndoe/clear@mail.domain.com:993! "工作"
128 | Work {
129 | .inbox "Bug Reports"
130 | }
131 | }
132 | # 一个以 `/' 结束的访问组,解析整个文件夹结构
133 | %maildir/clear@mail.domain.com:993! /
134 | #+end_src
135 |
136 | 明白了吗?这就是一个邮箱入口列表了,用不同的标记来告诉 WanderLust 到哪里取邮件。
137 | =%= 表示 IMAP 信箱, =.= 表示本地 MailDir 格式的信箱, =&= 表示 POP 信箱。这甚
138 | 至比用 Emacs Lisp 配置还要直观,让我想起了用 Org-mode 来配置 RSS Feeds 的
139 | =org-elfeed= 。(说实话我觉得 elfeed 的中文支持差爆了,甚至还不如那个性能比较
140 | 低的 newsticker。)具体格式参照 Manual。
141 |
142 | 生成的邮件列表结构是这样的:
143 |
144 | #+begin_example
145 | 总邮箱
146 | |-收件箱(一个实际邮件文件夹)
147 | `-INBOX(这个则是用来分类的一个文件夹)
148 | |-家庭
149 | |-工作
150 | `-Work
151 | `-Bug Reports(本地 MailDir)
152 | #+end_example
153 |
154 | 你应该可以看出来,通过这种方式很容易就能同时收取多个邮箱。
155 |
156 | ** 一个相对复杂的范例
157 | (来自 Emacs Wiki)
158 | #+begin_src conf-unix
159 | # -*- conf-unix -*-
160 | GMAIL{
161 | %INBOX:myname/clear@imap.gmail.com:993! "In"
162 | %[Gmail]/Sent:myname/clear@imap.gmail.com:993! "Sent"
163 | %[Gmail]/Draft:myname/clear@imap.gmail.com:993! "Draft"
164 | %[Gmail]/Trash:myname/clear@imap.gmail.com:993! "Trash"
165 | %[Gmail]/Spam:myname/clear@imap.gmail.com:993! "Spam"
166 |
167 | Buy{
168 | %buy/ebay:myname/clear@imap.gmail.com:993! "E-bay"
169 | %buy/records:myname/clear@imap.gmail.com:993! "Records"
170 | %buy/books:myname/clear@imap.gmail.com:993! "Books"
171 | }
172 |
173 | Friends{
174 | %friends/work:myname/clear@imap.gmail.com:993! "work friends"
175 | %friends/university:myname/clear@imap.gmail.com:993! "university friends"
176 | %friends/college:myname/clear@imap.gmail.com:993! "old friends"
177 | %friends/highschool:myname/clear@imap.gmail.com:993! "very old friends"
178 | }
179 | }
180 |
181 | #Note: usernames with "strange" characters (like "@") must be written
182 | #like: "myname@company.com". Folders at my work are delimited by dot '.'.
183 | WORK{
184 | %INBOX:"myname@company.com"/clear@mail.company.com "Inbox"
185 | %INBOX.Sent:"myname@company.com"/clear@mail.company.com "Sent"
186 | %INBOX.Drafts:"myname@company.com"/clear@mail.company.com "Draft"
187 | %INBOX.Trash:"myname@company.com"/clear@mail.company.com "Trash"
188 |
189 | Projects{
190 | %INBOX.Project1:"myname@company.com"/clear@mail.company.com "Project 1"
191 | %INBOX.Project2:"myname@company.com"/clear@mail.company.com "Project 2"
192 | }
193 | }
194 |
195 | #+end_src
196 |
197 | 虽然其实也可以直接用 WanderLust 的文件夹管理器来设置,但在第一次启动时最好还是
198 | 了解一下如何配置。
199 |
200 | ** 举例
201 | 如果你需要马上上手的话,我就用比较常见的 QQ 邮箱举例了。
202 |
203 | #+BEGIN_SRC conf-unix
204 | %inbox:7XXXXXXX9/login@imap.qq.com:993! "QQ Mail"
205 | 路径:用户名/验证方式(QQ 邮箱需要设为 login)@服务器:端口!加上感叹号表示要使用 SSL "用于显示的名称,可以不设"
206 | #+END_SRC
207 |
208 | 需要注意的是,用户名用 =john@gmail.com= 之类的,也就是中间有@符号的,会导致
209 | 无法正确连接到服务器。这时候你需要用 =""= 把用户名包起来。
210 |
211 | 下面是一个 Gmail 的例子。(注意:中国大陆地区 Gmail 服务已经不可用,包括网页和
212 | POP、IMAP、SMTP 服务。)
213 |
214 | #+BEGIN_SRC conf-unix
215 | %inbox:"john@gmail.com"/clear@imap.gmail.com:993! "Gmail"
216 | #+END_SRC
217 |
218 | 当然你也可以用 Emacs Lisp 来配置,不过一般不推荐这样做。
219 |
220 | #+BEGIN_SRC emacs-lisp
221 | (setq elmo-imap4-default-server "imap.gmail.com"
222 | elmo-imap4-default-user "@gmail.com"
223 | elmo-imap4-default-authenticate-type 'clear
224 | elmo-imap4-default-port '993
225 | elmo-imap4-default-stream-type 'ssl)
226 | #+END_SRC
227 |
228 | * 配置发信方式
229 | ** 使用内置 SMTP 发信
230 | 下方是一个 SMTP 配置的范例,你应该放在 =.wl= 里,或者其它合适的地方。
231 |
232 | #+begin_src emacs-lisp
233 | (setq wl-smtp-connection-type 'starttls
234 | wl-smtp-posting-port 587
235 | wl-smtp-authenticate-type "plain"
236 | wl-smtp-posting-user "myname"
237 | wl-smtp-posting-server "smtp.gmail.com"
238 | wl-local-domain "gmail.com"
239 | wl-message-id-domain "smtp.gmail.com")
240 |
241 |
242 |
243 | ;; 更加复杂的多账号设置
244 | (setq wl-user-mail-address-list (quote ("myname@gmail.com" "myname@company.com")))
245 |
246 | ;;(NOTE: "M-: wl-draft-parent-folder" => %INBOX:myname/clear@imap.gmail.com:993)
247 | (setq wl-draft-config-alist
248 | '(((string-match "company.com" wl-draft-parent-folder)
249 | (template . "work"))
250 | ((string-match "gmail.com" wl-draft-parent-folder)
251 | (template . "gmail"))
252 | ;; automatic for replies
253 | (reply "\\(To\\|Cc\\|Delivered-To\\): .*company.com.*"
254 | (template . "work"))
255 | (reply "\\(To\\|Cc\\|Delivered-To\\): .*gmail.com.*"
256 | (template . "gmail"))))
257 |
258 | ;;choose template with C-c C-j
259 | (setq wl-template-alist
260 | '(("gmail"
261 | (wl-from . "My Name ")
262 | (wl-smtp-posting-user . "myname")
263 | (wl-smtp-posting-server . "smtp.gmail.com")
264 | (wl-smtp-authenticate-type ."plain")
265 | (wl-smtp-connection-type . 'starttls)
266 | (wl-smtp-posting-port . 587)
267 | (wl-local-domain . "gmail.com")
268 | (wl-message-id-domain . "smtp.gmail.com"))
269 | ("work"
270 | ("Fcc" . "%INBOX.Sent:\"myname@company.com\"/clear@mail.company.com")
271 | (wl-from . "My Name ")
272 | (wl-smtp-posting-user . "myname@company.com")
273 | (wl-smtp-posting-server . "mail.company.com")
274 | (wl-local-domain . "mail.company.com"))
275 | ("From" . wl-from)))
276 | #+end_src
277 |
278 | 密码用可 =~/.authinfo= 配置。
279 |
280 | ** 使用 =sendmail/msmtp=
281 | 如果你已经安装并设置过 =sendmail= 或者 =msmtp= ,你当然也可以用这两个 MUA 来发件。
282 |
283 | #+BEGIN_SRC emacs-lisp
284 | (setq wl-draft-send-mail-function 'wl-draft-send-mail-with-sendmail)
285 | #+END_SRC
286 |
287 | 对于 macOS 用户,可以用系统自带的 Postfix,见
288 | [[http://www.postfix.org/SOHO_README.html#client_sasl_enable][Enabling SASL authentication in the Postfix SMTP client]]
289 | 以及 [[http://www.postfix.org/SOHO_README.html#client_sasl_sender][Configuring Sender-Dependent SASL authentication]]。
290 |
291 | 用 =launchctl= 启动 Postfix (macOS BigSur 以后)
292 | #+BEGIN_SRC shell
293 | launchctl enable system/com.apple.postfix.master
294 | #+END_SRC
295 |
296 | 发完查看 =/var/mail/= 看是否有退信。如果有
297 |
298 | #+BEGIN_EXAMPLE
299 | 501 Mail from address must be same as authorization
300 | user.
301 | #+END_EXAMPLE
302 |
303 | 原因是要设置
304 |
305 | #+BEGIN_SRC emacs-lisp
306 | (setq mail-specify-envelope-from t
307 | mail-envelope-from <你用于 SMTP 的邮箱>)
308 | #+END_SRC
309 |
310 | 如果用的是 =msmtp= ,还需要一些额外配置,详见 [[https://www.emacswiki.org/emacs/GnusMSMTP][EmacsWiki]] 。
311 |
312 | ** 使用 Google OAuth2
313 |
314 | 这个方法用到了最新最热的 OAuth2 支持。
315 |
316 | #+BEGIN_QUOTE
317 | 想必用过现代邮件客户端的读者应该也见过加入 GMail 邮箱的时候是通过 Google 官网选择
318 | Google 账号的情形,这个就是用的 OAuth2。用 OAuth2 登陆 IMAP/POP3 等服务主要
319 | 是为了减少在不安全的地方储存和传输密码的风险。
320 | #+END_QUOTE
321 |
322 | 使用之前需要在 [[https://console.cloud.google.com][Google Console]] 注册应用程序来
323 | 得到 OAuth2 Client ID 和 Secret,备用。
324 |
325 | 同时,要保证 EasyPG 和 GnuPG 能够正常使用。
326 |
327 | 在 =.folders= 文件里用 =xoath2= 验证类型:
328 |
329 | #+begin_src conf-unix
330 | GMail{
331 | %INBOX:"eldbetha@gmail.com"/xoauth2@imap.gmail.com:993! "Inbox"
332 | }
333 | #+end_src
334 |
335 | 之后在首次连接时 WanderLust 会依次提示输入 OAuth2 Client ID 和 Secret,并创建
336 | plstore 的 passpharse,输入后会在浏览器打开选择 Google 账号的页面,同意授权后,
337 | 会提示无法访问页面,但不要慌,把地址栏里的 =code= 参数复制下来输入 WanderLust 就可以了。
338 |
339 | 为了以后不用每次输入 Client ID 和 Secret 和 passpharse,在 =.wl= 可以加入:
340 |
341 | #+begin_src emacs-lisp
342 | (setq sasl-xoauth2-host-user-id-table
343 | '(("\\.gmail\\.com$" <用户名的正则>
344 |
345 | ))
346 | plstore-cache-passphrase-for-symmetric-encryption t)
347 | #+end_src
348 |
349 | * MailDir 设置
350 | 尽管 WanderLust 是一个 IMAP 客户端,它也支持用 MailDir。而且不像 GNUS 是把邮件
351 | 全部导入到本地文件夹,WanderLust 是直接对 MailDir 进行读写操作,这使得它可以和
352 | 我很喜欢的 CLT 邮件客户端 Mutt 共存。我使用 WanderLust 其中之一的原因也是我至
353 | 今还没找到 Mew 如何使用 MailDir(后来发现其实和 WanderLust 差不多)。
354 |
355 | * FAQ
356 | 在这里我会对几个常见的问题进行说明。
357 |
358 | ** 密码
359 | 不像 Mew 那样需要用那种奇怪的方式来避免每次进入邮箱都要输入密码,WanderLust 支
360 | 持用 =elmo-passwd-alist-save= 来在第一次登陆输入密码后保存密码。密码通常被保存
361 | 在 =~/.elmo/passwd= 。不用担心安全问题,因为密码当然不是明文,而是被加密处理后
362 | 保存的。
363 |
364 | ** 邮件头显示了一大堆乱七八糟的东西
365 | #+BEGIN_SRC emacs-lisp
366 | (setq wl-message-ignored-field-list
367 | '(".")
368 | wl-message-visible-field-list
369 | '("^\\(To\\|Cc\\):"
370 | "^Subject:"
371 | "^\\(From\\|Reply-To\\):"
372 | "^\\(Posted\\|Date\\):"
373 | "^Organization:"
374 | "^X-\\(Face\\(-[0-9]+\\)?\\|Weather\\|Fortune\\|Now-Playing\\):")
375 | wl-message-sort-field-list
376 | (append wl-message-sort-field-list
377 | '("^Reply-To" "^Posted" "^Date" "^Organization")))
378 | #+END_SRC
379 |
380 | ** 如何在读信时显示邮件列表
381 | #+BEGIN_SRC emacs-lisp
382 | (setq wl-stay-folder-window t)
383 | #+END_SRC
384 |
385 | ** 自动删除邮件和自动归类邮件
386 | #+BEGIN_SRC emacs-lisp
387 | ;; Refile rule
388 | (setq wl-refile-rule-alist
389 | '(("to"
390 | ("splab-ml@do-johodai.ac.jp" . "+ml/splab")
391 | ("doluc@ncjoho.co.jp" . "+ml/linux-jp/doluc")
392 | ("debian-users@debian.or.jp" . "+ml/linux-jp/debian-users")
393 | ("mule-ja@m17n.org" . "+ml/emacsen/mule-ja")
394 | ("semi-gnus-ja@meadowy.org" . "+ml/emacsen/emacs-mime-ja")
395 | ("wl@lists.airs.net" . "+ml/emacsen/wl")
396 | ("skk@ring.gr.jp" . "+ml/emacsen/skk")
397 | ("emacs-w3m@namazu.org" . "+ml/emacsen/emacs-w3m")
398 | ("bbdb@tutrp.tut.ac.jp" . "+ml/emacsen/bbdb")
399 | ("yatex@yatex.org" . "+ml/emacsen/yatex"))))
400 |
401 | ;; Expire
402 | (setq wl-expire-alist
403 | `((,(concat "^\\" wl-trash-folder "$") (date 7) remove)
404 | ("^\\+mag/" (date 30) remove)
405 | ("^\\.ads$" (date 15) remove)
406 | ;;("^@" (date 30) remove)
407 | ("^\\+ml/linux-jp/doluc$" (number 300 500) hide)
408 | ("^\\+ml/splab$" (number 300 500) hide)
409 | ))
410 | (add-hook 'wl-summary-prepared-hook 'wl-summary-expire)
411 | #+END_SRC
412 |
413 | ** 如何插入附件
414 | WandeLust 用 =SEMI= 这个包处理 MIME。如果你对 MIME 没有概念的话,简单来说就是
415 | 附件处理。你只要在 =wl-draft-mode= 下按 ~C-c C-x TAB~ =mime-edit-insert-file=
416 | 就可以插入附件了。
417 |
418 | ** 如何利用 Org-mode 发送 html 邮件
419 | 先做如下配置:
420 |
421 | #+BEGIN_SRC emacs-lisp
422 | (setq org-mime-library 'semi)
423 | #+END_SRC
424 |
425 | 然后只需要在 =org-mode= 中写好邮件内容后运行 ~M-x~
426 | =org-mime-org-buffer-htmlize= ,就会新建一封 html 格式的邮件。
427 |
428 | 我做的 [[LsmL][https://ldbeth.sdf.org/lsml/]] 也可以用来生成 HTML 邮件。
429 |
430 | ** X-face
431 | #+BEGIN_QUOTE
432 | 有时候在 Article buffer 顶部有个小小的图片,是什么?我发的帖子如何加上?
433 |
434 | 那些图片称为 X-Face,是一些 48*48 的黑白图片,被编码为一行邮件头
435 | (header line),如果你也想加一个,需要把图片转换 X-Face。用一个图片处
436 | 理程序(比如 gimp),打开你想要的图片,剪切相应部分,将颜色降低为
437 | 1bit,改变大小到 48*48,另存为位图(bitmap)。从 this site
438 | (ftp://ftp.cs.indiana.edu:/pub/faces/) 取来 compface 包,通过如下命
439 | 令,创建一个 X-face:
440 |
441 | cat file.xbm | xbm2ikon |compface > file.face
442 | cat ./file.face | sed 's/\/\\/g' | sed 's/\"/\\"/g' > ./file.face.quoted
443 |
444 | 如果不能使用 compface,还有另一个 X-face 转换器:
445 | http://www.dairiki.org/xface/. 如果在 MS Windows 上,也可以用
446 | WinFace 程序:http://www.xs4all.nl/~walterln/winface/. 然后只需要
447 | 在 ~/.gnus 中告诉 Gnus 在你的帖子里面加入 X-face:
448 |
449 | (setq message-default-headers
450 | (with-temp-buffer
451 | (insert "X-Face: ")
452 | (insert-file-contents "~/.xemacs/xface")
453 | (buffer-string)))
454 | #+END_QUOTE
455 |
456 | From: http://blog.csdn.net/lujun9972/article/details/46002803
457 |
458 | X-face 是在邮件/新闻组时代很流行的东西。就和现在的 Gravatar 差不多。甚至以
459 | 前的 IRC 也能显示 X-face 头像。
460 |
461 | 原理就是在邮件的 Header 部分嵌入一段专门的代码,在读入的时候转换成一个 48x48
462 | 的黑白图片,比如我的头像的代码就是:
463 |
464 | #+BEGIN_SRC text
465 | 0@1]t/p1\-TYA>y*B},]Iv$z1v-o$C/G)\m9=?bWtc9/yca-)cV,[jIwgM(=|h85EAfU7'+b_|+m$TU.6bsD5SGd/RTu.h+}8b>OCDNCDr_#zv"H:o23#+m@g5USw)-74icq8Q(6Dy?Lkc+3P&v%2yerI[)FWEljAhOcZKz3bH6b&QEYd{Vm'g]\7.5bCsb?jqKKk0e%SlU[sL'Jok%WNH_ql4c;/HD`OR,3NBbzKgT9$Mbz;"y~;&Gi-3aa
466 | #+END_SRC
467 |
468 | 在 WanderLust 中,设置 X-face 很简单,只要把生成的代码作为纯文本文件保存在 ~/.xface 就会自动读取。
469 |
470 | #+BEGIN_QUOTE
471 | 但是显示出来只是代码,不是图片?
472 | #+END_QUOTE
473 |
474 | 这个嘛,我看了看 WanderLust 的手册,里面提到要用 Mule 来处理。Mule 是 Emacs
475 | 21 之前不支持 UTF-8 的时候用来处理字体和编码的包,现在 Emacs 21 以后可以用
476 | =x-face-e21.el= 来处理,不需要 Mule。
477 |
478 | 可以在这里下载:
479 | http://www.jpl.org/ftp/pub/elisp/
480 |
481 | 然后
482 | #+BEGIN_SRC emacs-lisp
483 | (autoload 'x-face-decode-message-header "x-face-e21")
484 | (setq wl-highlight-x-face-function 'x-face-decode-message-header)
485 | #+END_SRC
486 |
487 | 你还要从包管理器装 compface 来转换出图片。
488 |
489 | 我现在维护了一个支持 Emacs 27 的版本。和其它一些插件可以在这里找到:
490 | https://github.com/LdBeth/InfernoEmacs/blob/master/core/
491 |
492 | ** LSDB
493 | 如果你不喜欢用 BBDB 的话可以用这个。
494 |
495 | #+BEGIN_SRC emacs-lisp
496 | (require 'lsdb)
497 | (lsdb-wl-insinuate)
498 | (define-key wl-draft-mode-map "\M-\t" 'lsdb-complete-name)
499 | (define-key wl-summary-mode-map ":" 'lsdb-wl-toggle-buffer)
500 | #+END_SRC
501 |
502 | 如果你已经装了 =x-face-e21.el= ,会自动配置显示 xface。
503 |
504 | 我不想让广告邮件的发件人被记下来:
505 |
506 | #+BEGIN_SRC emacs-lisp
507 | (setq lsdb-boring-names-list '("Overloud\\|KVR Audio\\|Github"))
508 | #+END_SRC
509 |
510 | ** Mu-cite
511 | 功能和自带的 =supercite= 类似,我改得更顺手了点。
512 |
513 | #+BEGIN_SRC emacs-lisp
514 | (use-package mu-cite
515 | :defer t
516 | :init
517 | (setq mu-cite-prefix-format '(lsdb-prefix-register "> "))
518 | (add-hook 'mail-citation-hook 'mu-cite-original)
519 | :config
520 | (lsdb-mu-insinuate))
521 | #+END_SRC
522 |
523 | ** GnuPG
524 | 如果用 EasyPG 出现 =inappropriate ioctl for device= 错误,记得在配置中加上
525 |
526 | #+BEGIN_SRC emacs-lisp
527 | (setq epa-pinentry-mode 'loopback)
528 | #+END_SRC
529 |
530 | ** 乱码?
531 | 出现乱码,可以设置 =wl-mime-charset= 为 ='gbk= ,或者其它合适的值。你也可以设
532 | 置 =wl-folder-mime-charset-alist= 。
533 |
534 | 如果是标题部分出现乱码,这可不是 WanderLust 的错,而是因为对方用了不规范的邮
535 | 件头编码,不过你可以通过设置 =mime-header-accept-quoted-encoded-words= 来让它
536 | 能正确解码不规范的邮件头。
537 |
538 |
--------------------------------------------------------------------------------
/site-start.el:
--------------------------------------------------------------------------------
1 |
2 | ;;; 此配置文件只为新手初次体验Emacs,应放置在/Emacs/share/emacs/site-lisp/下面。
3 | ;;; 下面的配置最好只保留设置HOME项。
4 |
5 | ;; 设置HOME目录为Emacs程序下的子文件夹 "Home/",利于便携化。
6 | (defvar emacs-home
7 | (replace-regexp-in-string "bin/" "HOME/" invocation-directory :from-end))
8 |
9 | (unless (file-exists-p emacs-home)
10 | (make-directory emacs-home :parents))
11 |
12 | (setenv "HOME" (concat emacs-home))
13 |
14 |
15 | ;;; 后面的配置可以用来体验Emacs做为强大编辑器的魅力。
16 | ;;; 持续更新中……
17 |
18 | ;; 下面是设置源,下载 package 时免翻墙。
19 | ;; (require 'package)
20 | ;; (setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")
21 | ;; ("melpa" . "http://elpa.emacs-china.org/melpa/")))
22 | ;; (package-initialize)
23 |
24 | ;;; 安装use-package,用于管理package的配置。
25 | ;; (unless (package-installed-p 'use-package)
26 | ;; (package-refresh-contents)
27 | ;; (package-install 'use-package))
28 |
29 | ;; Automatically install package, such as cnfonts
30 | ;; (use-package cnfonts
31 | ;; :config
32 | ;; (cnfonts-enable)
33 | ;; (add-hook 'after-make-frame-functions #'cnfonts-set-font-with-saved-step))
34 |
35 |
--------------------------------------------------------------------------------