Beyond text

读和写blog已经有好几年了,但是对于音频和视频的接触才刚刚开始,这还要得益于Nokia的Internet Tablet——N800。

Nokia N800上有一个软件——Canola,通过它可以订阅podcast,也可以看youtube上的视频。其实听podcast看youtube在PC上都是很容易的事情,但我居然就一直没啥好奇的感觉,正是由于使用Internet Tablet这种新颖的方式,让我逐渐体会到了影音的魅力。刚刚开始,还不太会玩,尤其是youtube,只知道从首页上的几个视频开始,还不知道怎样找到自己喜欢的、内容精致的东西。Podcast订阅的也不多,一些使用feedburner提供的服务,只好通过google reader订阅。听了反波的几段,感觉不错,可惜好像已经不再更新了,其它的都是些英文内容,就当学学英语吧。具体参见我订阅的Podcast。

Attachment reminder

忘记在邮件里添加附件,是件很尴尬的事情,这不,昨天就又干了一回。再也不能这样活!于是乎对message-mode做了一点扩展,在发送邮件之前扫描邮件正文,如发现有”attached”或者”attachment”字样,却没有发现附件的话,就提醒一下。代码如下:

(defvar wl-message-attachment-word-regex "attached\|attachment"
  "List of words indicates the existence of attachment.")

(defun wl-message-attachment-mentioned-p ()
  "If attachment is mentioned is message body"
  (save-excursion
    (message-goto-body)
    (let ((end (or (and message-reply-headers (re-search-forward (concat (mail-header-from message-reply-headers) " writes:") nil t))
                   (point-max))))
      (message-goto-body)
      (re-search-forward wl-message-attachment-word-regex end t))))

(defun wl-message-attachment-found-p ()
  "If there is really attachment"
  (save-excursion
    (message-goto-body)
    (re-search-forward "<#part .+ filename=.+ disposition=attachment>" nil t)))

(defadvice message-fix-before-sending (after attachment-reminder
                                             ())
  (message-check 'attachment
    (when (and (wl-message-attachment-mentioned-p)
               (not (wl-message-attachment-found-p)))
      (unless (y-or-n-p "Attachment not found; continue sending? ")
        (error "Attachment not found")))))

(ad-activate 'message-fix-before-sending)