[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changes in calendar/time-date.el

From: Lute Kamstra
Subject: Re: Changes in calendar/time-date.el
Date: Tue, 05 Apr 2005 15:54:24 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Reiner Steib <address@hidden> writes:


> I have committed the changes to Gnus v5-10 branch.  If anyone want to
> handle the compiler differently, feel free to change it.

I'd prefer to handle it like in the patch below.  If the function
message-make-date or nnimap-date-days-ago is called *very* often, then
a single (require 'parse-time) at top level may be better.  But all
require does is a memq on features, which has typically a few hundred
members.  I suspect that doesn't take too much time.


Index: lisp/gnus/message.el
RCS file: /cvsroot/emacs/emacs/lisp/gnus/message.el,v
retrieving revision 1.76
diff -u -r1.76 message.el
--- lisp/gnus/message.el        5 Apr 2005 04:10:27 -0000       1.76
+++ lisp/gnus/message.el        5 Apr 2005 13:42:31 -0000
@@ -4564,12 +4564,11 @@
        (when (re-search-forward ",+$" nil t)
          (replace-match "" t t))))))
+(eval-when-compile (require 'parse-time))
 (defun message-make-date (&optional now)
   "Make a valid data header.
 If NOW, use that time instead."
   (require 'parse-time)
-  (defvar parse-time-weekdays)
-  (defvar parse-time-months)
   (let* ((now (or now (current-time)))
         (zone (nth 8 (decode-time now)))
         (sign "+"))
Index: lisp/gnus/nnimap.el
RCS file: /cvsroot/emacs/emacs/lisp/gnus/nnimap.el,v
retrieving revision 1.24
diff -u -r1.24 nnimap.el
--- lisp/gnus/nnimap.el 5 Apr 2005 04:10:27 -0000       1.24
+++ lisp/gnus/nnimap.el 5 Apr 2005 13:42:33 -0000
@@ -1386,10 +1386,10 @@
        (list (- ms 1) (+ (expt 2 16) ls))
       (list ms ls))))
+(eval-when-compile (require 'parse-time))
 (defun nnimap-date-days-ago (daysago)
   "Return date, in format \"3-Aug-1998\", for DAYSAGO days ago."
   (require 'parse-time)
-  (defvar parse-time-months)
   (let* ((time (nnimap-time-substract (current-time) (days-to-time daysago)))
         (date (format-time-string
                (format "%%d-%s-%%Y"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]