projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gnus-art.el (gnus-button-alist): Also support quotes 'like this'
[gnus]
/
lisp
/
nndiary.el
diff --git
a/lisp/nndiary.el
b/lisp/nndiary.el
index
7235e4b
..
027d888
100644
(file)
--- a/
lisp/nndiary.el
+++ b/
lisp/nndiary.el
@@
-1,7
+1,6
@@
;;; nndiary.el --- A diary back end for Gnus
;;; nndiary.el --- A diary back end for Gnus
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
;; Author: Didier Verna <didier@xemacs.org>
;; Maintainer: Didier Verna <didier@xemacs.org>
;; Author: Didier Verna <didier@xemacs.org>
;; Maintainer: Didier Verna <didier@xemacs.org>
@@
-56,7
+55,7
@@
;; * nnoo. NNDiary is very similar to nnml. This makes the idea of using nnoo
;; (to derive nndiary from nnml) natural. However, my experience with nnoo
;; * nnoo. NNDiary is very similar to nnml. This makes the idea of using nnoo
;; (to derive nndiary from nnml) natural. However, my experience with nnoo
-;; is that for reasonably complex back ends like this one, noo is a burden
+;; is that for reasonably complex back ends like this one, n
n
oo is a burden
;; rather than an help. It's tricky to use, not everything can be inherited,
;; what can be inherited and when is not very clear, and you've got to be
;; very careful because a little mistake can fuck up your other back ends,
;; rather than an help. It's tricky to use, not everything can be inherited,
;; what can be inherited and when is not very clear, and you've got to be
;; very careful because a little mistake can fuck up your other back ends,
@@
-72,8
+71,8
@@
;; * nndiary-get-new-mail, nndiary-mail-source and nndiary-split-methods:
;; NNDiary has some experimental parts, in the sense Gnus normally uses only
;; * nndiary-get-new-mail, nndiary-mail-source and nndiary-split-methods:
;; NNDiary has some experimental parts, in the sense Gnus normally uses only
-;; one mail back ends for mail retr
ei
val and splitting. This back end is
-;; also an attempt to make it behave differently. For Gnus develop
p
ers: as
+;; one mail back ends for mail retr
ie
val and splitting. This back end is
+;; also an attempt to make it behave differently. For Gnus developers: as
;; you can see if you snarf into the code, that was not a very difficult
;; thing to do. Something should be done about the respooling breakage
;; though.
;; you can see if you snarf into the code, that was not a very difficult
;; thing to do. Something should be done about the respooling breakage
;; though.
@@
-180,22
+179,28
@@
In order to make this clear, here are some examples:
:group 'nndiary)
:group 'nndiary)
-(defcustom nndiary-request-create-group-hooks nil
- "*Hooks to run after `nndiary-request-create-group' is executed.
-The hooks will be called with the full group name as argument."
+(define-obsolete-variable-alias 'nndiary-request-create-group-hooks
+ 'nndiary-request-create-group-functions "24.3")
+(defcustom nndiary-request-create-group-functions nil
+ "*Hook run after `nndiary-request-create-group' is executed.
+The hook functions will be called with the full group name as argument."
:group 'nndiary
:type 'hook)
:group 'nndiary
:type 'hook)
-(defcustom nndiary-request-update-info-hooks nil
- "*Hooks to run after `nndiary-request-update-info-group' is executed.
-The hooks will be called with the full group name as argument."
+(define-obsolete-variable-alias 'nndiary-request-update-info-hooks
+ 'nndiary-request-update-info-functions "24.3")
+(defcustom nndiary-request-update-info-functions nil
+ "*Hook run after `nndiary-request-update-info-group' is executed.
+The hook functions will be called with the full group name as argument."
:group 'nndiary
:type 'hook)
:group 'nndiary
:type 'hook)
-(defcustom nndiary-request-accept-article-hooks nil
- "*Hooks to run before accepting an article.
+(define-obsolete-variable-alias 'nndiary-request-accept-article-hooks
+ 'nndiary-request-accept-article-functions "24.3")
+(defcustom nndiary-request-accept-article-functions nil
+ "*Hook run before accepting an article.
Executed near the beginning of `nndiary-request-accept-article'.
Executed near the beginning of `nndiary-request-accept-article'.
-The hooks will be called with the article in the current buffer."
+The hook
function
s will be called with the article in the current buffer."
:group 'nndiary
:type 'hook)
:group 'nndiary
:type 'hook)
@@
-225,7
+230,7
@@
The hooks will be called with the article in the current buffer."
(defvoo nndiary-get-new-mail nil
"Whether nndiary gets new mail and split it.
Contrary to traditional mail back ends, this variable can be set to t
(defvoo nndiary-get-new-mail nil
"Whether nndiary gets new mail and split it.
Contrary to traditional mail back ends, this variable can be set to t
-even if your primary mail back end also retr
ei
ves mail. In such a case,
+even if your primary mail back end also retr
ie
ves mail. In such a case,
NDiary uses its own mail-sources and split-methods.")
(defvoo nndiary-nov-is-evil nil
NDiary uses its own mail-sources and split-methods.")
(defvoo nndiary-nov-is-evil nil
@@
-354,7
+359,7
@@
all. This may very well take some time.")
;; List of NNDiary headers that specify the time spec. Each header name is
;; followed by either two integers (specifying a range of possible values
;; for this header) or one list (specifying all the possible values for this
;; List of NNDiary headers that specify the time spec. Each header name is
;; followed by either two integers (specifying a range of possible values
;; for this header) or one list (specifying all the possible values for this
- ;; header). In the latter case, the list does NOT include the unspecif
y
ed
+ ;; header). In the latter case, the list does NOT include the unspecif
i
ed
;; spec (*).
;; For time zone values, we have symbolic time zone names associated with
;; the (relative) number of seconds ahead GMT.
;; spec (*).
;; For time zone values, we have symbolic time zone names associated with
;; the (relative) number of seconds ahead GMT.
@@
-542,7
+547,7
@@
all. This may very well take some time.")
(setcar active (apply 'min articles))
(setcdr active (apply 'max articles))))
(nnmail-save-active nndiary-group-alist nndiary-active-file)
(setcar active (apply 'min articles))
(setcdr active (apply 'max articles))))
(nnmail-save-active nndiary-group-alist nndiary-active-file)
- (run-hook-with-args 'nndiary-request-create-group-
hook
s
+ (run-hook-with-args 'nndiary-request-create-group-
function
s
(gnus-group-prefixed-name group
(list "nndiary" server)))
t))
(gnus-group-prefixed-name group
(list "nndiary" server)))
t))
@@
-634,7
+639,7
@@
all. This may very well take some time.")
(deffoo nndiary-request-accept-article (group &optional server last)
(nndiary-possibly-change-directory group server)
(nnmail-check-syntax)
(deffoo nndiary-request-accept-article (group &optional server last)
(nndiary-possibly-change-directory group server)
(nnmail-check-syntax)
- (run-hooks 'nndiary-request-accept-article-
hook
s)
+ (run-hooks 'nndiary-request-accept-article-
function
s)
(when (nndiary-schedule)
(let (result)
(when nnmail-cache-accepted-message-ids
(when (nndiary-schedule)
(let (result)
(when nnmail-cache-accepted-message-ids
@@
-805,7
+810,7
@@
all. This may very well take some time.")
(gnus-info-set-read info (gnus-update-read-articles
(gnus-info-group info) unread t)))
))
(gnus-info-set-read info (gnus-update-read-articles
(gnus-info-group info) unread t)))
))
- (run-hook-with-args 'nndiary-request-update-info-
hook
s
+ (run-hook-with-args 'nndiary-request-update-info-
function
s
(gnus-info-group info))
t))
(gnus-info-group info))
t))
@@
-1061,9
+1066,9
@@
all. This may very well take some time.")
(file-directory-p dir))
(nndiary-generate-nov-databases-1 dir seen))))
;; Do this directory.
(file-directory-p dir))
(nndiary-generate-nov-databases-1 dir seen))))
;; Do this directory.
- (let ((files (sort (nnheader-article-to-file-alist dir)
+ (let ((
nndiary-
files (sort (nnheader-article-to-file-alist dir)
'car-less-than-car)))
'car-less-than-car)))
- (if (not files)
+ (if (not
nndiary-
files)
(let* ((group (nnheader-file-to-group
(directory-file-name dir) nndiary-directory))
(info (cadr (assoc group nndiary-group-alist))))
(let* ((group (nnheader-file-to-group
(directory-file-name dir) nndiary-directory))
(info (cadr (assoc group nndiary-group-alist))))
@@
-1071,11
+1076,11
@@
all. This may very well take some time.")
(setcar info (1+ (cdr info)))))
(funcall nndiary-generate-active-function dir)
;; Generate the nov file.
(setcar info (1+ (cdr info)))))
(funcall nndiary-generate-active-function dir)
;; Generate the nov file.
- (nndiary-generate-nov-file dir files)
+ (nndiary-generate-nov-file dir
nndiary-
files)
(unless no-active
(nnmail-save-active nndiary-group-alist nndiary-active-file))))))
(unless no-active
(nnmail-save-active nndiary-group-alist nndiary-active-file))))))
-(defvar
files)
+(defvar
nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1
(defun nndiary-generate-active-info (dir)
;; Update the active info for this group.
(let* ((group (nnheader-file-to-group
(defun nndiary-generate-active-info (dir)
;; Update the active info for this group.
(let* ((group (nnheader-file-to-group
@@
-1084,9
+1089,9
@@
all. This may very well take some time.")
(last (or (caadr entry) 0)))
(setq nndiary-group-alist (delq entry nndiary-group-alist))
(push (list group
(last (or (caadr entry) 0)))
(setq nndiary-group-alist (delq entry nndiary-group-alist))
(push (list group
- (cons (or (caar files) (1+ last))
+ (cons (or (caar
nndiary-
files) (1+ last))
(max last
(max last
- (or (caar (last files))
+ (or (caar (last
nndiary-
files))
0))))
nndiary-group-alist)))
0))))
nndiary-group-alist)))
@@
-1162,11
+1167,11
@@
all. This may very well take some time.")
(defun nndiary-parse-schedule-value (str min-or-values max)
;; Parse the schedule string STR, or signal an error.
(defun nndiary-parse-schedule-value (str min-or-values max)
;; Parse the schedule string STR, or signal an error.
- ;; Signals are caught by `nndary-schedule'.
+ ;; Signals are caught by `nnd
i
ary-schedule'.
(if (string-match "[ \t]*\\*[ \t]*" str)
(if (string-match "[ \t]*\\*[ \t]*" str)
- ;; unspecif
y
ed
+ ;; unspecif
i
ed
nil
nil
- ;; specif
y
ed
+ ;; specif
i
ed
(if (listp min-or-values)
;; min-or-values is values
;; #### NOTE: this is actually only a hack for time zones.
(if (listp min-or-values)
;; min-or-values is values
;; #### NOTE: this is actually only a hack for time zones.
@@
-1205,7
+1210,7
@@
all. This may very well take some time.")
;; - Returns nil if `*'
;; - Otherwise returns a list of integers and/or ranges (BEG . END)
;; The exception is the Timze-Zone value which is always of the form (STR).
;; - Returns nil if `*'
;; - Otherwise returns a list of integers and/or ranges (BEG . END)
;; The exception is the Timze-Zone value which is always of the form (STR).
- ;; Signals are caught by `nndary-schedule'.
+ ;; Signals are caught by `nnd
i
ary-schedule'.
(let ((header (format "^X-Diary-%s: \\(.*\\)$" head)))
(goto-char (point-min))
(if (not (re-search-forward header nil t))
(let ((header (format "^X-Diary-%s: \\(.*\\)$" head)))
(goto-char (point-min))
(if (not (re-search-forward header nil t))
@@
-1309,6
+1314,8
@@
all. This may very well take some time.")
res))
(sort res 'time-less-p)))
res))
(sort res 'time-less-p)))
+;; FIXME: "occurrence" is misspelled in this function name.
+
(defun nndiary-last-occurence (sched)
;; Returns the last occurrence of schedule SCHED as an Emacs time struct, or
;; nil for permanent schedule or errors.
(defun nndiary-last-occurence (sched)
;; Returns the last occurrence of schedule SCHED as an Emacs time struct, or
;; nil for permanent schedule or errors.
@@
-1321,7
+1328,7
@@
all. This may very well take some time.")
(or minute (setq minute 59))
(or hour (setq hour 23))
;; I'll just compute all possible values and test them by decreasing
(or minute (setq minute 59))
(or hour (setq hour 23))
;; I'll just compute all possible values and test them by decreasing
- ;; order until one succeeds. This is probably qui
d
e rude, but I got
+ ;; order until one succeeds. This is probably qui
t
e rude, but I got
;; bored in finding a good algorithm for doing that ;-)
;; ### FIXME: remove identical entries.
(let ((dom-list (nth 2 sched))
;; bored in finding a good algorithm for doing that ;-)
;; ### FIXME: remove identical entries.
(let ((dom-list (nth 2 sched))
@@
-1389,6
+1396,8
@@
all. This may very well take some time.")
nil))
))))
nil))
))))
+;; FIXME: "occurrence" is misspelled in this function name.
+
(defun nndiary-next-occurence (sched now)
;; 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
(defun nndiary-next-occurence (sched now)
;; 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