Mercurial > emacs
comparison lisp/gnus/rfc2047.el @ 33127:eca95f9d7f05
(base64): Require unconditionally.
(message-posting-charset): Defvar when compiling.
(rfc2047-encode-message-header, rfc2047-encodable-p): Require
message.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 01 Nov 2000 19:07:36 +0000 |
parents | 54ae1def18cf |
children | d401dfab680a |
comparison
equal
deleted
inserted
replaced
33126:30775a7550ec | 33127:eca95f9d7f05 |
---|---|
22 | 22 |
23 ;;; Commentary: | 23 ;;; Commentary: |
24 | 24 |
25 ;;; Code: | 25 ;;; Code: |
26 | 26 |
27 (eval-and-compile | 27 (require 'base64) |
28 (eval | |
29 '(unless (fboundp 'base64-decode-string) | |
30 (require 'base64)))) | |
31 | 28 |
32 (require 'qp) | 29 (require 'qp) |
33 (require 'mm-util) | 30 (require 'mm-util) |
34 (require 'ietf-drums) | 31 (require 'ietf-drums) |
35 (require 'mail-prsvr) | 32 (require 'mail-prsvr) |
33 | |
34 (eval-when-compile (defvar message-posting-charset)) | |
36 | 35 |
37 (defvar rfc2047-header-encoding-alist | 36 (defvar rfc2047-header-encoding-alist |
38 '(("Newsgroups" . nil) | 37 '(("Newsgroups" . nil) |
39 ("Message-ID" . nil) | 38 ("Message-ID" . nil) |
40 (t . mime)) | 39 (t . mime)) |
106 | 105 |
107 (defun rfc2047-encode-message-header () | 106 (defun rfc2047-encode-message-header () |
108 "Encode the message header according to `rfc2047-header-encoding-alist'. | 107 "Encode the message header according to `rfc2047-header-encoding-alist'. |
109 Should be called narrowed to the head of the message." | 108 Should be called narrowed to the head of the message." |
110 (interactive "*") | 109 (interactive "*") |
110 (require 'message) | |
111 (save-excursion | 111 (save-excursion |
112 (goto-char (point-min)) | 112 (goto-char (point-min)) |
113 (let (alist elem method) | 113 (let (alist elem method) |
114 (while (not (eobp)) | 114 (while (not (eobp)) |
115 (save-restriction | 115 (save-restriction |
149 (t))) | 149 (t))) |
150 (goto-char (point-max))))))) | 150 (goto-char (point-max))))))) |
151 | 151 |
152 (defun rfc2047-encodable-p (&optional header) | 152 (defun rfc2047-encodable-p (&optional header) |
153 "Say whether the current (narrowed) buffer contains characters that need encoding in headers." | 153 "Say whether the current (narrowed) buffer contains characters that need encoding in headers." |
154 (require 'message) | |
154 (let ((charsets | 155 (let ((charsets |
155 (mapcar | 156 (mapcar |
156 'mm-mime-charset | 157 'mm-mime-charset |
157 (mm-find-charset-region (point-min) (point-max)))) | 158 (mm-find-charset-region (point-min) (point-max)))) |
158 (cs (list 'us-ascii (car message-posting-charset))) | 159 (cs (list 'us-ascii (car message-posting-charset))) |