http://www.emacswiki.org/emacs/WebloggerMode 是一个 Emacs 包,可以让你用
Emacs 来写 Blog,支持多站点配置。
安装也很简单,可以通过 http://tromey.com/elpa 来安装,也可以去
https://launchpad.net/weblogger-el 下载最新的版本,放到 load-path 中,然
后在配置文件中加上 (require ‘weblogger) 就 OK 了。
WebloggerMode 还依赖了 XmlRpc,这个也可以通过 ELPA 来安装。
安装好以后,先 M-x weblogger-setup-weblog 来设置一下 blog 站点,关键是把
“Server Endpoint” 设置对就行了。
下面是一些常见 blog 平台的 Server Endpoint:
Blogger.com: http://www.blogger.com/api
Wordpress: http://BLOG-URL/xmlrpc.php (For http://hexmode.wordpress.com/, this is http://hexmode.wordpress.com/xmlrpc.php. For a blog hosted at http://example.com/weblog/ it would be http://example.com/weblog/xmlrpc.php)
LiveJournal: http://www.livejournal.com/interface/blogger/
OpenWeblog: http://www.openweblog.com/interface/blogger/
MovableType: http://CGI-URL/mt-xmlrpc.cgi. If your CGI root is http://www.example.com/cgi-bin/mt/ then the Server Endpoint would be http://www.example.com/cgi-bin/mt/mt-xmlrpc.cgi.
Drupal: Enable the Blogger API and use http://DRUPAL-URL/xmlrpc.php
(like WordPress).
把站点配置好以后,就可以用 M-x weblogger-start-entry 来写文章了。
用法如下:
;; C-x C-s — post-and-publish current buffer to the weblog.
;; Calling weblogger-publish-entry with an prefix argument
;; (i.e. C-u C-x C-s) will prompt for which weblog
;; to use.
;; C-c C-c — save as draft and bury the buffer.
;; C-c C-n — post (but not publish) the current entry and
;; load the next entry.
;; C-c C-p — post (but not publish) the current entry and
;; load the previous entry.
;; C-c C-k — delete the current entry.
;; M-g — synchronise weblogger.el’s idea of the entries available
;; with the weblog server.
;; C-c C-t m — edit the main template.
;; C-c C-t a — edit the Archive Index template
;; C-c C-s s — Change the server being used.
;; C-c C-s w — Change the weblog.
;; C-c C-s u — Change the user (re-login).

从 Emacs 23 开始,设置字体就很简单了。

原先用的是 (set-default-font “文泉驿等宽正黑-10”) 来设置字体,用 C-h f set-default-font 看了帮助以后才知道这个函数已经在 23.1 版本开始不建议使用了,而是用 set-frame-font 来代替。

set-frame-font 是用来设置当前 frame 的字体,如果用 C-x 5 2 来创建一个新的 frame 之后,我们会发现用 set-frame-font 设置的字体没有生效。

http://www.emacswiki.org/emacs/SetFonts#toc2 这里就介绍了设置全局默认字体的方法,就是 (set-face-attribute ‘default nil :font FONT) 其中 FONT 是一个描述字体的字符串,和我们前面提到的 set-default-font 参数一样。

所以再要设置全局的默认字体为文泉驿等宽正黑就是 (set-face-attribute ‘default nil :font “文泉驿等宽正黑-10”)