X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnndiary.el;h=b3b7cf30bacad058597f88f85aa644b98b011004;hb=9b741e050b400987d68ff761c6cc3276c932839c;hp=72dd7b7cd4d87cd4452829db12cf4489988745ec;hpb=ba8e3d47d290f551dc63882490400498d14dcb8a;p=elisp%2Fgnus.git- diff --git a/lisp/nndiary.el b/lisp/nndiary.el index 72dd7b7..b3b7cf3 100644 --- a/lisp/nndiary.el +++ b/lisp/nndiary.el @@ -1,21 +1,21 @@ ;;; nndiary.el --- A diary backend for Gnus -;; Copyright (C) 1999-2001 Didier Verna. +;; Copyright (C) 1999, 2000, 2001 +;; Free Software Foundation, Inc. ;; Author: Didier Verna ;; Maintainer: Didier Verna ;; 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 NNDiary. +;; This file is part of GNU Emacs. -;; NNDiary 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. -;; NNDiary 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. @@ -211,11 +211,12 @@ ;; 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 =========================================== @@ -363,25 +364,7 @@ all. This may very well take some time.") -;; $Format: "(defconst nndiary-prcs-major-version \"$ProjectMajorVersion$\")"$ -(defconst nndiary-prcs-major-version "branch-0-2") -;; $Format: "(defconst nndiary-prcs-minor-version \"$ProjectMinorVersion$\")"$ -(defconst nndiary-prcs-minor-version "13") -(defconst nndiary-version - (let ((level nndiary-prcs-minor-version) - major minor status) - (string-match "\\(branch\\|version\\)-\\([0-9]+\\)-\\([0-9]+\\)" - nndiary-prcs-major-version) - (setq major (match-string 2 nndiary-prcs-major-version) - minor (match-string 3 nndiary-prcs-major-version) - status (match-string 1 nndiary-prcs-major-version)) - (cond ((string= status "version") - (setq level (int-to-string (1- (string-to-int level)))) - (if (eq level 0) - (concat major "." minor) - (concat major "." minor "." level))) - ((string= status "branch") - (concat major "." minor "-b" level)))) +(defconst nndiary-version "0.2-b14" "Current Diary backend version.") (defun nndiary-version () @@ -389,7 +372,6 @@ all. This may very well take some time.") (interactive) (message "NNDiary version %s" nndiary-version)) - (defvoo nndiary-nov-file-name ".overview") (defvoo nndiary-current-directory nil) @@ -497,6 +479,19 @@ all. This may very well take some time.") ;; 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 ===================================================== @@ -709,7 +704,8 @@ all. This may very well take some time.") (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) @@ -763,7 +759,7 @@ all. This may very well take some time.") (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)) (if (stringp group) (and (nnmail-activate 'nndiary) @@ -1355,20 +1351,6 @@ all. This may very well take some time.") (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)