2012年7月 7日

Marking certain folders as read automatically

Hi list,

there does not seem to be a way to easily select folders to be always mark as
fully read. For this reason I hacked up this little script that will do so (with
groups too). Specifically, all the folders or the group with a name that matches
an element in `wl-folder-auto-read' will be marked automatically as read after
checking:

-------------------8<-----------------------------

(setq wl-auto-read-folders nil)

(defun wl-folder-auto-read-execute (entity-name entity)
(when (member entity-name wl-auto-read-folders)
(wl-folder-mark-as-read-all-entity entity)
t))

(defun wl-folder-auto-read-check (entity)
(cond ((consp entity)
(unless (wl-folder-auto-read-execute (car entity) entity)
(mapc (lambda (entity-1)
(wl-folder-auto-read-check entity-1))
(nth 2 entity))))
((stringp entity)
(wl-folder-auto-read-execute entity entity))
(t (error "Invalid entity"))))

(defadvice wl-folder-check-entity (after wl-folder-auto-read
(entity &optional auto))
(when wl-auto-read-folders
(wl-folder-auto-read-check entity)))

(ad-activate 'wl-folder-check-entity)

------------------->8-----------------------------

Admittedly this is quite an ugly way. The problem is that the
`wl-folder-check-entity-hook' does not have any information on the entity being
checked. But you know, it works! I'm open to nicer ways to do this.

--
Francesco * Often in error, never in doubt


投稿者 xml-rpc : 2012年7月 7日 05:20
役に立ちました?:
過去のフィードバック 平均:(0) 総合:(0) 投票回数:(0)
本記事へのTrackback: http://hoop.euqset.org/blog/mt-tb2006.cgi/110087
トラックバック
コメント
コメントする




画像の中に見える文字を入力してください。