]> git.eshelyaron.com Git - emacs.git/commitdiff
(diary-mail-entries): Use `compose-mail'
authorSam Steingold <sds@gnu.org>
Tue, 6 Aug 2002 15:11:26 +0000 (15:11 +0000)
committerSam Steingold <sds@gnu.org>
Tue, 6 Aug 2002 15:11:26 +0000 (15:11 +0000)
and `mail-user-agent' instead of straight sendmail.
(diary-modified, diary-entries-list, displayed-year)
(displayed-month, entry, date, number, date-string, d-file)
(original-date): defvar without binding to avoid compiler warnings.

lisp/ChangeLog
lisp/calendar/diary-lib.el

index 4a0376feaa3578a3b286484106440804d9ec4a34..0445f3e75175b01dfed70063ebd13e0fb29b09e8 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-06  Sam Steingold  <sds@gnu.org>
+
+       * calendar/diary-lib.el (diary-mail-entries): Use `compose-mail'
+       and `mail-user-agent' instead of straight sendmail.
+       (diary-modified, diary-entries-list, displayed-year)
+       (displayed-month, entry, date, number, date-string, d-file)
+       (original-date): defvar without binding to avoid compiler warnings.
+
 2002-08-05  Alan Shutko  <ats@acm.org>
 
        * ibuffer.el (ibuffer-mode-map): Added ibuffer-filter-by-used-mode.
 2002-08-03  Kai Gro\e,A_\e(Bjohann  <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 
        * net/tramp.el: Version 2.0.7.
-       (tramp-perl-encode-with-module, tramp-perl-decode-with-module) 
+       (tramp-perl-encode-with-module, tramp-perl-decode-with-module)
        (tramp-perl-encode, tramp-perl-decode): Escape `%' characters
        because of `format' and say so in the docstring.
 
        Change prompt for args.
        (revert-buffer-with-coding-system): New command.
 
-       * international/mule-cmds.el (mule-keymap, set-coding-system-map): 
+       * international/mule-cmds.el (mule-keymap, set-coding-system-map):
        Add bindings for revert-buffer-with-coding-system.
        (set-coding-system-map): Clarify menu item info for
        set-buffer-file-coding-system.
 
        * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
        Don't call string-match on non-string.
-       (displaying-byte-compile-warnings): 
+       (displaying-byte-compile-warnings):
 
        * textmodes/ispell.el (check-ispell-version): Bind default-directory
        to avoid errors.  Kill the old temp buffer at the beginning.
index 9e8e6d4a3f38b7c567b4f0085621f530bd1282f9..548ec7a1b3dd7fd4a5ebc0ce411fbe1c9f940dcf 100644 (file)
@@ -174,6 +174,17 @@ syntax of `*' changed to be a word constituent.")
 (modify-syntax-entry ?* "w" diary-syntax-table)
 (modify-syntax-entry ?: "w" diary-syntax-table)
 
+(defvar diary-modified)
+(defvar diary-entries-list)
+(defvar displayed-year)
+(defvar displayed-month)
+(defvar entry)
+(defvar date)
+(defvar number)
+(defvar date-string)
+(defvar d-file)
+(defvar original-date)
+
 (defun list-diary-entries (date number)
   "Create and display a buffer containing the relevant lines in diary-file.
 The arguments are DATE and NUMBER; the entries selected are those
@@ -210,8 +221,8 @@ These hooks have the following distinct roles:
 
   (if (< 0 number)
       (let* ((original-date date);; save for possible use in the hooks
-             (old-diary-syntax-table)
-             (diary-entries-list)
+             old-diary-syntax-table
+             diary-entries-list
              (date-string (calendar-date-string date))
              (d-file (substitute-in-file-name diary-file)))
         (message "Preparing diary...")
@@ -616,12 +627,11 @@ to run it every morning at 1am."
                                           (if ndays ndays diary-mail-days))
                       (set-buffer fancy-diary-buffer)
                       (buffer-substring (point-min) (point-max)))))
-    (mail)
-    (mail-to) (insert diary-mail-addr)
-    (mail-subject) (insert "Diary entries generated "
-                           (calendar-date-string (calendar-current-date)))
-    (mail-text) (insert text)
-    (mail-send-and-exit nil)))
+    (compose-mail diary-mail-addr
+                  (concat "Diary entries generated "
+                          (calendar-date-string (calendar-current-date))))
+    (insert text)
+    (funcall (get mail-user-agent 'sendfunc))))
 
 
 (defun diary-name-pattern (string-array &optional fullname)
@@ -835,7 +845,7 @@ is marked.  See the documentation for the function `list-sexp-diary-entries'."
           (if (setq mark (diary-sexp-entry sexp entry
                                 (calendar-gregorian-from-absolute date)))
               (mark-visible-calendar-date
-               (calendar-gregorian-from-absolute date) 
+               (calendar-gregorian-from-absolute date)
                (if (consp mark)
                    (car mark)))))))))
 
@@ -1003,7 +1013,7 @@ A number of built-in functions are available for this type of diary entry:
                   `european-calendar-style' is nil, and DAY, MONTH, YEAR if
                   `european-calendar-style' is t.  DAY, MONTH, and YEAR
                   can be lists of integers, the constant t, or an integer.
-                  The constant t means all values.  An optional parameter 
+                  The constant t means all values.  An optional parameter
                   MARK specifies a face or single-character string to use
                   when highlighting the day in the calendar.
 
@@ -1014,16 +1024,16 @@ A number of built-in functions are available for this type of diary entry:
                   the month.  MONTH can be a list of months, a single
                   month, or t to specify all months. Optional DAY means
                   Nth DAYNAME of MONTH on or after/before DAY.  DAY defaults
-                  to 1 if N>0 and the last day of the month if N<0.  An 
-                  optional parameter MARK specifies a face or single-character 
+                  to 1 if N>0 and the last day of the month if N<0.  An
+                  optional parameter MARK specifies a face or single-character
                   string to use when highlighting the day in the calendar.
 
       %%(diary-block M1 D1 Y1 M2 D2 Y2 &optional MARK) text
                   Entry will appear on dates between M1/D1/Y1 and M2/D2/Y2,
                   inclusive.  (If `european-calendar-style' is t, the
                   order of the parameters should be changed to D1, M1, Y1,
-                  D2, M2, Y2.)  An optional parameter MARK specifies a face 
-                  or single-character string to use when highlighting the 
+                  D2, M2, Y2.)  An optional parameter MARK specifies a face
+                  or single-character string to use when highlighting the
                   day in the calendar.
 
       %%(diary-anniversary MONTH DAY YEAR &optional MARK) text
@@ -1034,8 +1044,8 @@ A number of built-in functions are available for this type of diary entry:
                   of years since the MONTH DAY, YEAR and %s will be replaced
                   by the ordinal ending of that number (that is, `st', `nd',
                   `rd' or `th', as appropriate.  The anniversary of February
-                  29 is considered to be March 1 in a non-leap year.  An 
-                  optional parameter MARK specifies a face or single-character 
+                  29 is considered to be March 1 in a non-leap year.  An
+                  optional parameter MARK specifies a face or single-character
                   string to use when highlighting the day in the calendar.
 
       %%(diary-cyclic N MONTH DAY YEAR &optional MARK) text
@@ -1045,8 +1055,8 @@ A number of built-in functions are available for this type of diary entry:
                   can contain %d or %d%s; %d will be replaced by the number
                   of repetitions since the MONTH DAY, YEAR and %s will
                   be replaced by the ordinal ending of that number (that is,
-                  `st', `nd', `rd' or `th', as appropriate.  An optional 
-                  parameter MARK specifies a face or single-character string 
+                  `st', `nd', `rd' or `th', as appropriate.  An optional
+                  parameter MARK specifies a face or single-character string
                   to use when highlighting the day in the calendar.
 
       %%(diary-remind SEXP DAYS &optional MARKING) text
@@ -1172,7 +1182,7 @@ best if they are nonmarking."
         (let ((diary-entry (diary-sexp-entry sexp entry date)))
           (if diary-entry
               (subst-char-in-region line-start (point) ?\^M ?\n t))
-          (add-to-diary-list date 
+          (add-to-diary-list date
                             (if (consp diary-entry)
                                 (cdr diary-entry)
                               diary-entry)
@@ -1213,7 +1223,7 @@ and DAY, MONTH, YEAR if `european-calendar-style' is t.  DAY, MONTH, and YEAR
 can be lists of integers, the constant t, or an integer.  The constant t means
 all values.
 
-An optional parameter MARK specifies a face or single-character string to 
+An optional parameter MARK specifies a face or single-character string to
 use when highlighting the day in the calendar."
   (let* ((dd (if european-calendar-style
                 month
@@ -1243,7 +1253,7 @@ The order of the parameters is
 M1, D1, Y1, M2, D2, Y2 if `european-calendar-style' is nil, and
 D1, M1, Y1, D2, M2, Y2 if `european-calendar-style' is t.
 
-An optional parameter MARK specifies a face or single-character string to 
+An optional parameter MARK specifies a face or single-character string to
 use when highlighting the day in the calendar."
 
   (let ((date1 (calendar-absolute-from-gregorian
@@ -1265,7 +1275,7 @@ t, or an integer.  The constant t means all months.  If N is negative, count
 backward from the end of the month.
 
 An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY.
-Optional MARK specifies a face or single-character string to use when 
+Optional MARK specifies a face or single-character string to use when
 highlighting the day in the calendar."
 ;; This is messy because the diary entry may apply, but the date on which it
 ;; is based can be in a different month/year.  For example, asking for the
@@ -1333,7 +1343,7 @@ Entry applies if date is the anniversary of MONTH, DAY, YEAR if
 `rd' or `th', as appropriate.  The anniversary of February 29 is considered
 to be March 1 in non-leap years.
 
-An optional parameter MARK specifies a face or single-character string to 
+An optional parameter MARK specifies a face or single-character string to
 use when highlighting the day in the calendar."
   (let* ((d (if european-calendar-style
                 month
@@ -1357,7 +1367,7 @@ repetitions since the MONTH DAY, YEAR and %s will be replaced by the
 ordinal ending of that number (that is, `st', `nd', `rd' or `th', as
 appropriate.
 
-An optional parameter MARK specifies a face or single-character string to 
+An optional parameter MARK specifies a face or single-character string to
 use when highlighting the day in the calendar."
   (let* ((d (if european-calendar-style
                 month