1 ;;; remember-bbdb --- BBDB support for remember.el
3 ;; Copyright (C) 1999, 2000, 2001 John Wiegley
4 ;; Copyright (C) 2003 Sandra Jean Chua
6 ;; Author: John Wiegley <johnw@gnu.org>
7 ;; Maintainer: Sacha Chua <sacha@free.net.ph>
8 ;; Created: 29 Mar 1999
9 ;; Keywords: data memory todo pim bbdb
10 ;; URL: http://gna.org/projects/remember-el/
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it 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 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
29 ;; This adds completing reads to remember-bbdb-store-in-mailbox. To
30 ;; use, add (require 'remember-bbdb) to your .emacs, and make your
31 ;; remember-handler-functions include remember-bbdb-store-in-mailbox.
39 (defun remember-bbdb-store-in-mailbox ()
40 "Store remember data as if it were incoming mail.
41 In which case `remember-mailbox' should be the name of the mailbox.
42 Each piece of psuedo-mail created will have an `X-Todo-Priority'
43 field, for the purpose of appropriate splitting."
44 (let ((who (bbdb-completing-read-record
45 "Who is this item related to? "))
47 (format "%.0f" (remember-time-to-seconds (current-time))))
48 (desc (remember-buffer-desc))
49 (text (buffer-string))
53 (let ((net (bbdb-record-net who
)))
54 (setq name
(bbdb-record-name who
)
55 address
(if (listp net
)
60 (setq name
(user-full-name)
61 address user-mail-address
)))
66 Message-Id: <remember-%s@%s>
72 (remember-mail-date t
)
73 (if (and name address
)
74 (format "%s <%s>" name address
)
77 remember-default-priority
78 (user-full-name) user-mail-address
86 (while (re-search-forward "^\\(From[: ]\\)" nil t
)
87 (replace-match ">\\1")))
88 (append-to-file (point-min) (point-max) remember-mailbox
)
91 (custom-add-option 'remember-handler-functions
'remember-bbdb-store-in-mailbox
)
93 (provide 'remember-bbdb
)
95 ;;; remember-bbdb.el ends here