;;; nndiary.el --- A diary backend for Gnus
-;; Copyright (C) 1999-2001 Didier Verna.
+;; Copyright (C) 1999, 2000, 2001, 2003
+;; Free Software Foundation, Inc.
;; Author: Didier Verna <didier@xemacs.org>
;; Maintainer: Didier Verna <didier@xemacs.org>
;; Created: Fri Jul 16 18:55:42 1999
-;; Last Revision: Wed Aug 8 17:36:21 2001
;; Keywords: calendar mail news
-;; This file is part of Gnus.
+;; This file is part of GNU Emacs.
-;; Gnus is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
-;; Gnus is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; Compatibility Functions =================================================
-(if (fboundp 'signal-error)
+(eval-and-compile
+ (if (fboundp 'signal-error)
+ (defun nndiary-error (&rest args)
+ (apply #'signal-error 'nndiary args))
(defun nndiary-error (&rest args)
- (apply #'signal-error 'nndiary args))
- (defun nndiary-error (&rest args)
- (apply #'error args)))
+ (apply #'error args))))
;; Backend behavior customization ===========================================
(defgroup nndiary nil
"The Gnus Diary backend."
+ :version "22.1"
:group 'gnus-diary)
(defcustom nndiary-mail-sources
(interactive)
(message "NNDiary version %s" nndiary-version))
-
(defvoo nndiary-nov-file-name ".overview")
(defvoo nndiary-current-directory nil)
;; the (relative) number of seconds ahead GMT.
)
+(defsubst nndiary-schedule ()
+ (let (head)
+ (condition-case arg
+ (mapcar
+ (lambda (elt)
+ (setq head (nth 0 elt))
+ (nndiary-parse-schedule (nth 0 elt) (nth 1 elt) (nth 2 elt)))
+ nndiary-headers)
+ (t
+ (nnheader-report 'nndiary "X-Diary-%s header parse error: %s."
+ head (cdr arg))
+ nil))
+ ))
;;; Interface functions =====================================================
(with-temp-buffer
(nndiary-request-article number group server (current-buffer))
(let ((nndiary-current-directory nil))
- (nnmail-expiry-target-group nnmail-expiry-target group))))
+ (nnmail-expiry-target-group nnmail-expiry-target group)))
+ (nndiary-possibly-change-directory group server))
(nnheader-message 5 "Deleting article %s in %s" number group)
(condition-case ()
(funcall nnmail-delete-file-function article)
(when (nndiary-schedule)
(let (result)
(when nnmail-cache-accepted-message-ids
- (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+ (nnmail-cache-insert (nnmail-fetch-field "message-id")
+ group
+ (nnmail-fetch-field "subject")))
(if (stringp group)
(and
(nnmail-activate 'nndiary)
(search-forward id nil t)) ; We find the ID.
;; And the id is in the fourth field.
(if (not (and (search-backward "\t" nil t 4)
- (not (search-backward"\t" (gnus-point-at-bol) t))))
+ (not (search-backward"\t" (point-at-bol) t))))
(forward-line 1)
(beginning-of-line)
(setq found t)
(narrow-to-region
(goto-char (point-min))
(if (search-forward "\n\n" nil t) (1- (point)) (point-max))))
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- ;; Remove any tabs; they are too confusing.
- (subst-char-in-region (point-min) (point-max) ?\t ? )
- (let ((headers (nnheader-parse-head t)))
+ (let ((headers (nnheader-parse-naked-head)))
(mail-header-set-chars headers chars)
(mail-header-set-number headers number)
headers))))
(push (list group
(cons (or (caar files) (1+ last))
(max last
- (or (let ((f files))
- (while (cdr f) (setq f (cdr f)))
- (caar f))
+ (or (caar (last files))
0))))
nndiary-group-alist)))
(nndiary-parse-schedule-value (match-string 1) min-or-values max))
))
-(defsubst nndiary-schedule ()
- (let (head)
- (condition-case arg
- (mapcar
- (lambda (elt)
- (setq head (nth 0 elt))
- (nndiary-parse-schedule (nth 0 elt) (nth 1 elt) (nth 2 elt)))
- nndiary-headers)
- (t
- (nnheader-report 'nndiary "X-Diary-%s header parse error: %s."
- head (cdr arg))
- nil))
- ))
-
(defun nndiary-max (spec)
;; Returns the max of specification SPEC, or nil for permanent schedules.
(unless (null spec)
(nth 6 date-elts))))
reminder res)
;; remove the DOW and DST entries
- (setf (nthcdr 6 date-elts) (nthcdr 8 date-elts))
+ (setcdr (nthcdr 5 date-elts) (nthcdr 8 date-elts))
(while (setq reminder (pop reminders))
(push
(cond ((eq (cdr reminder) 'minute)
(provide 'nndiary)
+;;; arch-tag: 9c542b95-92e7-4ace-a038-330ab296e203
;;; nndiary.el ends here