十一月 16, 2009

Git mirror of all GCC SVN branches and tags

终于找到使用http方式做git clone GCC源代码的方法了。GCC gitweb的链接是

http://gcc.gnu.org/git/?p=gcc.git;a=summary

上面有三种clone方式的链接。

十一月 02, 2009

orgmode for mail

使用orgmode越来越顺手,于是用它替换markdown作为写HTML邮件的首选。配置如下:

(defun wl-message-goto-body-end ()
  "Go to the end of message body.  Before attachment part."
  (or (save-excursion
        (when (re-search-forward
               "^<#part .+ filename=.+ disposition=attachment>$"
               nil
               t)
          (forward-line -1)
          (end-of-line)
          (point)))
      (point-max)))

(defun wl-org-export-region-as-html-string (beg end)
  (interactive "r")
  (save-excursion
    (org-export-region-as-html beg end t 'string)))

(defun wl-mail-org2html-region (beg end)
  (interactive "r")
  (save-excursion
    (let ((html-txt (wl-org-export-region-as-html-string beg end)))
      (goto-char end)
      (message "%s" end)
      (insert "<#part type=text/html>\n<html>\n<head>\n<title>HTML version of email</title>\n</head>\n<body>")
      (insert html-txt)
      (insert "\n</body>\n</html>\n<#/multipart>\n")
      (goto-char beg)
      (insert "<#multipart type=alternative>\n"))))

(defun wl-mail-org2html-message-body ()
  (interactive)
  (save-excursion
    (message-goto-body)
    (wl-mail-org2html-region (point) (wl-message-goto-body-end))))

(add-hook 'message-send-hook 'wl-mail-org2html-message-body)