Revision: miles@gnu.org--gnu-2005/gnus--devo--0--patch-94
authorMiles Bader <miles@gnu.org>
Mon, 11 Apr 2005 23:14:00 +0000 (23:14 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 11 Apr 2005 23:14:00 +0000 (23:14 +0000)
Merge from gnus--rel--5.10

Patches applied:

 * emacs--cvs-trunk--0  (patch 244, 246, 248)

   - Update from CVS
   - Merge from gnus--rel--5.10

 * gnus--rel--5.10  (patch 62)

   - Merge from emacs--cvs-trunk--0

2005-04-11  Lute Kamstra  <lute@gnu.org>

   * lisp/nnimap.el (nnimap-date-days-ago): Handle byte-compiler warnings
   differently.

2005-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>

   * lisp/mm-util.el (mm-detect-coding-region): Typo.

lisp/ChangeLog
lisp/mm-util.el
lisp/nnimap.el

index e963e02..de9cb84 100644 (file)
@@ -1,3 +1,12 @@
+2005-04-11  Lute Kamstra  <lute@gnu.org>
+
+       * nnimap.el (nnimap-date-days-ago): Handle byte-compiler warnings
+       differently.
+
+2005-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mm-util.el (mm-detect-coding-region): Typo.
+
 2005-04-11  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-read-summary-keys): Fix misplaced parens.
index 272c054..3d7bc25 100644 (file)
          (replace-regexp-in-string regexp rep string nil literal)))
      (string-as-unibyte . identity)
      (string-make-unibyte . identity)
+     ;; string-as-multibyte often doesn't really do what you think it does.
+     ;; Example:
+     ;;    (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201)
+     ;;    (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300)
+     ;;    (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300)
+     ;;    (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201)
+     ;; but
+     ;;    (aref (string-as-multibyte "\201\300") 0) -> 2240
+     ;;    (aref (string-as-multibyte "\201\300") 1) -> <error>
+     ;; Better use string-to-multibyte or encode-coding-string.
+     ;; If you really need string-as-multibyte somewhere it's usually
+     ;; because you're using the internal emacs-mule representation (maybe
+     ;; because you're using string-as-unibyte somewhere), which is
+     ;; generally a problem in itself.
+     ;; Here is an approximate equivalence table to help think about it:
+     ;; (string-as-multibyte s)   ~= (decode-coding-string s 'emacs-mule)
+     ;; (string-to-multibyte s)   ~= (decode-coding-string s 'binary)
+     ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system)
      (string-as-multibyte . identity)
      (string-to-multibyte
       . (lambda (string)
@@ -910,7 +928,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
     (defun mm-detect-coding-region (start end)
       "Like `detect-coding-region' except returning the best one."
       (let ((coding-systems
-            (detect-coding-region (point) (point-max))))
+            (detect-coding-region start end)))
        (or (car-safe coding-systems)
            coding-systems)))
   (defun mm-detect-coding-region (start end)
@@ -1111,5 +1129,5 @@ gzip, bzip2, etc. are allowed."
 
 (provide 'mm-util)
 
-;;; arch-tag: 94dc5388-825d-4fd1-bfa5-2100aa351238
+;; arch-tag: 94dc5388-825d-4fd1-bfa5-2100aa351238
 ;;; mm-util.el ends here
index 2b969f8..12f9ef8 100644 (file)
@@ -1442,10 +1442,10 @@ function is generally only called when Gnus is shutting down."
        (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"