]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/mm-util.el
*** empty log message ***
[gnu-emacs] / lisp / gnus / mm-util.el
index 9c0e34f2d86e53d376d3ef4db64e644827b0b6ec..4ad91852432c4485b82c126a6341e601bf383110 100644 (file)
      (string-as-unibyte . identity)
      (string-as-multibyte . identity)
      (multibyte-string-p . ignore)
-     (insert-byte . insert))))
+     (point-at-bol . line-beginning-position)
+     (point-at-eol . line-end-position)
+     (insert-byte . insert-char)
+     (multibyte-char-to-unibyte . identity))))
 
 (eval-and-compile
   (defalias 'mm-char-or-char-int-p
     ,@(unless (mm-coding-system-p 'gb2312)
        '((gb2312 . cn-gb-2312)))
     ;; ISO-8859-15 is very similar to ISO-8859-1.
+    ;; But this is just wrong.  --fx
     ,@(unless (mm-coding-system-p 'iso-8859-15) ; Emacs 21 defines it.
        '((iso-8859-15 . iso-8859-1)))
     ;; Windows-1252 is actually a superset of Latin-1.  See also
     ;; `gnus-article-dumbquotes-map'.
-    ,@(unless (mm-coding-system-p 'windows-1252)       
+    ,@(unless (mm-coding-system-p 'windows-1252)
        (if (mm-coding-system-p 'cp1252)
           '((windows-1252 . cp1252))
         '((windows-1252 . iso-8859-1))))
     ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft
     ;; Outlook users in Czech republic. Use this to allow reading of their
     ;; e-mails. cp1250 should be defined by M-x codepage-setup.
+
+    ;; This is not TRT, the MIME name, windows-1250, should be an
+    ;; alias, and cp1250 should have a mime-charset property, per
+    ;; code-page.el. -- fx
     ,@(if (and (not (mm-coding-system-p 'windows-1250))
               (mm-coding-system-p 'cp1250))
          '((windows-1250 . cp1250)))
@@ -261,6 +269,7 @@ prefer iso-2022-jp to japanese-shift-jis:
   '(iso-2022-jp iso-2022-jp-2 japanese-shift-jis utf-8))
 ")
 
+;; Why on earth was this broken out?  -- fx
 (defvar mm-use-find-coding-systems-region
   (fboundp 'find-coding-systems-region)
   "Use `find-coding-systems-region' to find proper coding systems.")
@@ -448,7 +457,7 @@ charset, and a longer list means no appropriate charset."
             ;; system that has one.
             (let ((systems (find-coding-systems-region b e)))
               (when mm-coding-system-priorities
-                (setq systems 
+                (setq systems
                       (sort systems 'mm-sort-coding-systems-predicate)))
               ;; Fixme: The `mime-charset' (`x-ctext') of `compound-text'
               ;; is not in the IANA list.
@@ -466,7 +475,7 @@ charset, and a longer list means no appropriate charset."
 
        ;; Otherwise we're not multibyte, XEmacs or a single coding
        ;; system won't cover it.
-       (setq charsets 
+       (setq charsets
              (mm-delete-duplicates
               (mapcar 'mm-mime-charset
                       (delq 'ascii
@@ -487,7 +496,7 @@ Also bind `default-enable-multibyte-characters' to nil.
 Equivalent to `progn' in XEmacs"
   (let ((multibyte (make-symbol "multibyte"))
        (buffer (make-symbol "buffer")))
-    `(if mm-emacs-mule 
+    `(if mm-emacs-mule
         (let ((,multibyte enable-multibyte-characters)
               (,buffer (current-buffer)))
           (unwind-protect
@@ -645,6 +654,20 @@ If INHIBIT is non-nil, inhibit mm-inhibit-file-name-handlers."
          (push dir result))
       (push path result))))
 
+;; It is not a MIME function, but some MIME functions use it.
+(defalias 'mm-make-temp-file
+  (if (fboundp 'make-temp-file)
+      'make-temp-file
+    (lambda (prefix &optional dir-flag)
+      (let ((file (expand-file-name
+                  (make-temp-name prefix)
+                  (if (fboundp 'temp-directory)
+                      (temp-directory)
+                    temporary-file-directory))))
+       (if dir-flag
+           (make-directory file))
+       file))))
+
 (provide 'mm-util)
 
 ;;; mm-util.el ends here