]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/nndiary.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / gnus / nndiary.el
index 027d88887057243c734e151391bb0ccc06cccdef..71229dd9394da70599844d7fae0c5b0f09c3c1c8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nndiary.el --- A diary back end for Gnus
 
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
 
 ;; Author:        Didier Verna <didier@xemacs.org>
 ;; Maintainer:    Didier Verna <didier@xemacs.org>
 (require 'gnus-start)
 (require 'gnus-sum)
 
-;; Compatibility Functions  =================================================
-
-(eval-and-compile
-  (if (fboundp 'signal-error)
-      (defun nndiary-error (&rest args)
-       (apply #'signal-error 'nndiary args))
-    (defun nndiary-error (&rest args)
-      (apply #'error args))))
-
-
 ;; Back End behavior customization ===========================================
 
 (defgroup nndiary nil
@@ -151,15 +141,15 @@ maximum in the reminder is not that painful, I think.  Although this
 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
+- (0 . day): this is the default value of `nndiary-reminders'.  It means
   pop up the appointments of the day each morning at 00:00.
 
-- '(1 . day): this means pop up the appointments the day before, at 00:00.
+- (1 . day): this means pop up the appointments the day before, at 00:00.
 
-- '(6 . hour): for an appointment at 18:30, this would pop up the
+- (6 . hour): for an appointment at 18:30, this would pop up the
   appointment message at 12:00.
 
-- '(360 . minute): for an appointment at 18:30 and 15 seconds, this would
+- (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"
@@ -423,7 +413,7 @@ all.  This may very well take some time.")
                   (> number nnmail-large-newsgroup)
                   (zerop (% count 20))
                   (nnheader-message 6 "nndiary: Receiving headers... %d%%"
-                                    (/ (* count 100) number))))
+                                    (floor (* count 100.0) number))))
 
            (and (numberp nnmail-large-newsgroup)
                 (> number nnmail-large-newsgroup)
@@ -1157,12 +1147,12 @@ all.  This may very well take some time.")
   ;; within the specified bounds.
   ;; Signals are caught by `nndiary-schedule'.
   (if (not (string-match "^[ \t]*[0-9]+[ \t]*$" str))
-      (nndiary-error "not an integer value")
+      (error "Not an integer value")
     ;; else
     (let ((val (string-to-number str)))
       (and (or (< val min)
               (and max (> val max)))
-          (nndiary-error "value out of range"))
+          (error "Value out of range"))
       val)))
 
 (defun nndiary-parse-schedule-value (str min-or-values max)
@@ -1179,7 +1169,7 @@ all.  This may very well take some time.")
                        (match-string 1 str))))
          (if (and val (setq val (assoc val min-or-values)))
              (list (cadr val))
-           (nndiary-error "invalid syntax")))
+           (error "Invalid syntax")))
       ;; min-or-values is min
       (mapcar
        (lambda (val)
@@ -1199,7 +1189,7 @@ all.  This may very well take some time.")
                     (t
                      (cons end beg)))))
            (t
-            (nndiary-error "invalid syntax")))
+            (error "Invalid syntax")))
           ))
        (split-string str ",")))
     ))
@@ -1214,7 +1204,7 @@ all.  This may very well take some time.")
   (let ((header (format "^X-Diary-%s: \\(.*\\)$" head)))
     (goto-char (point-min))
     (if (not (re-search-forward header nil t))
-       (nndiary-error "header missing")
+       (error "Header missing")
       ;; else
       (nndiary-parse-schedule-value (match-string 1) min-or-values max))
     ))