]> code.delx.au - gnu-emacs/commitdiff
* lisp/gnus/mm-util.el: Remove the mm-string-as-multibyte alias.
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Feb 2016 07:21:56 +0000 (18:21 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Feb 2016 07:21:56 +0000 (18:21 +1100)
lisp/gnus/mm-decode.el
lisp/gnus/mm-util.el
lisp/gnus/mml.el
lisp/gnus/nnmail.el

index 51fcd8bcd5bbdd8b0acc48054e3193a6fc668ec6..89dc608cc889bd06b93c444b7acd2081007930d8 100644 (file)
@@ -1806,7 +1806,7 @@ If RECURSIVE, search recursively."
                                                                 nil t))
                              (not (eq charset 'ascii)))
                         (decode-coding-string (buffer-string) charset)
-                      (mm-string-as-multibyte (buffer-string)))
+                      (string-as-multibyte (buffer-string)))
                   (erase-buffer)
                   (mm-enable-multibyte)))
         (goto-char (point-min))
index 234ad3d3121894a0bae73f9e22d08c334f7c616c..c0f8742504ec4b239f81050981d49350328d59c6 100644 (file)
 
 (defvar mm-mime-mule-charset-alist)
 
-;; Emulate functions that are not available in every (X)Emacs version.
-;; The name of a function is prefixed with mm-, like `mm-char-int' for
-;; `char-int' that is a native XEmacs function, not available in Emacs.
-;; Gnus programs all should use mm- functions, not the original ones.
-(eval-and-compile
-  (mapc
-   (lambda (elem)
-     (let ((nfunc (intern (format "mm-%s" (car elem)))))
-       (if (fboundp (car elem))
-          (defalias nfunc (car elem))
-        (defalias nfunc (cdr elem)))))
-   `(
-     ;; 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' is an Emacs function, not available in XEmacs.
-     (string-as-multibyte . identity))))
-
 (defun mm-ucs-to-char (codepoint)
   "Convert Unicode codepoint to character."
   (or (decode-char 'ucs codepoint) ?#))
index f9d6cd877b6c6d2633210a9b0f0f11914a848b7d..97cc87d06e3e636b5089c4523b8ffe779663a17e 100644 (file)
@@ -664,7 +664,7 @@ be \"related\" or \"alternate\"."
              (if (setq encoding (cdr (assq 'encoding cont)))
                  (setq encoding (intern (downcase encoding))))
              (setq encoding (mm-encode-buffer type encoding)
-                   coded (mm-string-as-multibyte (buffer-string))))
+                   coded (string-as-multibyte (buffer-string))))
            (mml-insert-mime-headers cont type charset encoding nil)
            (insert "\n" coded))))
        ((eq (car cont) 'external)
index 1af04fd35431ebfad22075f1260671240e55e1cc..94589e1734d5183748a19a8f31fbf92e72015720 100644 (file)
@@ -1245,7 +1245,7 @@ Return the number of characters in the body."
     (insert (format "Xref: %s" (system-name)))
     (while group-alist
       (insert (if (mm-multibyte-p)
-                 (mm-string-as-multibyte
+                 (string-as-multibyte
                   (format " %s:%d" (caar group-alist) (cdar group-alist)))
                (string-as-unibyte
                 (format " %s:%d" (caar group-alist) (cdar group-alist)))))