From: Jesper Harder Date: Mon, 9 Feb 2004 02:53:36 +0000 (+0000) Subject: * rfc2047.el (rfc2047-qp-or-base64): New function to reduce X-Git-Url: https://cgit.sxemacs.org/?a=commitdiff_plain;h=609e9daf5a06f5d39ca20cc6718f72a414866870;p=gnus * rfc2047.el (rfc2047-qp-or-base64): New function to reduce dependencies. (rfc2047-encode): Use it. * gnus-art.el (gnus-button-marker-list): Move before first reference. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f22597950..9bababb79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2004-02-09 Jesper Harder + * rfc2047.el (rfc2047-qp-or-base64): New function to reduce + dependencies. + (rfc2047-encode): Use it. + + * gnus-art.el (gnus-button-marker-list): Move before first + reference. + * imap.el (imap-parse-flag-list, imap-parse-body-extension) (imap-parse-body): Fix format string mismatch. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index c4725c1a6..d979ec7d3 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1374,6 +1374,13 @@ This requires GNU Libidn, and by default only enabled if it is found." '("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")) +(defvar gnus-button-regexp nil) +(defvar gnus-button-marker-list nil) +;; Regexp matching any of the regexps from `gnus-button-alist'. + +(defvar gnus-button-last nil) +;; The value of `gnus-button-alist' when `gnus-button-regexp' was build. + (defvar article-goto-body-goes-to-point-min-p nil) (defvar gnus-article-wash-types nil) (defvar gnus-article-emphasis-alist nil) @@ -6207,13 +6214,6 @@ HEADER is a regexp to match a header. For a fuller explanation, see :inline t (integer :tag "Regexp group"))))) -(defvar gnus-button-regexp nil) -(defvar gnus-button-marker-list nil) -;; Regexp matching any of the regexps from `gnus-button-alist'. - -(defvar gnus-button-last nil) -;; The value of `gnus-button-alist' when `gnus-button-regexp' was build. - ;;; Commands: (defun gnus-article-push-button (event) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 1ba47df38..9832fd501 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -97,6 +97,25 @@ quoted-printable and base64 respectively.") ;;; Functions for encoding RFC2047 messages ;;; +(defun rfc2047-qp-or-base64 () + "Return the type with which to encode the buffer. +This is either `base64' or `quoted-printable'." + (save-excursion + (let ((limit (min (point-max) (+ 2000 (point-min)))) + (n8bit 0)) + (goto-char (point-min)) + (skip-chars-forward "\x20-\x7f\r\n\t" limit) + (while (< (point) limit) + (incf n8bit) + (forward-char 1) + (skip-chars-forward "\x20-\x7f\r\n\t" limit)) + (if (or (< (* 6 n8bit) (- limit (point-min))) + ;; Don't base64, say, a short line with a single + ;; non-ASCII char when splitting parts by charset. + (= n8bit 1)) + 'quoted-printable + 'base64)))) + (defun rfc2047-narrow-to-field () "Narrow the buffer to the header on the current line." (beginning-of-line) @@ -382,7 +401,7 @@ By default, the region is treated as containing addresses (see ;; encoding, choose the one that's shorter. (save-restriction (narrow-to-region b e) - (if (eq (mm-qp-or-base64) 'base64) + (if (eq (rfc2047-qp-or-base64) 'base64) 'B 'Q)))) (start (concat