X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnndiary.el;h=3189d33dd5a5fc0c04e8e550e66f5bc7a8fd6bd5;hb=0f63151c0cfcb3498678c203edb84e6a1d2b57e0;hp=1fa9684482d6c22089ac3abff718ef5eb8aaed65;hpb=75880493a6a9dad9607a4002d4c6ab2895b110ca;p=gnus diff --git a/lisp/nndiary.el b/lisp/nndiary.el index 1fa968448..3189d33dd 100644 --- a/lisp/nndiary.el +++ b/lisp/nndiary.el @@ -1,7 +1,7 @@ ;;; nndiary.el --- A diary back end for Gnus -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Didier Verna ;; Maintainer: Didier Verna @@ -10,9 +10,9 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs 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 +;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -21,9 +21,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -69,7 +67,7 @@ ;; IMHO, nnoo is actually badly designed. A much simpler, and yet more ;; powerful one would be to make *real* functions and variables for a new ;; back end based on another. Lisp is a reflexive language so that's a very -;; easy thing to do: inspect the function's form, replace occurences of +;; easy thing to do: inspect the function's form, replace occurrences of ;; (even in strings) with , and you're done. ;; * nndiary-get-new-mail, nndiary-mail-source and nndiary-split-methods: @@ -131,7 +129,7 @@ non-nil." (defcustom nndiary-reminders '((0 . day)) - "*Different times when you want to be reminded of your appointements. + "*Different times when you want to be reminded of your appointments. Diary articles will appear again, as if they'd been just received. Entries look like (3 . day) which means something like \"Please @@ -144,8 +142,8 @@ not 'century, sorry). NOTE: the units of measure actually express dates, not durations: if you use 'week, messages will pop up on Sundays at 00:00 (or Mondays if -`nndiary-week-starts-on-monday' is non nil) and *not* 7 days before the -appointement, if you use 'month, messages will pop up on the first day of +`nndiary-week-starts-on-monday' is non-nil) and *not* 7 days before the +appointment, if you use 'month, messages will pop up on the first day of each months, at 00:00 and so on. If you really want to specify a duration (like 24 hours exactly), you can @@ -155,15 +153,15 @@ scheme might appear somewhat weird at a first glance, it is very powerful. In order to make this clear, here are some examples: - '(0 . day): this is the default value of `nndiary-reminders'. It means - pop up the appointements of the day each morning at 00:00. + pop up the appointments of the day each morning at 00:00. -- '(1 . day): this means pop up the appointements the day before, at 00:00. +- '(1 . day): this means pop up the appointments the day before, at 00:00. -- '(6 . hour): for an appointement at 18:30, this would pop up the - appointement message at 12:00. +- '(6 . hour): for an appointment at 18:30, this would pop up the + appointment message at 12:00. -- '(360 . minute): for an appointement at 18:30 and 15 seconds, this would - pop up the appointement message at 12:30." +- '(360 . minute): for an appointment at 18:30 and 15 seconds, this would + pop up the appointment message at 12:30." :group 'nndiary :type '(repeat (cons :format "%v\n" (integer :format "%v") @@ -370,7 +368,7 @@ all. This may very well take some time.") (setq head (nth 0 elt)) (nndiary-parse-schedule (nth 0 elt) (nth 1 elt) (nth 2 elt))) nndiary-headers) - (t + (error (nnheader-report 'nndiary "X-Diary-%s header parse error: %s." head (cdr arg)) nil)) @@ -1085,7 +1083,7 @@ all. This may very well take some time.") (unless no-active (nnmail-save-active nndiary-group-alist nndiary-active-file)))))) -(eval-when-compile (defvar files)) +(defvar files) (defun nndiary-generate-active-info (dir) ;; Update the active info for this group. (let* ((group (nnheader-file-to-group @@ -1324,7 +1322,7 @@ all. This may very well take some time.") (sort res 'time-less-p))) (defun nndiary-last-occurence (sched) - ;; Returns the last occurence of schedule SCHED as an Emacs time struct, or + ;; Returns the last occurrence of schedule SCHED as an Emacs time struct, or ;; nil for permanent schedule or errors. (let ((minute (nndiary-max (nth 0 sched))) (hour (nndiary-max (nth 1 sched))) @@ -1395,7 +1393,7 @@ all. This may very well take some time.") (encode-time 0 minute hour (car days) month year time-zone))) ))))) - ;; There's an upper limit, but we didn't find any last occurence. + ;; There's an upper limit, but we didn't find any last occurrence. ;; This means that the schedule is undecidable. This can happen if ;; you happen to say something like "each Feb 31 until 2038". (progn @@ -1404,8 +1402,8 @@ all. This may very well take some time.") )))) (defun nndiary-next-occurence (sched now) - ;; Returns the next occurence of schedule SCHED, starting from time NOW. - ;; If there's no next occurence, returns the last one (if any) which is then + ;; Returns the next occurrence of schedule SCHED, starting from time NOW. + ;; If there's no next occurrence, returns the last one (if any) which is then ;; in the past. (let* ((today (decode-time now)) (this-minute (nth 1 today)) @@ -1559,12 +1557,12 @@ all. This may very well take some time.") ;; The article should be re-considered as unread if there's a reminder ;; between the group timestamp and the current time. (when (and sched (setq sched (nndiary-next-occurence sched now))) - (let ((reminders ;; add the next occurence itself at the end. + (let ((reminders ;; add the next occurrence itself at the end. (append (nndiary-compute-reminders sched) (list sched)))) (while (and reminders (time-less-p (car reminders) timestamp)) (pop reminders)) ;; The reminders might be empty if the last date is in the past, - ;; or we've got at least the next occurence itself left. All past + ;; or we've got at least the next occurrence itself left. All past ;; dates are renewed. (or (not reminders) (time-less-p (car reminders) now))) @@ -1575,19 +1573,15 @@ all. This may very well take some time.") ;; The end... =============================================================== -(mapcar - (lambda (elt) - (let ((header (intern (format "X-Diary-%s" (car elt))))) - ;; Required for building NOV databases and some other stuff - (add-to-list 'gnus-extra-headers header) - (add-to-list 'nnmail-extra-headers header))) - nndiary-headers) +(dolist (header nndiary-headers) + (setq header (intern (format "X-Diary-%s" (car header)))) + ;; Required for building NOV databases and some other stuff. + (add-to-list 'gnus-extra-headers header) + (add-to-list 'nnmail-extra-headers header)) (unless (assoc "nndiary" gnus-valid-select-methods) (gnus-declare-backend "nndiary" 'post-mail 'respool 'address)) (provide 'nndiary) - -;;; arch-tag: 9c542b95-92e7-4ace-a038-330ab296e203 ;;; nndiary.el ends here