aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/mm-util.el33
-rw-r--r--lisp/gnus/mml.el2
-rw-r--r--lisp/gnus/nnmail.el2
4 files changed, 3 insertions, 36 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 51fcd8bcd5b..89dc608cc88 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1806,7 +1806,7 @@ If RECURSIVE, search recursively."
1806 nil t)) 1806 nil t))
1807 (not (eq charset 'ascii))) 1807 (not (eq charset 'ascii)))
1808 (decode-coding-string (buffer-string) charset) 1808 (decode-coding-string (buffer-string) charset)
1809 (mm-string-as-multibyte (buffer-string))) 1809 (string-as-multibyte (buffer-string)))
1810 (erase-buffer) 1810 (erase-buffer)
1811 (mm-enable-multibyte))) 1811 (mm-enable-multibyte)))
1812 (goto-char (point-min)) 1812 (goto-char (point-min))
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 234ad3d3121..c0f8742504e 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -29,39 +29,6 @@
29 29
30(defvar mm-mime-mule-charset-alist) 30(defvar mm-mime-mule-charset-alist)
31 31
32;; Emulate functions that are not available in every (X)Emacs version.
33;; The name of a function is prefixed with mm-, like `mm-char-int' for
34;; `char-int' that is a native XEmacs function, not available in Emacs.
35;; Gnus programs all should use mm- functions, not the original ones.
36(eval-and-compile
37 (mapc
38 (lambda (elem)
39 (let ((nfunc (intern (format "mm-%s" (car elem)))))
40 (if (fboundp (car elem))
41 (defalias nfunc (car elem))
42 (defalias nfunc (cdr elem)))))
43 `(
44 ;; string-as-multibyte often doesn't really do what you think it does.
45 ;; Example:
46 ;; (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201)
47 ;; (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300)
48 ;; (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300)
49 ;; (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201)
50 ;; but
51 ;; (aref (string-as-multibyte "\201\300") 0) -> 2240
52 ;; (aref (string-as-multibyte "\201\300") 1) -> <error>
53 ;; Better use string-to-multibyte or encode-coding-string.
54 ;; If you really need string-as-multibyte somewhere it's usually
55 ;; because you're using the internal emacs-mule representation (maybe
56 ;; because you're using string-as-unibyte somewhere), which is
57 ;; generally a problem in itself.
58 ;; Here is an approximate equivalence table to help think about it:
59 ;; (string-as-multibyte s) ~= (decode-coding-string s 'emacs-mule)
60 ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary)
61 ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system)
62 ;; `string-as-multibyte' is an Emacs function, not available in XEmacs.
63 (string-as-multibyte . identity))))
64
65(defun mm-ucs-to-char (codepoint) 32(defun mm-ucs-to-char (codepoint)
66 "Convert Unicode codepoint to character." 33 "Convert Unicode codepoint to character."
67 (or (decode-char 'ucs codepoint) ?#)) 34 (or (decode-char 'ucs codepoint) ?#))
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index f9d6cd877b6..97cc87d06e3 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -664,7 +664,7 @@ be \"related\" or \"alternate\"."
664 (if (setq encoding (cdr (assq 'encoding cont))) 664 (if (setq encoding (cdr (assq 'encoding cont)))
665 (setq encoding (intern (downcase encoding)))) 665 (setq encoding (intern (downcase encoding))))
666 (setq encoding (mm-encode-buffer type encoding) 666 (setq encoding (mm-encode-buffer type encoding)
667 coded (mm-string-as-multibyte (buffer-string)))) 667 coded (string-as-multibyte (buffer-string))))
668 (mml-insert-mime-headers cont type charset encoding nil) 668 (mml-insert-mime-headers cont type charset encoding nil)
669 (insert "\n" coded)))) 669 (insert "\n" coded))))
670 ((eq (car cont) 'external) 670 ((eq (car cont) 'external)
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 1af04fd3543..94589e1734d 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1245,7 +1245,7 @@ Return the number of characters in the body."
1245 (insert (format "Xref: %s" (system-name))) 1245 (insert (format "Xref: %s" (system-name)))
1246 (while group-alist 1246 (while group-alist
1247 (insert (if (mm-multibyte-p) 1247 (insert (if (mm-multibyte-p)
1248 (mm-string-as-multibyte 1248 (string-as-multibyte
1249 (format " %s:%d" (caar group-alist) (cdar group-alist))) 1249 (format " %s:%d" (caar group-alist) (cdar group-alist)))
1250 (string-as-unibyte 1250 (string-as-unibyte
1251 (format " %s:%d" (caar group-alist) (cdar group-alist))))) 1251 (format " %s:%d" (caar group-alist) (cdar group-alist)))))