2000-10-07 10:31:05 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 7 Oct 2000 13:35:16 +0000 (13:35 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 7 Oct 2000 13:35:16 +0000 (13:35 +0000)
* rfc2047.el (rfc2047-q-encode-region): Better calculation of
break point.
(rfc2047-fold-region): Don't break the first non-LWSP characters.

lisp/ChangeLog
lisp/rfc2047.el

index 549d7ac..34cec10 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-07 10:31:05  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * rfc2047.el (rfc2047-q-encode-region): Better calculation of
+       break point.
+       (rfc2047-fold-region): Don't break the first non-LWSP characters.
+
 2000-10-07 09:18:53  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus.el (gnus-agent-fetching): New variable.
index 5e2eed4..5c2e127 100644 (file)
@@ -294,7 +294,8 @@ Should be called narrowed to the head of the message."
       (while (not (eobp))
        (cond
         ((memq (char-after) '(?  ?\t))
-         (setq break (point)))
+         ;; Break after LWSP.
+         (setq break (1+ (point))))
         ((and (not break)
               (looking-at "=\\?"))
          (setq break (point)))
@@ -303,7 +304,9 @@ Should be called narrowed to the head of the message."
               (> (- (point) (gnus-point-at-bol)) 76))
          (goto-char break)
          (setq break nil)
-         (insert "\n ")))
+         (insert "\n ")
+         ;; Don't break before the first non-LWSP characters.
+         (forward-char 1)))
        (unless (eobp)
          (forward-char 1))))))
 
@@ -331,7 +334,10 @@ Should be called narrowed to the head of the message."
          (pop alist))
        (goto-char (point-min))
        (while (not (eobp))
-         (goto-char (min (point-max) (+ 64 (point))))
+         (goto-char (min (point-max) (save-restriction
+                                       (widen)
+                                       ;; THe QP encapsulation is about 20. 
+                                       (+ 56 (gnus-point-at-bol)))))
          (search-backward "=" (- (point) 2) t)
          (unless (eobp)
            (insert "\n")))))))