From: yamaoka Date: Mon, 28 Jan 2002 11:39:31 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_6-01-quimby~101 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d89aecd5e68b49fef880ec9b7801692847a0d761;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9265feb..448b548 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,23 @@ 2002-01-28 Katsumi Yamaoka + * mm-decode.el (mm-inline-text-html-with-images): New user option. + + * mm-view.el (mm-inline-text-html-render-with-w3m): Bind the value + of `w3m-display-inline-images' with the value of + `mm-inline-text-html-with-images'. + From: TSUCHIYA Masatoshi . + + * gnus-art.el (gnus-article-wash-html-with-w3m): Ditto. + +2002-01-27 Richard M. Stallman + + * time-date.el: Add autoload cookies. Many doc fixes. + (time-add): New function. + (time-subtract): Renamed from subtract-time. + (subtract-time): New alias for time-subtract. + +2002-01-28 Katsumi Yamaoka + * gnus-art.el (gnus-article-wash-html-with-w3m): Replace w3m to emacs-w3m in doc-string. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 5fa43f9..3e558f9 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2292,7 +2292,8 @@ If READ-CHARSET, ask for a coding system." (defun gnus-article-wash-html-with-w3m () "Wash the current buffer with emacs-w3m." (mm-setup-w3m) - (let ((w3m-safe-url-regexp "\\`cid:")) + (let ((w3m-safe-url-regexp "\\`cid:") + (w3m-display-inline-images mm-inline-text-html-with-images)) (w3m-region (point) (point-max))) (setq mm-w3m-minor-mode t)) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 6447fa3..6ebe59a 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -109,6 +109,14 @@ and `mm-inline-text-html-render-with-w3m', which uses emacs-w3m." (function)) :group 'mime-display) +(defcustom mm-inline-text-html-with-images nil + "If non-nil, Gnus will allow retrieving images in the HTML contents +with tags. It has no effect on Emacs/w3. For emacs-w3m, the +value of the option `w3m-display-inline-images' will be bound with +this value." + :type 'boolean + :group 'mime-display) + (defcustom mm-inline-media-tests '(("image/jpeg" mm-inline-image diff --git a/lisp/mm-view.el b/lisp/mm-view.el index cfc55ff..8d573aa 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -192,7 +192,8 @@ (when charset (delete-region (point-min) (point-max)) (insert (mm-decode-string text charset))) - (let ((w3m-safe-url-regexp "\\`cid:")) + (let ((w3m-safe-url-regexp "\\`cid:") + (w3m-display-inline-images mm-inline-text-html-with-images)) (w3m-region (point-min) (point-max))) (setq mm-w3m-minor-mode t)) (mm-handle-set-undisplayer diff --git a/lisp/time-date.el b/lisp/time-date.el index 771d3b5..9598f7d 100644 --- a/lisp/time-date.el +++ b/lisp/time-date.el @@ -34,7 +34,7 @@ ;;;###autoload (defun date-to-time (date) - "Convert DATE into time." + "Parse a string that represents a date-time and return a time value." (condition-case () (apply 'encode-time (parse-time-string @@ -48,25 +48,29 @@ (error (error "Invalid date: %s" date)))) (defun time-to-seconds (time) - "Convert TIME to a floating point number." + "Convert time value TIME to a floating point number. +You can use `float-time' instead." (+ (* (car time) 65536.0) (cadr time) (/ (or (nth 2 time) 0) 1000000.0))) +;;;###autoload (defun seconds-to-time (seconds) - "Convert SECONDS (a floating point number) to an Emacs time structure." + "Convert SECONDS (a floating point number) to a time value." (list (floor seconds 65536) (floor (mod seconds 65536)) (floor (* (- seconds (ffloor seconds)) 1000000)))) +;;;###autoload (defun time-less-p (t1 t2) - "Say whether time T1 is less than time T2." + "Say whether time value T1 is less than time value T2." (or (< (car t1) (car t2)) (and (= (car t1) (car t2)) (< (nth 1 t1) (nth 1 t2))))) +;;;###autoload (defun days-to-time (days) - "Convert DAYS into time." + "Convert DAYS into a time value." (let* ((seconds (* 1.0 days 60 60 24)) (rest (expt 2 16)) (ms (condition-case nil (floor (/ seconds rest)) @@ -74,8 +78,10 @@ (list ms (condition-case nil (round (- seconds (* ms rest))) (range-error (expt 2 16)))))) +;;;###autoload (defun time-since (time) - "Return the time since TIME, which is either an internal time or a date." + "Return the time elapsed since TIME. +TIME should be either a time value or a date-time string." (when (stringp time) ;; Convert date strings to internal time. (setq time (date-to-time time))) @@ -85,26 +91,65 @@ (list (- (+ (car current) (if rest -1 0)) (car time)) (- (+ (or rest 0) (nth 1 current)) (nth 1 time))))) -(defun subtract-time (t1 t2) - "Subtract two internal times." +;;;###autoload +(defalias 'subtract-time 'time-subtract) + +;;;###autoload +(defun time-subtract (t1 t2) + "Subtract two time values. +Return the difference in the format of a time value." (let ((borrow (< (cadr t1) (cadr t2)))) (list (- (car t1) (car t2) (if borrow 1 0)) (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) +;;;###autoload +(defun time-add (t1 t2) + "Add two time values. One should represent a time difference." + (let ((high (car t1)) + (low (if (consp (cdr t1)) (nth 1 t1) (cdr t1))) + (micro (if (numberp (car-safe (cdr-safe (cdr t1)))) + (nth 2 t1) + 0)) + (high2 (car t2)) + (low2 (if (consp (cdr t2)) (nth 1 t2) (cdr t2))) + (micro2 (if (numberp (car-safe (cdr-safe (cdr t2)))) + (nth 2 t2) + 0))) + ;; Add + (setq micro (+ micro micro2)) + (setq low (+ low low2)) + (setq high (+ high high2)) + + ;; Normalize + ;; `/' rounds towards zero while `mod' returns a positive number, + ;; so we can't rely on (= a (+ (* 100 (/ a 100)) (mod a 100))). + (setq low (+ low (/ micro 1000000) (if (< micro 0) -1 0))) + (setq micro (mod micro 1000000)) + (setq high (+ high (/ low 65536) (if (< low 0) -1 0))) + (setq low (logand low 65535)) + + (list high low micro))) + +;;;###autoload (defun date-to-day (date) - "Return the number of days between year 1 and DATE." + "Return the number of days between year 1 and DATE. +DATE should be a date-time string." (time-to-days (date-to-time date))) +;;;###autoload (defun days-between (date1 date2) - "Return the number of days between DATE1 and DATE2." + "Return the number of days between DATE1 and DATE2. +DATE1 and DATE2 should be date-time strings." (- (date-to-day date1) (date-to-day date2))) +;;;###autoload (defun date-leap-year-p (year) "Return t if YEAR is a leap year." (or (and (zerop (% year 4)) (not (zerop (% year 100)))) (zerop (% year 400)))) +;;;###autoload (defun time-to-day-in-year (time) "Return the day number within the year of the date month/day/year." (let* ((tim (decode-time time)) @@ -118,8 +163,10 @@ (setq day-of-year (1+ day-of-year)))) day-of-year)) +;;;###autoload (defun time-to-days (time) "The number of days between the Gregorian date 0001-12-31bce and TIME. +TIME should be a time value. The Gregorian date Sunday, December 31, 1bce is imaginary." (let* ((tim (decode-time time)) (month (nth 4 tim)) @@ -138,8 +185,8 @@ The number of days will be returned as a floating point number." ;;;###autoload (defun safe-date-to-time (date) - "Parse DATE and return a time structure. -If DATE is malformed, a zero time will be returned." + "Parse a string that represents a date-time and return a time value. +If DATE is malformed, return a time value of zeros." (condition-case () (date-to-time date) (error '(0 0)))) diff --git a/texi/ChangeLog b/texi/ChangeLog index 29c33e7..c24f273 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,5 +1,8 @@ 2002-01-28 Katsumi Yamaoka + * emacs-mime.texi (Customization): Added documentation for + `mm-inline-text-html-with-images'. + * gnus.texi (Article Washing): Replace w3m to emacs-w3m. 2002-01-26 Lars Magne Ingebrigtsen diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index c6fb02b..4088623 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -1011,6 +1011,14 @@ which uses emacs-w3m (see @uref{http://emacs-w3m.namazu.org/} for more information about emacs-w3m). The function will be called with a MIME handle as the argument. +@item mm-inline-text-html-with-images +Some HTML mails might have the trick of spammers using @samp{} tags. +It is likely to be intended to verify whether you have read the mail. +You can prevent your personal informations from leaking by setting this +option to @code{nil} (which is the default). It is currently ignored by +Emacs/w3. For emacs-w3m, you may use the command @kbd{t} on the image +anchor to show an image even if it is @code{nil}. + @item mm-inline-media-tests This is an alist where the key is a @sc{mime} type, the second element is a function to display the part @dfn{inline} (i.e., inside Emacs), and