1 ;;; planner-wl.el --- Wanderlust integration for the Emacs Planner
3 ;; Copyright (C) 2004 Yvonne Thomson (yvonne AT netbrains DOT com DOT au)
4 ;; Parts copyright (C) 2004 Angus Lees (gus AT inodes DOT org)
6 ;; Author: Yvonne Thomson (yvonne AT thewatch DOT net)
7 ;; Keywords: planner, wanderlust, wl
8 ;; URL: http://www.plannerlove.com/
10 ;; This file is part of Planner. It is not part of GNU Emacs.
12 ;; Planner is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; Planner is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with Planner; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
31 ;; (require 'planner-wl)
33 ;; to your .emacs or .wl. You will then be able to call
34 ;; M-x planner-create-task-from-buffer from Wanderlust summary buffers
35 ;; with the correct annotation.
37 ;; To add keybindings to Wanderlust, call (from .emacs or .wl)
39 ;; (planner-wl-insinuate)
41 ;; This binds F in summary buffers to `planner-create-task-from-buffer'
44 ;; `planner-wl-annotation-from-wl' uses `wl-summary-from-function' (and
45 ;; related options) rather than `planner-ignored-from-addresses'
47 ;; URLs are of the form wl://foldername/msg-id
51 ;; Angus Lees (gus AT inodes DOT org) remade quite a bit of this file.
53 ;; Jeremy Cowgar (jeremy AT cowgar DOT com) updated this to work with
63 (defun planner-wl-insinuate ()
64 "Hook Planner into Wanderlust.
66 Adds special planner keybindings to the variable `wl-summary-mode-map'.
67 From the Wanderlust Summary view, you can type:
69 F planner-task-from-wl"
70 (define-key wl-summary-mode-map
"F" 'planner-create-task-from-buffer
))
73 (defun planner-wl-annotation-from-wl ()
74 "If called from wl, return an annotation.
75 Suitable for use in `planner-annotation-functions'."
76 (when (equal major-mode
'wl-summary-mode
)
77 (let* ((msgnum (wl-summary-message-number))
78 (msg-id (elmo-message-field wl-summary-buffer-elmo-folder
81 (if (fboundp 'elmo-message-entity
)
83 wl-summary-buffer-elmo-folder msgnum
)
84 (elmo-msgdb-overview-get-entity
85 msgnum
(wl-summary-buffer-msgdb)))))
87 (concat "wl://" wl-summary-buffer-folder-name
"/" msg-id
)
88 (concat "E-Mail " (wl-summary-line-from))
92 (defun planner-wl-browse-url (url)
93 "If this is a Wanderlust URL, jump to it."
94 (when (string-match "\\`wl:/*\\(.+\\)/\\(.+\\)" url
)
95 (let ((group (match-string 1 url
))
96 (article (match-string 2 url
)))
97 (wl-summary-goto-folder-subr group
'no-sync t nil t
)
98 (wl-summary-jump-to-msg-by-message-id article
)
99 (wl-summary-redisplay)
100 ;; force a non-nil return value
103 (planner-add-protocol "wl:/*" 'planner-wl-browse-url nil
)
104 (custom-add-option 'planner-annotation-functions
105 'planner-wl-annotation-from-wl
)
106 (add-hook 'planner-annotation-functions
'planner-wl-annotation-from-wl
)
108 (provide 'planner-wl
)
110 ;;; planner-wl.el ends here