diff options
| author | Lars Ingebrigtsen | 2016-02-12 14:39:30 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-12 14:39:30 +1100 |
| commit | 37cf4454b1646481935e7b5bfffc8f64eb484b3a (patch) | |
| tree | abaf9658273165e5f15256db2686d97c81cc47f8 | |
| parent | 87931c8dc0094facff7c8e27267d630a9254a524 (diff) | |
| download | emacs-37cf4454b1646481935e7b5bfffc8f64eb484b3a.tar.gz emacs-37cf4454b1646481935e7b5bfffc8f64eb484b3a.zip | |
Remove XEmacs compat functions from mm-util.el
* lisp/gnus/mm-util.el (mm-special-display-p): Remove.
(mm-decode-coding-string, mm-encode-coding-string)
(mm-decode-coding-region, mm-encode-coding-region): Remove.
(mm-string-to-multibyte): Remove.
(mm-char-or-char-int-p): Remove.
(mm-ucs-to-char): Remove compat versions of the function.
(mm-read-coding-system): Remove.
(mm-coding-system-p): Remove compat code.
(mm-enrich-utf-8-by-mule-ucs): Remove.
(mm-enable-multibyte, mm-disable-multibyte): Remove compat versions.
(mm-delete-duplicates): Remove.
(mm-multibyte-p): Remove compat versions.
(mm-xemacs-find-mime-charset-1): Remove.
(mm-xemacs-find-mime-charset): Remove.
(mm-make-temp-file): Made obsolete.
(mm-find-buffer-file-coding-system): Remove XEmacs compat.
46 files changed, 255 insertions, 753 deletions
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index da3d670b4cd..32b39b924f9 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el | |||
| @@ -1601,9 +1601,9 @@ authentication tokens: | |||
| 1601 | (list k (plist-get spec k)))) | 1601 | (list k (plist-get spec k)))) |
| 1602 | search-keys)))) | 1602 | search-keys)))) |
| 1603 | ;; needed keys (always including host, login, port, and secret) | 1603 | ;; needed keys (always including host, login, port, and secret) |
| 1604 | (returned-keys (mm-delete-duplicates (append | 1604 | (returned-keys (delete-dups (append |
| 1605 | '(:host :login :port :secret) | 1605 | '(:host :login :port :secret) |
| 1606 | search-keys))) | 1606 | search-keys))) |
| 1607 | (items | 1607 | (items |
| 1608 | (loop for search-spec in search-specs | 1608 | (loop for search-spec in search-specs |
| 1609 | nconc | 1609 | nconc |
| @@ -1730,9 +1730,9 @@ entries for git.gnus.org: | |||
| 1730 | (list k (plist-get spec k)))) | 1730 | (list k (plist-get spec k)))) |
| 1731 | search-keys))) | 1731 | search-keys))) |
| 1732 | ;; needed keys (always including host, login, port, and secret) | 1732 | ;; needed keys (always including host, login, port, and secret) |
| 1733 | (returned-keys (mm-delete-duplicates (append | 1733 | (returned-keys (delete-dups (append |
| 1734 | '(:host :login :port :secret) | 1734 | '(:host :login :port :secret) |
| 1735 | search-keys))) | 1735 | search-keys))) |
| 1736 | ;; Extract host and port from spec | 1736 | ;; Extract host and port from spec |
| 1737 | (hosts (plist-get spec :host)) | 1737 | (hosts (plist-get spec :host)) |
| 1738 | (hosts (if (and hosts (listp hosts)) hosts `(,hosts))) | 1738 | (hosts (if (and hosts (listp hosts)) hosts `(,hosts))) |
| @@ -1872,9 +1872,9 @@ entries for git.gnus.org: | |||
| 1872 | (list k v)))) | 1872 | (list k v)))) |
| 1873 | search-keys))) | 1873 | search-keys))) |
| 1874 | ;; needed keys (always including host, login, port, and secret) | 1874 | ;; needed keys (always including host, login, port, and secret) |
| 1875 | (returned-keys (mm-delete-duplicates (append | 1875 | (returned-keys (delete-dups (append |
| 1876 | '(:host :login :port :secret) | 1876 | '(:host :login :port :secret) |
| 1877 | search-keys))) | 1877 | search-keys))) |
| 1878 | (items (plstore-find store search-spec)) | 1878 | (items (plstore-find store search-spec)) |
| 1879 | (item-names (mapcar #'car items)) | 1879 | (item-names (mapcar #'car items)) |
| 1880 | (items (butlast items (- (length items) max))) | 1880 | (items (butlast items (- (length items) max))) |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 99d107e2beb..68d07c70ee8 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2508,7 +2508,7 @@ If PROMPT (the prefix), prompt for a coding system to use." | |||
| 2508 | ctl (and ct (mail-header-parse-content-type ct)) | 2508 | ctl (and ct (mail-header-parse-content-type ct)) |
| 2509 | charset (cond | 2509 | charset (cond |
| 2510 | (prompt | 2510 | (prompt |
| 2511 | (mm-read-coding-system "Charset to decode: ")) | 2511 | (read-coding-system "Charset to decode: ")) |
| 2512 | (ctl | 2512 | (ctl |
| 2513 | (mail-content-type-get ctl 'charset))) | 2513 | (mail-content-type-get ctl 'charset))) |
| 2514 | format (and ctl (mail-content-type-get ctl 'format))) | 2514 | format (and ctl (mail-content-type-get ctl 'format))) |
| @@ -2629,7 +2629,7 @@ If READ-CHARSET, ask for a coding system." | |||
| 2629 | (if (stringp charset) | 2629 | (if (stringp charset) |
| 2630 | (setq charset (intern (downcase charset))))))) | 2630 | (setq charset (intern (downcase charset))))))) |
| 2631 | (if read-charset | 2631 | (if read-charset |
| 2632 | (setq charset (mm-read-coding-system "Charset: " charset))) | 2632 | (setq charset (read-coding-system "Charset: " charset))) |
| 2633 | (unless charset | 2633 | (unless charset |
| 2634 | (setq charset gnus-newsgroup-charset)) | 2634 | (setq charset gnus-newsgroup-charset)) |
| 2635 | (when (or force | 2635 | (when (or force |
| @@ -2657,7 +2657,7 @@ If READ-CHARSET, ask for a coding system." | |||
| 2657 | (if (stringp charset) | 2657 | (if (stringp charset) |
| 2658 | (setq charset (intern (downcase charset))))))) | 2658 | (setq charset (intern (downcase charset))))))) |
| 2659 | (if read-charset | 2659 | (if read-charset |
| 2660 | (setq charset (mm-read-coding-system "Charset: " charset))) | 2660 | (setq charset (read-coding-system "Charset: " charset))) |
| 2661 | (unless charset | 2661 | (unless charset |
| 2662 | (setq charset gnus-newsgroup-charset)) | 2662 | (setq charset gnus-newsgroup-charset)) |
| 2663 | (when (or force | 2663 | (when (or force |
| @@ -2667,7 +2667,7 @@ If READ-CHARSET, ask for a coding system." | |||
| 2667 | (save-restriction | 2667 | (save-restriction |
| 2668 | (narrow-to-region (point) (point-max)) | 2668 | (narrow-to-region (point) (point-max)) |
| 2669 | (base64-decode-region (point-min) (point-max)) | 2669 | (base64-decode-region (point-min) (point-max)) |
| 2670 | (mm-decode-coding-region | 2670 | (decode-coding-region |
| 2671 | (point-min) (point-max) | 2671 | (point-min) (point-max) |
| 2672 | (mm-charset-to-coding-system charset nil t))))))) | 2672 | (mm-charset-to-coding-system charset nil t))))))) |
| 2673 | 2673 | ||
| @@ -2850,7 +2850,7 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2850 | <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\"" | 2850 | <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\"" |
| 2851 | nil t) | 2851 | nil t) |
| 2852 | (unless cid-dir | 2852 | (unless cid-dir |
| 2853 | (setq cid-dir (mm-make-temp-file "cid" t)) | 2853 | (setq cid-dir (make-temp-file "cid" t)) |
| 2854 | (add-to-list 'gnus-article-browse-html-temp-list cid-dir)) | 2854 | (add-to-list 'gnus-article-browse-html-temp-list cid-dir)) |
| 2855 | (setq file nil | 2855 | (setq file nil |
| 2856 | content nil) | 2856 | content nil) |
| @@ -2863,7 +2863,7 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2863 | (replace-match cid-file nil nil nil 1)))) | 2863 | (replace-match cid-file nil nil nil 1)))) |
| 2864 | (unless content (setq content (buffer-string)))) | 2864 | (unless content (setq content (buffer-string)))) |
| 2865 | (when (or charset header (not file)) | 2865 | (when (or charset header (not file)) |
| 2866 | (setq tmp-file (mm-make-temp-file | 2866 | (setq tmp-file (make-temp-file |
| 2867 | ;; Do we need to care for 8.3 filenames? | 2867 | ;; Do we need to care for 8.3 filenames? |
| 2868 | "mm-" nil ".html"))) | 2868 | "mm-" nil ".html"))) |
| 2869 | ;; Add a meta html tag to specify charset and a header. | 2869 | ;; Add a meta html tag to specify charset and a header. |
| @@ -2897,11 +2897,11 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2897 | ;; charset specified in parts might be different. | 2897 | ;; charset specified in parts might be different. |
| 2898 | (if (eq charset 'gnus-decoded) | 2898 | (if (eq charset 'gnus-decoded) |
| 2899 | (setq charset 'utf-8 | 2899 | (setq charset 'utf-8 |
| 2900 | eheader (mm-encode-coding-string (buffer-string) | 2900 | eheader (encode-coding-string (buffer-string) |
| 2901 | charset) | 2901 | charset) |
| 2902 | title (when title | 2902 | title (when title |
| 2903 | (mm-encode-coding-string title charset)) | 2903 | (encode-coding-string title charset)) |
| 2904 | body (mm-encode-coding-string content charset)) | 2904 | body (encode-coding-string content charset)) |
| 2905 | (setq hcharset (mm-find-mime-charset-region (point-min) | 2905 | (setq hcharset (mm-find-mime-charset-region (point-min) |
| 2906 | (point-max))) | 2906 | (point-max))) |
| 2907 | (cond ((= (length hcharset) 1) | 2907 | (cond ((= (length hcharset) 1) |
| @@ -2918,30 +2918,30 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2918 | (mm-charset-to-coding-system charset | 2918 | (mm-charset-to-coding-system charset |
| 2919 | nil t)) | 2919 | nil t)) |
| 2920 | (if (eq coding body) | 2920 | (if (eq coding body) |
| 2921 | (setq eheader (mm-encode-coding-string | 2921 | (setq eheader (encode-coding-string |
| 2922 | (buffer-string) coding) | 2922 | (buffer-string) coding) |
| 2923 | title (when title | 2923 | title (when title |
| 2924 | (mm-encode-coding-string | 2924 | (encode-coding-string |
| 2925 | title coding)) | 2925 | title coding)) |
| 2926 | body content) | 2926 | body content) |
| 2927 | (setq charset 'utf-8 | 2927 | (setq charset 'utf-8 |
| 2928 | eheader (mm-encode-coding-string | 2928 | eheader (encode-coding-string |
| 2929 | (buffer-string) charset) | 2929 | (buffer-string) charset) |
| 2930 | title (when title | 2930 | title (when title |
| 2931 | (mm-encode-coding-string | 2931 | (encode-coding-string |
| 2932 | title charset)) | 2932 | title charset)) |
| 2933 | body (mm-encode-coding-string | 2933 | body (encode-coding-string |
| 2934 | (mm-decode-coding-string | 2934 | (decode-coding-string |
| 2935 | content body) | 2935 | content body) |
| 2936 | charset)))) | 2936 | charset)))) |
| 2937 | (setq charset hcharset | 2937 | (setq charset hcharset |
| 2938 | eheader (mm-encode-coding-string | 2938 | eheader (encode-coding-string |
| 2939 | (buffer-string) coding) | 2939 | (buffer-string) coding) |
| 2940 | title (when title | 2940 | title (when title |
| 2941 | (mm-encode-coding-string | 2941 | (encode-coding-string |
| 2942 | title coding)) | 2942 | title coding)) |
| 2943 | body content)) | 2943 | body content)) |
| 2944 | (setq eheader (mm-string-as-unibyte (buffer-string)) | 2944 | (setq eheader (string-as-unibyte (buffer-string)) |
| 2945 | body content))) | 2945 | body content))) |
| 2946 | (erase-buffer) | 2946 | (erase-buffer) |
| 2947 | (mm-disable-multibyte) | 2947 | (mm-disable-multibyte) |
| @@ -2964,8 +2964,8 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2964 | (charset | 2964 | (charset |
| 2965 | (mm-with-unibyte-buffer | 2965 | (mm-with-unibyte-buffer |
| 2966 | (insert (if (eq charset 'gnus-decoded) | 2966 | (insert (if (eq charset 'gnus-decoded) |
| 2967 | (mm-encode-coding-string content | 2967 | (encode-coding-string content |
| 2968 | (setq charset 'utf-8)) | 2968 | (setq charset 'utf-8)) |
| 2969 | content)) | 2969 | content)) |
| 2970 | (if (or (mm-add-meta-html-tag handle charset) | 2970 | (if (or (mm-add-meta-html-tag handle charset) |
| 2971 | (not file)) | 2971 | (not file)) |
| @@ -5253,7 +5253,7 @@ are decompressed." | |||
| 5253 | ((numberp arg) | 5253 | ((numberp arg) |
| 5254 | (setq charset (or (cdr (assq arg | 5254 | (setq charset (or (cdr (assq arg |
| 5255 | gnus-summary-show-article-charset-alist)) | 5255 | gnus-summary-show-article-charset-alist)) |
| 5256 | (mm-read-coding-system "Charset: "))))) | 5256 | (read-coding-system "Charset: "))))) |
| 5257 | (switch-to-buffer (generate-new-buffer filename)) | 5257 | (switch-to-buffer (generate-new-buffer filename)) |
| 5258 | (if (or coding-system | 5258 | (if (or coding-system |
| 5259 | (and charset | 5259 | (and charset |
| @@ -5262,7 +5262,7 @@ are decompressed." | |||
| 5262 | (not (eq coding-system 'ascii)))) | 5262 | (not (eq coding-system 'ascii)))) |
| 5263 | (progn | 5263 | (progn |
| 5264 | (mm-enable-multibyte) | 5264 | (mm-enable-multibyte) |
| 5265 | (insert (mm-decode-coding-string contents coding-system)) | 5265 | (insert (decode-coding-string contents coding-system)) |
| 5266 | (setq buffer-file-coding-system | 5266 | (setq buffer-file-coding-system |
| 5267 | (if (boundp 'last-coding-system-used) | 5267 | (if (boundp 'last-coding-system-used) |
| 5268 | (symbol-value 'last-coding-system-used) | 5268 | (symbol-value 'last-coding-system-used) |
| @@ -5284,7 +5284,7 @@ are decompressed." | |||
| 5284 | (gnus-article-check-buffer) | 5284 | (gnus-article-check-buffer) |
| 5285 | (let* ((handle (or handle (get-text-property (point) 'gnus-data))) | 5285 | (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
| 5286 | (contents (and handle (mm-get-part handle))) | 5286 | (contents (and handle (mm-get-part handle))) |
| 5287 | (file (mm-make-temp-file (expand-file-name "mm." mm-tmp-directory))) | 5287 | (file (make-temp-file (expand-file-name "mm." mm-tmp-directory))) |
| 5288 | (printer (mailcap-mime-info (mm-handle-media-type handle) "print"))) | 5288 | (printer (mailcap-mime-info (mm-handle-media-type handle) "print"))) |
| 5289 | (when contents | 5289 | (when contents |
| 5290 | (if printer | 5290 | (if printer |
| @@ -5425,7 +5425,7 @@ specified charset." | |||
| 5425 | (or (cdr (assq | 5425 | (or (cdr (assq |
| 5426 | arg | 5426 | arg |
| 5427 | gnus-summary-show-article-charset-alist)) | 5427 | gnus-summary-show-article-charset-alist)) |
| 5428 | (mm-read-coding-system "Charset: ")))) | 5428 | (read-coding-system "Charset: ")))) |
| 5429 | (if (mm-handle-undisplayer handle) | 5429 | (if (mm-handle-undisplayer handle) |
| 5430 | (mm-remove-part handle))) | 5430 | (mm-remove-part handle))) |
| 5431 | (gnus-mime-set-charset-parameters handle charset) | 5431 | (gnus-mime-set-charset-parameters handle charset) |
| @@ -7060,7 +7060,7 @@ If given a prefix, show the hidden text instead." | |||
| 7060 | ;; equivalent of string-make-multibyte which amount to decoding | 7060 | ;; equivalent of string-make-multibyte which amount to decoding |
| 7061 | ;; with locale-coding-system, causing failure of | 7061 | ;; with locale-coding-system, causing failure of |
| 7062 | ;; subsequent decoding. | 7062 | ;; subsequent decoding. |
| 7063 | (insert (mm-string-to-multibyte | 7063 | (insert (string-to-multibyte |
| 7064 | (with-current-buffer gnus-original-article-buffer | 7064 | (with-current-buffer gnus-original-article-buffer |
| 7065 | (buffer-substring (point-min) (point-max))))) | 7065 | (buffer-substring (point-min) (point-max))))) |
| 7066 | 'article) | 7066 | 'article) |
| @@ -8280,7 +8280,7 @@ url is put as the `gnus-button-url' overlay property on the button." | |||
| 8280 | 8280 | ||
| 8281 | (defun gnus-button-handle-info-url (url) | 8281 | (defun gnus-button-handle-info-url (url) |
| 8282 | "Fetch an info URL." | 8282 | "Fetch an info URL." |
| 8283 | (setq url (mm-subst-char-in-string ?+ ?\ url)) | 8283 | (setq url (subst-char-in-string ?+ ?\ url)) |
| 8284 | (cond | 8284 | (cond |
| 8285 | ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url) | 8285 | ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url) |
| 8286 | (gnus-info-find-node | 8286 | (gnus-info-find-node |
| @@ -8296,7 +8296,7 @@ url is put as the `gnus-button-url' overlay property on the button." | |||
| 8296 | 8296 | ||
| 8297 | (defun gnus-button-handle-info-url-gnome (url) | 8297 | (defun gnus-button-handle-info-url-gnome (url) |
| 8298 | "Fetch GNOME style info URL." | 8298 | "Fetch GNOME style info URL." |
| 8299 | (setq url (mm-subst-char-in-string ?_ ?\ url)) | 8299 | (setq url (subst-char-in-string ?_ ?\ url)) |
| 8300 | (if (string-match "\\([^#]+\\)#?\\(.*\\)" url) | 8300 | (if (string-match "\\([^#]+\\)#?\\(.*\\)" url) |
| 8301 | (gnus-info-find-node | 8301 | (gnus-info-find-node |
| 8302 | (concat "(" | 8302 | (concat "(" |
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el index 83ccc4fc4a1..fa320e00128 100644 --- a/lisp/gnus/gnus-cache.el +++ b/lisp/gnus/gnus-cache.el | |||
| @@ -458,8 +458,8 @@ system for example was used.") | |||
| 458 | (and (boundp 'default-file-name-coding-system) | 458 | (and (boundp 'default-file-name-coding-system) |
| 459 | default-file-name-coding-system)))) | 459 | default-file-name-coding-system)))) |
| 460 | (push (cons group decoded) gnus-cache-decoded-group-names) | 460 | (push (cons group decoded) gnus-cache-decoded-group-names) |
| 461 | (push (cons (mm-decode-coding-string | 461 | (push (cons (decode-coding-string |
| 462 | (mm-encode-coding-string decoded coding) | 462 | (encode-coding-string decoded coding) |
| 463 | coding) | 463 | coding) |
| 464 | group) | 464 | group) |
| 465 | gnus-cache-unified-group-names) | 465 | gnus-cache-unified-group-names) |
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index de66e34fb94..669de2bb79a 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el | |||
| @@ -416,7 +416,7 @@ category.")) | |||
| 416 | ;; Decode values posting-style holds. | 416 | ;; Decode values posting-style holds. |
| 417 | (dolist (style (cdr (assq 'posting-style values))) | 417 | (dolist (style (cdr (assq 'posting-style values))) |
| 418 | (when (stringp (cadr style)) | 418 | (when (stringp (cadr style)) |
| 419 | (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) | 419 | (setcdr style (list (decode-coding-string (cadr style) 'utf-8))))) |
| 420 | 420 | ||
| 421 | (setq gnus-custom-params | 421 | (setq gnus-custom-params |
| 422 | (apply 'widget-create 'group | 422 | (apply 'widget-create 'group |
| @@ -492,7 +492,7 @@ form, but who cares?" | |||
| 492 | ;; Encode values posting-style holds. | 492 | ;; Encode values posting-style holds. |
| 493 | (dolist (style (cdr (assq 'posting-style params))) | 493 | (dolist (style (cdr (assq 'posting-style params))) |
| 494 | (when (stringp (cadr style)) | 494 | (when (stringp (cadr style)) |
| 495 | (setcdr style (list (mm-encode-coding-string (cadr style) 'utf-8))))) | 495 | (setcdr style (list (encode-coding-string (cadr style) 'utf-8))))) |
| 496 | (if gnus-custom-topic | 496 | (if gnus-custom-topic |
| 497 | (gnus-topic-set-parameters gnus-custom-topic params) | 497 | (gnus-topic-set-parameters gnus-custom-topic params) |
| 498 | (gnus-group-edit-group-done 'params gnus-custom-group params) | 498 | (gnus-group-edit-group-done 'params gnus-custom-group params) |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index eec7b1c2cc4..18dd2814554 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -1145,7 +1145,7 @@ The following commands are available: | |||
| 1145 | (goto-char (point-min)) | 1145 | (goto-char (point-min)) |
| 1146 | (setq gnus-group-mark-positions | 1146 | (setq gnus-group-mark-positions |
| 1147 | (list (cons 'process (and (search-forward | 1147 | (list (cons 'process (and (search-forward |
| 1148 | (mm-string-to-multibyte "\200") nil t) | 1148 | (string-to-multibyte "\200") nil t) |
| 1149 | (- (point) (point-min) 1)))))))) | 1149 | (- (point) (point-min) 1)))))))) |
| 1150 | 1150 | ||
| 1151 | (defun gnus-mouse-pick-group (e) | 1151 | (defun gnus-mouse-pick-group (e) |
| @@ -1208,7 +1208,7 @@ The following commands are available: | |||
| 1208 | (defun gnus-group-name-decode (string charset) | 1208 | (defun gnus-group-name-decode (string charset) |
| 1209 | ;; Fixme: Don't decode in unibyte mode. | 1209 | ;; Fixme: Don't decode in unibyte mode. |
| 1210 | (if (and string charset (featurep 'mule)) | 1210 | (if (and string charset (featurep 'mule)) |
| 1211 | (mm-decode-coding-string string charset) | 1211 | (decode-coding-string string charset) |
| 1212 | string)) | 1212 | string)) |
| 1213 | 1213 | ||
| 1214 | (defun gnus-group-decoded-name (string) | 1214 | (defun gnus-group-decoded-name (string) |
| @@ -2216,7 +2216,7 @@ if it is not a list." | |||
| 2216 | (member group (mapcar 'symbol-name collection)) | 2216 | (member group (mapcar 'symbol-name collection)) |
| 2217 | (symbol-value (intern-soft group collection))) | 2217 | (symbol-value (intern-soft group collection))) |
| 2218 | (setq group | 2218 | (setq group |
| 2219 | (mm-encode-coding-string | 2219 | (encode-coding-string |
| 2220 | group (gnus-group-name-charset nil group)))) | 2220 | group (gnus-group-name-charset nil group)))) |
| 2221 | (replace-regexp-in-string group "\n" ""))) | 2221 | (replace-regexp-in-string group "\n" ""))) |
| 2222 | 2222 | ||
| @@ -2378,7 +2378,7 @@ specified by `gnus-gmane-group-download-format'." | |||
| 2378 | (unless range (setq range 500)) | 2378 | (unless range (setq range 500)) |
| 2379 | (when (< range 1) | 2379 | (when (< range 1) |
| 2380 | (error "Invalid range: %s" range)) | 2380 | (error "Invalid range: %s" range)) |
| 2381 | (let ((tmpfile (mm-make-temp-file | 2381 | (let ((tmpfile (make-temp-file |
| 2382 | (format "%s.start-%s.range-%s." group start range))) | 2382 | (format "%s.start-%s.range-%s." group start range))) |
| 2383 | (gnus-thread-sort-functions '(gnus-thread-sort-by-number))) | 2383 | (gnus-thread-sort-functions '(gnus-thread-sort-by-number))) |
| 2384 | (with-temp-file tmpfile | 2384 | (with-temp-file tmpfile |
| @@ -2464,7 +2464,7 @@ the bug number, and browsing the URL must return mbox output." | |||
| 2464 | (setq ids (string-to-number ids))) | 2464 | (setq ids (string-to-number ids))) |
| 2465 | (unless (listp ids) | 2465 | (unless (listp ids) |
| 2466 | (setq ids (list ids))) | 2466 | (setq ids (list ids))) |
| 2467 | (let ((tmpfile (mm-make-temp-file "gnus-temp-group-"))) | 2467 | (let ((tmpfile (make-temp-file "gnus-temp-group-"))) |
| 2468 | (let ((coding-system-for-write 'binary) | 2468 | (let ((coding-system-for-write 'binary) |
| 2469 | (coding-system-for-read 'binary)) | 2469 | (coding-system-for-read 'binary)) |
| 2470 | (with-temp-file tmpfile | 2470 | (with-temp-file tmpfile |
| @@ -2738,7 +2738,7 @@ server." | |||
| 2738 | (when (stringp method) | 2738 | (when (stringp method) |
| 2739 | (setq method (or (gnus-server-to-method method) method))) | 2739 | (setq method (or (gnus-server-to-method method) method))) |
| 2740 | (unless encoded | 2740 | (unless encoded |
| 2741 | (setq name (mm-encode-coding-string | 2741 | (setq name (encode-coding-string |
| 2742 | name | 2742 | name |
| 2743 | (gnus-group-name-charset method name)))) | 2743 | (gnus-group-name-charset method name)))) |
| 2744 | (let* ((meth (gnus-method-simplify | 2744 | (let* ((meth (gnus-method-simplify |
| @@ -2856,7 +2856,7 @@ and NEW-NAME will be prompted for." | |||
| 2856 | "Rename group to: " | 2856 | "Rename group to: " |
| 2857 | (gnus-group-real-name (gnus-group-decoded-name group))) | 2857 | (gnus-group-real-name (gnus-group-decoded-name group))) |
| 2858 | method (gnus-info-method (gnus-get-info group))) | 2858 | method (gnus-info-method (gnus-get-info group))) |
| 2859 | (list group (mm-encode-coding-string | 2859 | (list group (encode-coding-string |
| 2860 | new-name | 2860 | new-name |
| 2861 | (gnus-group-name-charset | 2861 | (gnus-group-name-charset |
| 2862 | method | 2862 | method |
| @@ -3070,9 +3070,9 @@ If called with a prefix argument, ask for the file type." | |||
| 3070 | (list 'nndoc-address file) | 3070 | (list 'nndoc-address file) |
| 3071 | (list 'nndoc-article-type (or type 'guess)))) | 3071 | (list 'nndoc-article-type (or type 'guess)))) |
| 3072 | (coding (gnus-group-name-charset method name))) | 3072 | (coding (gnus-group-name-charset method name))) |
| 3073 | (setcar (cdr method) (mm-encode-coding-string file coding)) | 3073 | (setcar (cdr method) (encode-coding-string file coding)) |
| 3074 | (gnus-group-make-group | 3074 | (gnus-group-make-group |
| 3075 | (mm-encode-coding-string (gnus-group-real-name name) coding) | 3075 | (encode-coding-string (gnus-group-real-name name) coding) |
| 3076 | method nil nil t))) | 3076 | method nil nil t))) |
| 3077 | 3077 | ||
| 3078 | (defvar nnweb-type-definition) | 3078 | (defvar nnweb-type-definition) |
| @@ -3149,8 +3149,8 @@ If there is, use Gnus to create an nnrss group" | |||
| 3149 | (coding (gnus-group-name-charset '(nnrss "") title))) | 3149 | (coding (gnus-group-name-charset '(nnrss "") title))) |
| 3150 | (when coding | 3150 | (when coding |
| 3151 | ;; Unify non-ASCII text. | 3151 | ;; Unify non-ASCII text. |
| 3152 | (setq title (mm-decode-coding-string | 3152 | (setq title (decode-coding-string |
| 3153 | (mm-encode-coding-string title coding) | 3153 | (encode-coding-string title coding) |
| 3154 | coding))) | 3154 | coding))) |
| 3155 | (gnus-group-make-group title '(nnrss "")) | 3155 | (gnus-group-make-group title '(nnrss "")) |
| 3156 | (push (list title href desc) nnrss-group-alist) | 3156 | (push (list title href desc) nnrss-group-alist) |
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index f427610e5e1..f3b5b96bfdb 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el | |||
| @@ -143,7 +143,7 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." | |||
| 143 | charset nil t)) | 143 | charset nil t)) |
| 144 | (not (eq charset 'ascii))) | 144 | (not (eq charset 'ascii))) |
| 145 | (insert (prog1 | 145 | (insert (prog1 |
| 146 | (mm-decode-coding-string (buffer-string) charset) | 146 | (decode-coding-string (buffer-string) charset) |
| 147 | (erase-buffer) | 147 | (erase-buffer) |
| 148 | (mm-enable-multibyte)))) | 148 | (mm-enable-multibyte)))) |
| 149 | (call-process-region (point-min) (point-max) | 149 | (call-process-region (point-min) (point-max) |
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index d277c0f5d57..1cf372a6af0 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el | |||
| @@ -746,8 +746,7 @@ These will be used to retrieve the RSVP information from ical events." | |||
| 746 | (with-temp-buffer | 746 | (with-temp-buffer |
| 747 | (mm-insert-part ,handle) | 747 | (mm-insert-part ,handle) |
| 748 | (when (string= ,charset "utf-8") | 748 | (when (string= ,charset "utf-8") |
| 749 | (mm-decode-coding-region (point-min) (point-max) 'utf-8)) | 749 | (decode-coding-region (point-min) (point-max) 'utf-8)) |
| 750 | |||
| 751 | ,@body)))) | 750 | ,@body)))) |
| 752 | 751 | ||
| 753 | 752 | ||
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 527735fb0a3..dec0e4e81e8 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -1342,7 +1342,7 @@ For the \"inline\" alternatives, also see the variable | |||
| 1342 | (gnus-inews-insert-gcc) | 1342 | (gnus-inews-insert-gcc) |
| 1343 | (let ((gcc (mapcar | 1343 | (let ((gcc (mapcar |
| 1344 | (lambda (group) | 1344 | (lambda (group) |
| 1345 | (mm-encode-coding-string | 1345 | (encode-coding-string |
| 1346 | group | 1346 | group |
| 1347 | (gnus-group-name-charset (gnus-inews-group-method group) | 1347 | (gnus-group-name-charset (gnus-inews-group-method group) |
| 1348 | group))) | 1348 | group))) |
| @@ -1359,7 +1359,7 @@ For the \"inline\" alternatives, also see the variable | |||
| 1359 | (insert "Gcc: \"" gnus-newsgroup-name "\"\n")) | 1359 | (insert "Gcc: \"" gnus-newsgroup-name "\"\n")) |
| 1360 | ((stringp self) | 1360 | ((stringp self) |
| 1361 | (insert "Gcc: " | 1361 | (insert "Gcc: " |
| 1362 | (mm-encode-coding-string | 1362 | (encode-coding-string |
| 1363 | (if (string-match " " self) | 1363 | (if (string-match " " self) |
| 1364 | (concat "\"" self "\"") | 1364 | (concat "\"" self "\"") |
| 1365 | self) | 1365 | self) |
| @@ -1398,7 +1398,7 @@ For the \"inline\" alternatives, also see the variable | |||
| 1398 | tem) | 1398 | tem) |
| 1399 | (dolist (style styles) | 1399 | (dolist (style styles) |
| 1400 | (when (stringp (cadr style)) | 1400 | (when (stringp (cadr style)) |
| 1401 | (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) | 1401 | (setcdr style (list (decode-coding-string (cadr style) 'utf-8))))) |
| 1402 | (dolist (style (if styles | 1402 | (dolist (style (if styles |
| 1403 | (append gnus-posting-styles (list (cons ".*" styles))) | 1403 | (append gnus-posting-styles (list (cons ".*" styles))) |
| 1404 | gnus-posting-styles)) | 1404 | gnus-posting-styles)) |
| @@ -1637,7 +1637,7 @@ this is a reply." | |||
| 1637 | ;; Copy the article over to some group(s). | 1637 | ;; Copy the article over to some group(s). |
| 1638 | (while (setq group (pop groups)) | 1638 | (while (setq group (pop groups)) |
| 1639 | (setq method (gnus-inews-group-method group) | 1639 | (setq method (gnus-inews-group-method group) |
| 1640 | group (mm-encode-coding-string | 1640 | group (encode-coding-string |
| 1641 | group | 1641 | group |
| 1642 | (gnus-group-name-charset method group))) | 1642 | (gnus-group-name-charset method group))) |
| 1643 | (unless (gnus-check-server method) | 1643 | (unless (gnus-check-server method) |
| @@ -1840,8 +1840,8 @@ this is a reply." | |||
| 1840 | (when tmp-style | 1840 | (when tmp-style |
| 1841 | (dolist (style tmp-style) | 1841 | (dolist (style tmp-style) |
| 1842 | (when (stringp (cadr style)) | 1842 | (when (stringp (cadr style)) |
| 1843 | (setcdr style (list (mm-decode-coding-string (cadr style) | 1843 | (setcdr style (list (decode-coding-string (cadr style) |
| 1844 | 'utf-8))))) | 1844 | 'utf-8))))) |
| 1845 | (setq styles (append styles (list (cons ".*" tmp-style))))))) | 1845 | (setq styles (append styles (list (cons ".*" tmp-style))))))) |
| 1846 | ;; Go through all styles and look for matches. | 1846 | ;; Go through all styles and look for matches. |
| 1847 | (dolist (style styles) | 1847 | (dolist (style styles) |
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index a53cabdbbb5..bb807da25ad 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el | |||
| @@ -802,7 +802,7 @@ claim them." | |||
| 802 | (while (not (eobp)) | 802 | (while (not (eobp)) |
| 803 | (ignore-errors | 803 | (ignore-errors |
| 804 | (push (cons | 804 | (push (cons |
| 805 | (mm-string-as-unibyte | 805 | (string-as-unibyte |
| 806 | (buffer-substring | 806 | (buffer-substring |
| 807 | (point) | 807 | (point) |
| 808 | (progn | 808 | (progn |
| @@ -815,7 +815,7 @@ claim them." | |||
| 815 | (while (not (eobp)) | 815 | (while (not (eobp)) |
| 816 | (ignore-errors | 816 | (ignore-errors |
| 817 | (push (cons | 817 | (push (cons |
| 818 | (mm-string-as-unibyte | 818 | (string-as-unibyte |
| 819 | (if (eq (char-after) ?\") | 819 | (if (eq (char-after) ?\") |
| 820 | (read cur) | 820 | (read cur) |
| 821 | (let ((p (point)) (name "")) | 821 | (let ((p (point)) (name "")) |
| @@ -883,7 +883,7 @@ claim them." | |||
| 883 | (if (and (fboundp 'detect-coding-string) | 883 | (if (and (fboundp 'detect-coding-string) |
| 884 | (eq (detect-coding-string name t) 'undecided)) | 884 | (eq (detect-coding-string name t) 'undecided)) |
| 885 | name | 885 | name |
| 886 | (mm-decode-coding-string | 886 | (decode-coding-string |
| 887 | name | 887 | name |
| 888 | (inline (gnus-group-name-charset method name))))))) | 888 | (inline (gnus-group-name-charset method name))))))) |
| 889 | (list 'gnus-group name) | 889 | (list 'gnus-group name) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 825c95c77c8..b081a6602eb 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -1992,7 +1992,7 @@ backend check whether the group actually exists." | |||
| 1992 | (while lists | 1992 | (while lists |
| 1993 | (setq killed (car lists)) | 1993 | (setq killed (car lists)) |
| 1994 | (while killed | 1994 | (while killed |
| 1995 | (gnus-sethash (mm-string-as-unibyte (car killed)) nil hashtb) | 1995 | (gnus-sethash (string-as-unibyte (car killed)) nil hashtb) |
| 1996 | (setq killed (cdr killed))) | 1996 | (setq killed (cdr killed))) |
| 1997 | (setq lists (cdr lists))))) | 1997 | (setq lists (cdr lists))))) |
| 1998 | 1998 | ||
| @@ -2455,7 +2455,7 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2455 | (dolist (elem gnus-newsrc-alist) | 2455 | (dolist (elem gnus-newsrc-alist) |
| 2456 | ;; Protect against broken .newsrc.el files. | 2456 | ;; Protect against broken .newsrc.el files. |
| 2457 | (when (car elem) | 2457 | (when (car elem) |
| 2458 | (setcar elem (mm-string-as-unibyte (car elem))))) | 2458 | (setcar elem (string-as-unibyte (car elem))))) |
| 2459 | (gnus-make-hashtable-from-newsrc-alist) | 2459 | (gnus-make-hashtable-from-newsrc-alist) |
| 2460 | (when (file-newer-than-file-p file ding-file) | 2460 | (when (file-newer-than-file-p file ding-file) |
| 2461 | ;; Old format quick file | 2461 | ;; Old format quick file |
| @@ -3160,7 +3160,7 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 3160 | gnus-default-charset))) | 3160 | gnus-default-charset))) |
| 3161 | ;; Fixme: Don't decode in unibyte mode. | 3161 | ;; Fixme: Don't decode in unibyte mode. |
| 3162 | (when (and str charset (featurep 'mule)) | 3162 | (when (and str charset (featurep 'mule)) |
| 3163 | (setq str (mm-decode-coding-string str charset))) | 3163 | (setq str (decode-coding-string str charset))) |
| 3164 | (set group str))) | 3164 | (set group str))) |
| 3165 | (forward-line 1)))) | 3165 | (forward-line 1)))) |
| 3166 | (gnus-message 5 "Reading descriptions file...done") | 3166 | (gnus-message 5 "Reading descriptions file...done") |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 683eca1f15a..dfdf8e18966 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -4446,9 +4446,9 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." | |||
| 4446 | 4446 | ||
| 4447 | (defsubst gnus-remove-odd-characters (string) | 4447 | (defsubst gnus-remove-odd-characters (string) |
| 4448 | "Translate STRING into something that doesn't contain weird characters." | 4448 | "Translate STRING into something that doesn't contain weird characters." |
| 4449 | (mm-subst-char-in-string | 4449 | (subst-char-in-string |
| 4450 | ?\r ?\- | 4450 | ?\r ?\- |
| 4451 | (mm-subst-char-in-string ?\n ?\- string t) t)) | 4451 | (subst-char-in-string ?\n ?\- string t) t)) |
| 4452 | 4452 | ||
| 4453 | ;; This function has to be called with point after the article number | 4453 | ;; This function has to be called with point after the article number |
| 4454 | ;; on the beginning of the line. | 4454 | ;; on the beginning of the line. |
| @@ -5578,15 +5578,15 @@ If SELECT-ARTICLES, only select those articles from GROUP." | |||
| 5578 | (gnus-kill-buffer (current-buffer))) | 5578 | (gnus-kill-buffer (current-buffer))) |
| 5579 | (error | 5579 | (error |
| 5580 | "Couldn't activate group %s: %s" | 5580 | "Couldn't activate group %s: %s" |
| 5581 | (mm-decode-coding-string group charset) | 5581 | (decode-coding-string group charset) |
| 5582 | (mm-decode-coding-string (gnus-status-message group) charset)))) | 5582 | (decode-coding-string (gnus-status-message group) charset)))) |
| 5583 | 5583 | ||
| 5584 | (unless (gnus-request-group group t nil (gnus-get-info group)) | 5584 | (unless (gnus-request-group group t nil (gnus-get-info group)) |
| 5585 | (when (derived-mode-p 'gnus-summary-mode) | 5585 | (when (derived-mode-p 'gnus-summary-mode) |
| 5586 | (gnus-kill-buffer (current-buffer))) | 5586 | (gnus-kill-buffer (current-buffer))) |
| 5587 | (error "Couldn't request group %s: %s" | 5587 | (error "Couldn't request group %s: %s" |
| 5588 | (mm-decode-coding-string group charset) | 5588 | (decode-coding-string group charset) |
| 5589 | (mm-decode-coding-string (gnus-status-message group) charset))) | 5589 | (decode-coding-string (gnus-status-message group) charset))) |
| 5590 | 5590 | ||
| 5591 | (when (and gnus-agent | 5591 | (when (and gnus-agent |
| 5592 | (gnus-active group)) | 5592 | (gnus-active group)) |
| @@ -9653,7 +9653,7 @@ C-u g', show the raw article." | |||
| 9653 | (gnus-summary-show-article t) | 9653 | (gnus-summary-show-article t) |
| 9654 | (let ((gnus-newsgroup-charset | 9654 | (let ((gnus-newsgroup-charset |
| 9655 | (or (cdr (assq arg gnus-summary-show-article-charset-alist)) | 9655 | (or (cdr (assq arg gnus-summary-show-article-charset-alist)) |
| 9656 | (mm-read-coding-system | 9656 | (read-coding-system |
| 9657 | "View as charset: " ;; actually it is coding system. | 9657 | "View as charset: " ;; actually it is coding system. |
| 9658 | (with-current-buffer gnus-article-buffer | 9658 | (with-current-buffer gnus-article-buffer |
| 9659 | (mm-detect-coding-region (point) (point-max)))))) | 9659 | (mm-detect-coding-region (point) (point-max)))))) |
| @@ -9948,7 +9948,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." | |||
| 9948 | encoded to-newsgroup | 9948 | encoded to-newsgroup |
| 9949 | to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) | 9949 | to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) |
| 9950 | (set (intern (format "gnus-current-%s-group" action)) | 9950 | (set (intern (format "gnus-current-%s-group" action)) |
| 9951 | (mm-decode-coding-string | 9951 | (decode-coding-string |
| 9952 | to-newsgroup | 9952 | to-newsgroup |
| 9953 | (gnus-group-name-charset to-method to-newsgroup)))) | 9953 | (gnus-group-name-charset to-method to-newsgroup)))) |
| 9954 | (unless to-method | 9954 | (unless to-method |
| @@ -9958,7 +9958,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." | |||
| 9958 | (setq to-newsgroup | 9958 | (setq to-newsgroup |
| 9959 | (or encoded | 9959 | (or encoded |
| 9960 | (and to-newsgroup | 9960 | (and to-newsgroup |
| 9961 | (mm-encode-coding-string | 9961 | (encode-coding-string |
| 9962 | to-newsgroup | 9962 | to-newsgroup |
| 9963 | (gnus-group-name-charset to-method to-newsgroup))))) | 9963 | (gnus-group-name-charset to-method to-newsgroup))))) |
| 9964 | ;; Check the method we are to move this article to... | 9964 | ;; Check the method we are to move this article to... |
| @@ -11135,7 +11135,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." | |||
| 11135 | (goto-char (+ forward (point))) | 11135 | (goto-char (+ forward (point))) |
| 11136 | ;; Replace the old mark with the new mark. | 11136 | ;; Replace the old mark with the new mark. |
| 11137 | (let ((to-insert | 11137 | (let ((to-insert |
| 11138 | (mm-subst-char-in-string | 11138 | (subst-char-in-string |
| 11139 | (char-after) mark | 11139 | (char-after) mark |
| 11140 | (buffer-substring (point) (1+ (point)))))) | 11140 | (buffer-substring (point) (1+ (point)))))) |
| 11141 | (delete-region (point) (1+ (point))) | 11141 | (delete-region (point) (1+ (point))) |
| @@ -12279,7 +12279,7 @@ save those articles instead." | |||
| 12279 | (setq to-newsgroup default)) | 12279 | (setq to-newsgroup default)) |
| 12280 | (unless to-newsgroup | 12280 | (unless to-newsgroup |
| 12281 | (error "No group name entered")) | 12281 | (error "No group name entered")) |
| 12282 | (setq encoded (mm-encode-coding-string | 12282 | (setq encoded (encode-coding-string |
| 12283 | to-newsgroup | 12283 | to-newsgroup |
| 12284 | (gnus-group-name-charset to-method to-newsgroup))) | 12284 | (gnus-group-name-charset to-method to-newsgroup))) |
| 12285 | (or (gnus-active encoded) | 12285 | (or (gnus-active encoded) |
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 1a249e95584..6a0c8f950b9 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el | |||
| @@ -408,7 +408,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 408 | gnus-uu-default-dir)))) | 408 | gnus-uu-default-dir)))) |
| 409 | (gnus-uu-initialize) | 409 | (gnus-uu-initialize) |
| 410 | (setq gnus-uu-binhex-article-name | 410 | (setq gnus-uu-binhex-article-name |
| 411 | (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) | 411 | (make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
| 412 | (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) | 412 | (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) |
| 413 | 413 | ||
| 414 | (defun gnus-uu-decode-yenc (n dir) | 414 | (defun gnus-uu-decode-yenc (n dir) |
| @@ -474,7 +474,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 474 | gnus-uu-default-dir gnus-uu-default-dir))) | 474 | gnus-uu-default-dir gnus-uu-default-dir))) |
| 475 | (gnus-uu-initialize) | 475 | (gnus-uu-initialize) |
| 476 | (setq gnus-uu-binhex-article-name | 476 | (setq gnus-uu-binhex-article-name |
| 477 | (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) | 477 | (make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
| 478 | (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | 478 | (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
| 479 | (gnus-uu-decode-binhex n file))) | 479 | (gnus-uu-decode-binhex n file))) |
| 480 | 480 | ||
| @@ -486,7 +486,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 486 | (interactive "P") | 486 | (interactive "P") |
| 487 | (gnus-uu-initialize) | 487 | (gnus-uu-initialize) |
| 488 | (let ((gnus-uu-save-in-digest t) | 488 | (let ((gnus-uu-save-in-digest t) |
| 489 | (file (mm-make-temp-file (nnheader-concat gnus-uu-work-dir "forward"))) | 489 | (file (make-temp-file (nnheader-concat gnus-uu-work-dir "forward"))) |
| 490 | (message-forward-as-mime message-forward-as-mime) | 490 | (message-forward-as-mime message-forward-as-mime) |
| 491 | (mail-parse-charset gnus-newsgroup-charset) | 491 | (mail-parse-charset gnus-newsgroup-charset) |
| 492 | (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) | 492 | (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
| @@ -1784,7 +1784,7 @@ Gnus might fail to display all of it.") | |||
| 1784 | gnus-uu-tmp-dir))) | 1784 | gnus-uu-tmp-dir))) |
| 1785 | 1785 | ||
| 1786 | (setq gnus-uu-work-dir | 1786 | (setq gnus-uu-work-dir |
| 1787 | (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir)) | 1787 | (make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir)) |
| 1788 | (gnus-set-file-modes gnus-uu-work-dir 448) | 1788 | (gnus-set-file-modes gnus-uu-work-dir 448) |
| 1789 | (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) | 1789 | (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) |
| 1790 | (push (cons gnus-newsgroup-name gnus-uu-work-dir) | 1790 | (push (cons gnus-newsgroup-name gnus-uu-work-dir) |
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index fe867490df4..04496b6b770 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el | |||
| @@ -3234,8 +3234,7 @@ If ARG, insert string at point." | |||
| 3234 | 4.99 | 3234 | 4.99 |
| 3235 | (+ 5 (* 0.02 | 3235 | (+ 5 (* 0.02 |
| 3236 | (abs | 3236 | (abs |
| 3237 | (- (mm-char-int (aref (downcase alpha) 0)) | 3237 | (- (aref (downcase alpha) 0) ?t))) |
| 3238 | (mm-char-int ?t)))) | ||
| 3239 | -0.01)) | 3238 | -0.01)) |
| 3240 | minor least) | 3239 | minor least) |
| 3241 | (format "%d.%02d%02d" major minor least)))))) | 3240 | (format "%d.%02d%02d" major minor least)))))) |
diff --git a/lisp/gnus/ietf-drums.el b/lisp/gnus/ietf-drums.el index 429eead4a0e..d833366125e 100644 --- a/lisp/gnus/ietf-drums.el +++ b/lisp/gnus/ietf-drums.el | |||
| @@ -81,10 +81,10 @@ backslash and doublequote.") | |||
| 81 | (let ((i 0) | 81 | (let ((i 0) |
| 82 | b e c out range) | 82 | b e c out range) |
| 83 | (while (< i (length token)) | 83 | (while (< i (length token)) |
| 84 | (setq c (mm-char-int (aref token i))) | 84 | (setq c (aref token i)) |
| 85 | (incf i) | 85 | (incf i) |
| 86 | (cond | 86 | (cond |
| 87 | ((eq c (mm-char-int ?-)) | 87 | ((eq c ?-) |
| 88 | (if b | 88 | (if b |
| 89 | (setq range t) | 89 | (setq range t) |
| 90 | (push c out))) | 90 | (push c out))) |
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index 62d8b9be391..7ceb865a820 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el | |||
| @@ -32,13 +32,6 @@ | |||
| 32 | (eval-when-compile (require 'cl)) | 32 | (eval-when-compile (require 'cl)) |
| 33 | (autoload 'mail-header-parse-content-type "mail-parse") | 33 | (autoload 'mail-header-parse-content-type "mail-parse") |
| 34 | 34 | ||
| 35 | ;; `mm-delete-duplicates' is an alias for `delete-dups' in Emacs 22. | ||
| 36 | (defalias 'mailcap-delete-duplicates | ||
| 37 | (if (fboundp 'delete-dups) | ||
| 38 | 'delete-dups | ||
| 39 | (autoload 'mm-delete-duplicates "mm-util") | ||
| 40 | 'mm-delete-duplicates)) | ||
| 41 | |||
| 42 | (defgroup mailcap nil | 35 | (defgroup mailcap nil |
| 43 | "Definition of viewers for MIME types." | 36 | "Definition of viewers for MIME types." |
| 44 | :version "21.1" | 37 | :version "21.1" |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b56c5cd0c62..dec4c379adb 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -2167,7 +2167,7 @@ contains a valid encoded word. Decode again? " | |||
| 2167 | ;; No double encoded subject? => bogus charset. | 2167 | ;; No double encoded subject? => bogus charset. |
| 2168 | (unless cs-coding | 2168 | (unless cs-coding |
| 2169 | (setq cs-coding | 2169 | (setq cs-coding |
| 2170 | (mm-read-coding-system | 2170 | (read-coding-system |
| 2171 | (format-message "\ | 2171 | (format-message "\ |
| 2172 | Decoded Subject \"%s\" | 2172 | Decoded Subject \"%s\" |
| 2173 | contains an encoded word. The charset `%s' is unknown or invalid. | 2173 | contains an encoded word. The charset `%s' is unknown or invalid. |
| @@ -4319,7 +4319,7 @@ conformance." | |||
| 4319 | (point) 'no-illegible-text) | 4319 | (point) 'no-illegible-text) |
| 4320 | (point-max)))) | 4320 | (point-max)))) |
| 4321 | (setq char (char-after))) | 4321 | (setq char (char-after))) |
| 4322 | (when (or (< (mm-char-int char) 128) | 4322 | (when (or (< char 128) |
| 4323 | (and (mm-multibyte-p) | 4323 | (and (mm-multibyte-p) |
| 4324 | (memq (char-charset char) | 4324 | (memq (char-charset char) |
| 4325 | '(eight-bit-control eight-bit-graphic | 4325 | '(eight-bit-control eight-bit-graphic |
| @@ -4349,7 +4349,7 @@ conformance." | |||
| 4349 | (skip-chars-forward mm-7bit-chars) | 4349 | (skip-chars-forward mm-7bit-chars) |
| 4350 | (while (not (eobp)) | 4350 | (while (not (eobp)) |
| 4351 | (when (let ((char (char-after))) | 4351 | (when (let ((char (char-after))) |
| 4352 | (or (< (mm-char-int char) 128) | 4352 | (or (< char 128) |
| 4353 | (and (mm-multibyte-p) | 4353 | (and (mm-multibyte-p) |
| 4354 | ;; FIXME: Wrong for Emacs 23 (unicode) and for | 4354 | ;; FIXME: Wrong for Emacs 23 (unicode) and for |
| 4355 | ;; things like undecodable utf-8 (in Emacs 21?). | 4355 | ;; things like undecodable utf-8 (in Emacs 21?). |
| @@ -5346,7 +5346,7 @@ Otherwise, generate and save a value for `canlock-password' first." | |||
| 5346 | ;; Check for control characters. | 5346 | ;; Check for control characters. |
| 5347 | (message-check 'control-chars | 5347 | (message-check 'control-chars |
| 5348 | (if (re-search-forward | 5348 | (if (re-search-forward |
| 5349 | (mm-string-to-multibyte "[\000-\007\013\015-\032\034-\037\200-\237]") | 5349 | (string-to-multibyte "[\000-\007\013\015-\032\034-\037\200-\237]") |
| 5350 | nil t) | 5350 | nil t) |
| 5351 | (y-or-n-p | 5351 | (y-or-n-p |
| 5352 | "The article contains control characters. Really post? ") | 5352 | "The article contains control characters. Really post? ") |
| @@ -5895,7 +5895,7 @@ subscribed address (and not the additional To and Cc header contents)." | |||
| 5895 | ace) | 5895 | ace) |
| 5896 | (when field | 5896 | (when field |
| 5897 | (dolist (rhs | 5897 | (dolist (rhs |
| 5898 | (mm-delete-duplicates | 5898 | (delete-dups |
| 5899 | (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) "")) | 5899 | (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) "")) |
| 5900 | (mapcar 'downcase | 5900 | (mapcar 'downcase |
| 5901 | (mapcar | 5901 | (mapcar |
| @@ -7427,7 +7427,7 @@ Optional DIGEST will use digest to forward." | |||
| 7427 | (let ((b (point)) | 7427 | (let ((b (point)) |
| 7428 | (contents (with-current-buffer forward-buffer (buffer-string))) | 7428 | (contents (with-current-buffer forward-buffer (buffer-string))) |
| 7429 | e) | 7429 | e) |
| 7430 | (unless (mm-multibyte-string-p contents) | 7430 | (unless (multibyte-string-p contents) |
| 7431 | (error "Attempt to insert unibyte string from the buffer \"%s\"\ | 7431 | (error "Attempt to insert unibyte string from the buffer \"%s\"\ |
| 7432 | to the multibyte buffer \"%s\"" | 7432 | to the multibyte buffer \"%s\"" |
| 7433 | (if (bufferp forward-buffer) | 7433 | (if (bufferp forward-buffer) |
| @@ -7490,7 +7490,7 @@ Optional DIGEST will use digest to forward." | |||
| 7490 | (let ((b (point)) e) | 7490 | (let ((b (point)) e) |
| 7491 | (if (not message-forward-decoded-p) | 7491 | (if (not message-forward-decoded-p) |
| 7492 | (let ((contents (with-current-buffer forward-buffer (buffer-string)))) | 7492 | (let ((contents (with-current-buffer forward-buffer (buffer-string)))) |
| 7493 | (unless (mm-multibyte-string-p contents) | 7493 | (unless (multibyte-string-p contents) |
| 7494 | (error "Attempt to insert unibyte string from the buffer \"%s\"\ | 7494 | (error "Attempt to insert unibyte string from the buffer \"%s\"\ |
| 7495 | to the multibyte buffer \"%s\"" | 7495 | to the multibyte buffer \"%s\"" |
| 7496 | (if (bufferp forward-buffer) | 7496 | (if (bufferp forward-buffer) |
diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el index 45dbd901abf..bac722e31bf 100644 --- a/lisp/gnus/mm-archive.el +++ b/lisp/gnus/mm-archive.el | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | (defun mm-dissect-archive (handle) | 37 | (defun mm-dissect-archive (handle) |
| 38 | (let ((decoder (cddr (assoc (car (mm-handle-type handle)) | 38 | (let ((decoder (cddr (assoc (car (mm-handle-type handle)) |
| 39 | mm-archive-decoders))) | 39 | mm-archive-decoders))) |
| 40 | (dir (mm-make-temp-file | 40 | (dir (make-temp-file |
| 41 | (expand-file-name "emm." mm-tmp-directory) 'dir))) | 41 | (expand-file-name "emm." mm-tmp-directory) 'dir))) |
| 42 | (set-file-modes dir #o700) | 42 | (set-file-modes dir #o700) |
| 43 | (unwind-protect | 43 | (unwind-protect |
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el index cd5769584e2..e07edd324fc 100644 --- a/lisp/gnus/mm-bodies.el +++ b/lisp/gnus/mm-bodies.el | |||
| @@ -86,15 +86,15 @@ If no encoding was done, nil is returned." | |||
| 86 | (message-options-get 'mm-body-charset-encoding-alist) | 86 | (message-options-get 'mm-body-charset-encoding-alist) |
| 87 | (message-options-set | 87 | (message-options-set |
| 88 | 'mm-body-charset-encoding-alist | 88 | 'mm-body-charset-encoding-alist |
| 89 | (mm-read-coding-system "Charset used in the article: "))) | 89 | (read-coding-system "Charset used in the article: "))) |
| 90 | ;; The logic in `mml-generate-mime-1' confirms that it's OK | 90 | ;; The logic in `mml-generate-mime-1' confirms that it's OK |
| 91 | ;; to return nil here. | 91 | ;; to return nil here. |
| 92 | nil))) | 92 | nil))) |
| 93 | (save-excursion | 93 | (save-excursion |
| 94 | (if charset | 94 | (if charset |
| 95 | (progn | 95 | (progn |
| 96 | (mm-encode-coding-region (point-min) (point-max) | 96 | (encode-coding-region (point-min) (point-max) |
| 97 | (mm-charset-to-coding-system charset)) | 97 | (mm-charset-to-coding-system charset)) |
| 98 | charset) | 98 | charset) |
| 99 | (goto-char (point-min)) | 99 | (goto-char (point-min)) |
| 100 | (let ((charsets (mm-find-mime-charset-region (point-min) (point-max) | 100 | (let ((charsets (mm-find-mime-charset-region (point-min) (point-max) |
| @@ -110,8 +110,8 @@ If no encoding was done, nil is returned." | |||
| 110 | (t | 110 | (t |
| 111 | (prog1 | 111 | (prog1 |
| 112 | (setq charset (car charsets)) | 112 | (setq charset (car charsets)) |
| 113 | (mm-encode-coding-region (point-min) (point-max) | 113 | (encode-coding-region (point-min) (point-max) |
| 114 | (mm-charset-to-coding-system charset)))) | 114 | (mm-charset-to-coding-system charset)))) |
| 115 | )))))) | 115 | )))))) |
| 116 | 116 | ||
| 117 | (defun mm-long-lines-p (length) | 117 | (defun mm-long-lines-p (length) |
| @@ -258,8 +258,7 @@ decoding. If it is nil, default to `mail-parse-charset'." | |||
| 258 | (mm-multibyte-p) | 258 | (mm-multibyte-p) |
| 259 | (or (not (eq coding-system 'ascii)) | 259 | (or (not (eq coding-system 'ascii)) |
| 260 | (setq coding-system mail-parse-charset))) | 260 | (setq coding-system mail-parse-charset))) |
| 261 | (mm-decode-coding-region (point-min) (point-max) | 261 | (decode-coding-region (point-min) (point-max) coding-system)) |
| 262 | coding-system)) | ||
| 263 | (setq buffer-file-coding-system | 262 | (setq buffer-file-coding-system |
| 264 | (if (boundp 'last-coding-system-used) | 263 | (if (boundp 'last-coding-system-used) |
| 265 | (symbol-value 'last-coding-system-used) | 264 | (symbol-value 'last-coding-system-used) |
| @@ -290,7 +289,7 @@ decoding. If it is nil, default to `mail-parse-charset'." | |||
| 290 | (mm-multibyte-p) | 289 | (mm-multibyte-p) |
| 291 | (or (not (eq coding-system 'ascii)) | 290 | (or (not (eq coding-system 'ascii)) |
| 292 | (setq coding-system mail-parse-charset))) | 291 | (setq coding-system mail-parse-charset))) |
| 293 | (mm-decode-coding-string string coding-system)))) | 292 | (decode-coding-string string coding-system)))) |
| 294 | string)) | 293 | string)) |
| 295 | 294 | ||
| 296 | (provide 'mm-bodies) | 295 | (provide 'mm-bodies) |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index d1240c01b5c..d6900149d91 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -773,7 +773,7 @@ MIME-Version header before proceeding." | |||
| 773 | (with-current-buffer | 773 | (with-current-buffer |
| 774 | (generate-new-buffer " *mm*") | 774 | (generate-new-buffer " *mm*") |
| 775 | ;; Preserve the data's unibyteness (for url-insert-file-contents). | 775 | ;; Preserve the data's unibyteness (for url-insert-file-contents). |
| 776 | (mm-set-buffer-multibyte mb) | 776 | (set-buffer-multibyte mb) |
| 777 | (insert-buffer-substring obuf beg) | 777 | (insert-buffer-substring obuf beg) |
| 778 | (current-buffer)))) | 778 | (current-buffer)))) |
| 779 | 779 | ||
| @@ -888,7 +888,7 @@ external if displayed external." | |||
| 888 | (select-window win))) | 888 | (select-window win))) |
| 889 | (switch-to-buffer (generate-new-buffer " *mm*"))) | 889 | (switch-to-buffer (generate-new-buffer " *mm*"))) |
| 890 | (buffer-disable-undo) | 890 | (buffer-disable-undo) |
| 891 | (mm-set-buffer-file-coding-system mm-binary-coding-system) | 891 | (set-buffer-file-coding-system mm-binary-coding-system) |
| 892 | (insert-buffer-substring cur) | 892 | (insert-buffer-substring cur) |
| 893 | (goto-char (point-min)) | 893 | (goto-char (point-min)) |
| 894 | (when method | 894 | (when method |
| @@ -1307,7 +1307,7 @@ are ignored." | |||
| 1307 | (with-current-buffer (mm-handle-buffer handle) | 1307 | (with-current-buffer (mm-handle-buffer handle) |
| 1308 | (buffer-string))) | 1308 | (buffer-string))) |
| 1309 | ((mm-multibyte-p) | 1309 | ((mm-multibyte-p) |
| 1310 | (mm-string-to-multibyte (mm-get-part handle no-cache))) | 1310 | (string-to-multibyte (mm-get-part handle no-cache))) |
| 1311 | (t | 1311 | (t |
| 1312 | (mm-get-part handle no-cache))))) | 1312 | (mm-get-part handle no-cache))))) |
| 1313 | (save-restriction | 1313 | (save-restriction |
| @@ -1813,7 +1813,7 @@ If RECURSIVE, search recursively." | |||
| 1813 | (mm-charset-to-coding-system charset | 1813 | (mm-charset-to-coding-system charset |
| 1814 | nil t)) | 1814 | nil t)) |
| 1815 | (not (eq charset 'ascii))) | 1815 | (not (eq charset 'ascii))) |
| 1816 | (mm-decode-coding-string (buffer-string) charset) | 1816 | (decode-coding-string (buffer-string) charset) |
| 1817 | (mm-string-as-multibyte (buffer-string))) | 1817 | (mm-string-as-multibyte (buffer-string))) |
| 1818 | (erase-buffer) | 1818 | (erase-buffer) |
| 1819 | (mm-enable-multibyte))) | 1819 | (mm-enable-multibyte))) |
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el index e5c43fd1559..25954b937ee 100644 --- a/lisp/gnus/mm-url.el +++ b/lisp/gnus/mm-url.el | |||
| @@ -364,7 +364,7 @@ If FOLLOW-REFRESH is non-nil, redirect refresh url in META." | |||
| 364 | (string-to-number (substring entity 1))))) | 364 | (string-to-number (substring entity 1))))) |
| 365 | (setq c (or (cdr (assq c mm-extra-numeric-entities)) | 365 | (setq c (or (cdr (assq c mm-extra-numeric-entities)) |
| 366 | (mm-ucs-to-char c))) | 366 | (mm-ucs-to-char c))) |
| 367 | (if (mm-char-or-char-int-p c) c ?#)) | 367 | (if (char-valid-p c) c ?#)) |
| 368 | (or (cdr (assq (intern entity) | 368 | (or (cdr (assq (intern entity) |
| 369 | mm-url-html-entities)) | 369 | mm-url-html-entities)) |
| 370 | ?#)))) | 370 | ?#)))) |
| @@ -399,10 +399,10 @@ spaces. Die Die Die." | |||
| 399 | ((= char ? ) "+") | 399 | ((= char ? ) "+") |
| 400 | ((memq char mm-url-unreserved-chars) (char-to-string char)) | 400 | ((memq char mm-url-unreserved-chars) (char-to-string char)) |
| 401 | (t (upcase (format "%%%02x" char))))) | 401 | (t (upcase (format "%%%02x" char))))) |
| 402 | (mm-encode-coding-string chunk | 402 | (encode-coding-string chunk |
| 403 | (if (fboundp 'find-coding-systems-string) | 403 | (if (fboundp 'find-coding-systems-string) |
| 404 | (car (find-coding-systems-string chunk)) | 404 | (car (find-coding-systems-string chunk)) |
| 405 | buffer-file-coding-system)) | 405 | buffer-file-coding-system)) |
| 406 | ""))) | 406 | ""))) |
| 407 | 407 | ||
| 408 | (defun mm-url-encode-www-form-urlencoded (pairs) | 408 | (defun mm-url-encode-www-form-urlencoded (pairs) |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 9deca2354f2..97b28bc30fb 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -44,50 +44,7 @@ | |||
| 44 | (if (fboundp (car elem)) | 44 | (if (fboundp (car elem)) |
| 45 | (defalias nfunc (car elem)) | 45 | (defalias nfunc (car elem)) |
| 46 | (defalias nfunc (cdr elem))))) | 46 | (defalias nfunc (cdr elem))))) |
| 47 | `(;; `coding-system-list' is not available in XEmacs 21.4 built | 47 | `( |
| 48 | ;; without the `file-coding' feature. | ||
| 49 | (coding-system-list . ignore) | ||
| 50 | ;; `char-int' is an XEmacs function, not available in Emacs. | ||
| 51 | (char-int . identity) | ||
| 52 | ;; `coding-system-equal' is an Emacs function, not available in XEmacs. | ||
| 53 | (coding-system-equal . equal) | ||
| 54 | ;; `set-buffer-file-coding-system' is not available in XEmacs 21.4 | ||
| 55 | ;; built without the `file-coding' feature. | ||
| 56 | (set-buffer-file-coding-system . ignore) | ||
| 57 | ;; `read-charset' is an Emacs function, not available in XEmacs. | ||
| 58 | (read-charset | ||
| 59 | . ,(lambda (prompt) | ||
| 60 | "Return a charset." | ||
| 61 | (intern | ||
| 62 | (gnus-completing-read | ||
| 63 | prompt | ||
| 64 | (mapcar (lambda (e) (symbol-name (car e))) | ||
| 65 | mm-mime-mule-charset-alist) | ||
| 66 | t)))) | ||
| 67 | ;; `subst-char-in-string' is not available in XEmacs 21.4. | ||
| 68 | (subst-char-in-string | ||
| 69 | . ,(lambda (from to string &optional inplace) | ||
| 70 | ;; stolen (and renamed) from nnheader.el | ||
| 71 | "Replace characters in STRING from FROM to TO. | ||
| 72 | Unless optional argument INPLACE is non-nil, return a new string." | ||
| 73 | (let ((string (if inplace string (copy-sequence string))) | ||
| 74 | (len (length string)) | ||
| 75 | (idx 0)) | ||
| 76 | ;; Replace all occurrences of FROM with TO. | ||
| 77 | (while (< idx len) | ||
| 78 | (when (= (aref string idx) from) | ||
| 79 | (aset string idx to)) | ||
| 80 | (setq idx (1+ idx))) | ||
| 81 | string))) | ||
| 82 | ;; `replace-in-string' is an XEmacs function, not available in Emacs. | ||
| 83 | (replace-in-string | ||
| 84 | . ,(lambda (string regexp rep &optional literal) | ||
| 85 | "See `replace-regexp-in-string', only the order of args differs." | ||
| 86 | (replace-regexp-in-string regexp rep string nil literal))) | ||
| 87 | ;; `string-as-unibyte' is an Emacs function, not available in XEmacs. | ||
| 88 | (string-as-unibyte . identity) | ||
| 89 | ;; `string-make-unibyte' is an Emacs function, not available in XEmacs. | ||
| 90 | (string-make-unibyte . identity) | ||
| 91 | ;; string-as-multibyte often doesn't really do what you think it does. | 48 | ;; string-as-multibyte often doesn't really do what you think it does. |
| 92 | ;; Example: | 49 | ;; Example: |
| 93 | ;; (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201) | 50 | ;; (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201) |
| @@ -107,189 +64,22 @@ | |||
| 107 | ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary) | 64 | ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary) |
| 108 | ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system) | 65 | ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system) |
| 109 | ;; `string-as-multibyte' is an Emacs function, not available in XEmacs. | 66 | ;; `string-as-multibyte' is an Emacs function, not available in XEmacs. |
| 110 | (string-as-multibyte . identity) | 67 | (string-as-multibyte . identity)))) |
| 111 | ;; `multibyte-string-p' is an Emacs function, not available in XEmacs. | ||
| 112 | (multibyte-string-p . ignore) | ||
| 113 | ;; `insert-byte' is available only in Emacs 23.1 or greater. | ||
| 114 | (insert-byte . insert-char) | ||
| 115 | ;; `multibyte-char-to-unibyte' is an Emacs function, not available | ||
| 116 | ;; in XEmacs. | ||
| 117 | (multibyte-char-to-unibyte . identity) | ||
| 118 | ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs. | ||
| 119 | (set-buffer-multibyte . ignore) | ||
| 120 | ;; `substring-no-properties' is available only in Emacs 22.1 or greater. | ||
| 121 | (substring-no-properties | ||
| 122 | . ,(lambda (string &optional from to) | ||
| 123 | "Return a substring of STRING, without text properties. | ||
| 124 | It starts at index FROM and ending before TO. | ||
| 125 | TO may be nil or omitted; then the substring runs to the end of STRING. | ||
| 126 | If FROM is nil or omitted, the substring starts at the beginning of STRING. | ||
| 127 | If FROM or TO is negative, it counts from the end. | ||
| 128 | |||
| 129 | With one argument, just copy STRING without its properties." | ||
| 130 | (setq string (substring string (or from 0) to)) | ||
| 131 | (set-text-properties 0 (length string) nil string) | ||
| 132 | string)) | ||
| 133 | ;; `line-number-at-pos' is available only in Emacs 22.1 or greater | ||
| 134 | ;; and XEmacs 21.5. | ||
| 135 | (line-number-at-pos | ||
| 136 | . ,(lambda (&optional pos) | ||
| 137 | "Return (narrowed) buffer line number at position POS. | ||
| 138 | If POS is nil, use current buffer location. | ||
| 139 | Counting starts at (point-min), so the value refers | ||
| 140 | to the contents of the accessible portion of the buffer." | ||
| 141 | (let ((opoint (or pos (point))) start) | ||
| 142 | (save-excursion | ||
| 143 | (goto-char (point-min)) | ||
| 144 | (setq start (point)) | ||
| 145 | (goto-char opoint) | ||
| 146 | (forward-line 0) | ||
| 147 | (1+ (count-lines start (point)))))))))) | ||
| 148 | |||
| 149 | ;; `special-display-p' is an Emacs function, not available in XEmacs. | ||
| 150 | (defalias 'mm-special-display-p | ||
| 151 | (if (featurep 'emacs) | ||
| 152 | 'special-display-p | ||
| 153 | (lambda (buffer-name) | ||
| 154 | "Returns non-nil if a buffer named BUFFER-NAME gets a special frame." | ||
| 155 | (and special-display-function | ||
| 156 | (or (and (member buffer-name special-display-buffer-names) t) | ||
| 157 | (cdr (assoc buffer-name special-display-buffer-names)) | ||
| 158 | (catch 'return | ||
| 159 | (dolist (elem special-display-regexps) | ||
| 160 | (and (stringp elem) | ||
| 161 | (string-match elem buffer-name) | ||
| 162 | (throw 'return t)) | ||
| 163 | (and (consp elem) | ||
| 164 | (stringp (car elem)) | ||
| 165 | (string-match (car elem) buffer-name) | ||
| 166 | (throw 'return (cdr elem)))))))))) | ||
| 167 | |||
| 168 | ;; `decode-coding-string', `encode-coding-string', `decode-coding-region' | ||
| 169 | ;; and `encode-coding-region' are available in Emacs and XEmacs built with | ||
| 170 | ;; the `file-coding' feature, but the XEmacs versions treat nil, that is | ||
| 171 | ;; given as the `coding-system' argument, as the `binary' coding system. | ||
| 172 | (eval-and-compile | ||
| 173 | (if (featurep 'xemacs) | ||
| 174 | (if (featurep 'file-coding) | ||
| 175 | (progn | ||
| 176 | (defun mm-decode-coding-string (str coding-system) | ||
| 177 | (if coding-system | ||
| 178 | (decode-coding-string str coding-system) | ||
| 179 | str)) | ||
| 180 | (defun mm-encode-coding-string (str coding-system) | ||
| 181 | (if coding-system | ||
| 182 | (encode-coding-string str coding-system) | ||
| 183 | str)) | ||
| 184 | (defun mm-decode-coding-region (start end coding-system) | ||
| 185 | (if coding-system | ||
| 186 | (decode-coding-region start end coding-system))) | ||
| 187 | (defun mm-encode-coding-region (start end coding-system) | ||
| 188 | (if coding-system | ||
| 189 | (encode-coding-region start end coding-system)))) | ||
| 190 | (defun mm-decode-coding-string (str coding-system) str) | ||
| 191 | (defun mm-encode-coding-string (str coding-system) str) | ||
| 192 | (defalias 'mm-decode-coding-region 'ignore) | ||
| 193 | (defalias 'mm-encode-coding-region 'ignore)) | ||
| 194 | (defalias 'mm-decode-coding-string 'decode-coding-string) | ||
| 195 | (defalias 'mm-encode-coding-string 'encode-coding-string) | ||
| 196 | (defalias 'mm-decode-coding-region 'decode-coding-region) | ||
| 197 | (defalias 'mm-encode-coding-region 'encode-coding-region))) | ||
| 198 | |||
| 199 | ;; `string-to-multibyte' is available only in Emacs. | ||
| 200 | (defalias 'mm-string-to-multibyte (if (featurep 'xemacs) | ||
| 201 | 'identity | ||
| 202 | 'string-to-multibyte)) | ||
| 203 | |||
| 204 | ;; `char-or-char-int-p' is an XEmacs function, not available in Emacs. | ||
| 205 | (eval-and-compile | ||
| 206 | (defalias 'mm-char-or-char-int-p | ||
| 207 | (cond | ||
| 208 | ((fboundp 'char-or-char-int-p) 'char-or-char-int-p) | ||
| 209 | ((fboundp 'char-valid-p) 'char-valid-p) | ||
| 210 | (t 'identity)))) | ||
| 211 | 68 | ||
| 212 | ;; `ucs-to-char' is a function that Mule-UCS provides. | 69 | (defun mm-ucs-to-char (codepoint) |
| 213 | (eval-and-compile | 70 | "Convert Unicode codepoint to character." |
| 214 | (if (featurep 'xemacs) | 71 | (or (decode-char 'ucs codepoint) ?#)) |
| 215 | (cond ((and (fboundp 'unicode-to-char) ;; XEmacs 21.5. | ||
| 216 | (subrp (symbol-function 'unicode-to-char))) | ||
| 217 | (if (featurep 'mule) | ||
| 218 | (defalias 'mm-ucs-to-char 'unicode-to-char) | ||
| 219 | (defun mm-ucs-to-char (codepoint) | ||
| 220 | "Convert Unicode codepoint to character." | ||
| 221 | (or (unicode-to-char codepoint) ?#)))) | ||
| 222 | ((featurep 'mule) | ||
| 223 | (defun mm-ucs-to-char (codepoint) | ||
| 224 | "Convert Unicode codepoint to character." | ||
| 225 | (if (fboundp 'ucs-to-char) ;; Mule-UCS is loaded. | ||
| 226 | (progn | ||
| 227 | (defalias 'mm-ucs-to-char | ||
| 228 | (lambda (codepoint) | ||
| 229 | "Convert Unicode codepoint to character." | ||
| 230 | (condition-case nil | ||
| 231 | (or (ucs-to-char codepoint) ?#) | ||
| 232 | (error ?#)))) | ||
| 233 | (mm-ucs-to-char codepoint)) | ||
| 234 | (condition-case nil | ||
| 235 | (or (int-to-char codepoint) ?#) | ||
| 236 | (error ?#))))) | ||
| 237 | (t | ||
| 238 | (defun mm-ucs-to-char (codepoint) | ||
| 239 | "Convert Unicode codepoint to character." | ||
| 240 | (condition-case nil | ||
| 241 | (or (int-to-char codepoint) ?#) | ||
| 242 | (error ?#))))) | ||
| 243 | (if (let ((char (make-char 'japanese-jisx0208 36 34))) | ||
| 244 | (eq char (decode-char 'ucs char))) | ||
| 245 | ;; Emacs 23. | ||
| 246 | (defalias 'mm-ucs-to-char 'identity) | ||
| 247 | (defun mm-ucs-to-char (codepoint) | ||
| 248 | "Convert Unicode codepoint to character." | ||
| 249 | (or (decode-char 'ucs codepoint) ?#))))) | ||
| 250 | |||
| 251 | ;; Fixme: This seems always to be used to read a MIME charset, so it | ||
| 252 | ;; should be re-named and fixed (in Emacs) to offer completion only on | ||
| 253 | ;; proper charset names (base coding systems which have a | ||
| 254 | ;; mime-charset defined). XEmacs doesn't believe in mime-charset; | ||
| 255 | ;; test with | ||
| 256 | ;; `(or (coding-system-get 'iso-8859-1 'mime-charset) | ||
| 257 | ;; (coding-system-get 'iso-8859-1 :mime-charset))' | ||
| 258 | ;; Actually, there should be an `mm-coding-system-mime-charset'. | ||
| 259 | (eval-and-compile | ||
| 260 | (defalias 'mm-read-coding-system | ||
| 261 | (if (featurep 'emacs) 'read-coding-system | ||
| 262 | (cond | ||
| 263 | ((fboundp 'read-coding-system) | ||
| 264 | (if (and (featurep 'xemacs) | ||
| 265 | (<= (string-to-number emacs-version) 21.1)) | ||
| 266 | (lambda (prompt &optional default-coding-system) | ||
| 267 | (read-coding-system prompt)) | ||
| 268 | 'read-coding-system)) | ||
| 269 | (t (lambda (prompt &optional default-coding-system) | ||
| 270 | "Prompt the user for a coding system." | ||
| 271 | (gnus-completing-read | ||
| 272 | prompt (mapcar (lambda (s) (symbol-name (car s))) | ||
| 273 | mm-mime-mule-charset-alist)))))))) | ||
| 274 | 72 | ||
| 275 | (defvar mm-coding-system-list nil) | 73 | (defvar mm-coding-system-list nil) |
| 276 | (defun mm-get-coding-system-list () | 74 | (defun mm-get-coding-system-list () |
| 277 | "Get the coding system list." | 75 | "Get the coding system list." |
| 278 | (or mm-coding-system-list | 76 | (or mm-coding-system-list |
| 279 | (setq mm-coding-system-list (mm-coding-system-list)))) | 77 | (setq mm-coding-system-list (coding-system-list)))) |
| 280 | 78 | ||
| 281 | (defun mm-coding-system-p (cs) | 79 | (defun mm-coding-system-p (cs) |
| 282 | "Return non-nil if CS is a symbol naming a coding system. | 80 | "Return CS if CS is a coding system." |
| 283 | In XEmacs, also return non-nil if CS is a coding system object. | 81 | (and (coding-system-p cs) |
| 284 | If CS is available, return CS itself in Emacs, and return a coding | 82 | cs)) |
| 285 | system object in XEmacs." | ||
| 286 | (if (fboundp 'find-coding-system) | ||
| 287 | (and cs (find-coding-system cs)) | ||
| 288 | (if (fboundp 'coding-system-p) | ||
| 289 | (when (coding-system-p cs) | ||
| 290 | cs) | ||
| 291 | ;; no-MULE XEmacs: | ||
| 292 | (car (memq cs (mm-get-coding-system-list)))))) | ||
| 293 | 83 | ||
| 294 | (defvar mm-charset-synonym-alist | 84 | (defvar mm-charset-synonym-alist |
| 295 | `( | 85 | `( |
| @@ -478,14 +268,13 @@ Unless LIST is given, `mm-codepage-ibm-list' is used." | |||
| 478 | 268 | ||
| 479 | ;; Note: this has to be defined before `mm-charset-to-coding-system'. | 269 | ;; Note: this has to be defined before `mm-charset-to-coding-system'. |
| 480 | (defcustom mm-charset-eval-alist | 270 | (defcustom mm-charset-eval-alist |
| 481 | (if (featurep 'xemacs) | 271 | '( |
| 482 | nil ;; I don't know what would be useful for XEmacs. | 272 | ;; Emacs 22 provides autoloads for 1250-1258 |
| 483 | '(;; Emacs 22 provides autoloads for 1250-1258 | 273 | ;; (i.e. `mm-codepage-setup' does nothing). |
| 484 | ;; (i.e. `mm-codepage-setup' does nothing). | 274 | (windows-1250 . (mm-codepage-setup 1250 t)) |
| 485 | (windows-1250 . (mm-codepage-setup 1250 t)) | 275 | (windows-1251 . (mm-codepage-setup 1251 t)) |
| 486 | (windows-1251 . (mm-codepage-setup 1251 t)) | 276 | (windows-1253 . (mm-codepage-setup 1253 t)) |
| 487 | (windows-1253 . (mm-codepage-setup 1253 t)) | 277 | (windows-1257 . (mm-codepage-setup 1257 t))) |
| 488 | (windows-1257 . (mm-codepage-setup 1257 t)))) | ||
| 489 | "An alist of (CHARSET . FORM) pairs. | 278 | "An alist of (CHARSET . FORM) pairs. |
| 490 | If an article is encoded in an unknown CHARSET, FORM is | 279 | If an article is encoded in an unknown CHARSET, FORM is |
| 491 | evaluated. This allows the loading of additional libraries | 280 | evaluated. This allows the loading of additional libraries |
| @@ -761,43 +550,21 @@ superset of iso-8859-1." | |||
| 761 | (coding-system-get 'mule-utf-8 'safe-charsets)))))) | 550 | (coding-system-get 'mule-utf-8 'safe-charsets)))))) |
| 762 | "Alist of MIME-charset/MULE-charsets.") | 551 | "Alist of MIME-charset/MULE-charsets.") |
| 763 | 552 | ||
| 764 | (defun mm-enrich-utf-8-by-mule-ucs () | ||
| 765 | "Make the `utf-8' MIME charset usable by the Mule-UCS package. | ||
| 766 | This function will run when the `un-define' module is loaded under | ||
| 767 | XEmacs, and fill the `utf-8' entry in `mm-mime-mule-charset-alist' | ||
| 768 | with Mule charsets. It is completely useless for Emacs." | ||
| 769 | (when (boundp 'unicode-basic-translation-charset-order-list) | ||
| 770 | (condition-case nil | ||
| 771 | (let ((val (delq | ||
| 772 | 'ascii | ||
| 773 | (copy-sequence | ||
| 774 | (symbol-value | ||
| 775 | 'unicode-basic-translation-charset-order-list)))) | ||
| 776 | (elem (assq 'utf-8 mm-mime-mule-charset-alist))) | ||
| 777 | (if elem | ||
| 778 | (setcdr elem val) | ||
| 779 | (setq mm-mime-mule-charset-alist | ||
| 780 | (nconc mm-mime-mule-charset-alist | ||
| 781 | (list (cons 'utf-8 val)))))) | ||
| 782 | (error)))) | ||
| 783 | |||
| 784 | ;; Correct by construction, but should be unnecessary for Emacs: | 553 | ;; Correct by construction, but should be unnecessary for Emacs: |
| 785 | (if (featurep 'xemacs) | 554 | (when (and (fboundp 'coding-system-list) |
| 786 | (eval-after-load "un-define" '(mm-enrich-utf-8-by-mule-ucs)) | 555 | (fboundp 'sort-coding-systems)) |
| 787 | (when (and (fboundp 'coding-system-list) | 556 | (let ((css (sort-coding-systems (coding-system-list 'base-only))) |
| 788 | (fboundp 'sort-coding-systems)) | 557 | cs mime mule alist) |
| 789 | (let ((css (sort-coding-systems (coding-system-list 'base-only))) | 558 | (while css |
| 790 | cs mime mule alist) | 559 | (setq cs (pop css) |
| 791 | (while css | 560 | mime (or (coding-system-get cs :mime-charset) ; Emacs 23 (unicode) |
| 792 | (setq cs (pop css) | 561 | (coding-system-get cs 'mime-charset))) |
| 793 | mime (or (coding-system-get cs :mime-charset); Emacs 23 (unicode) | 562 | (when (and mime |
| 794 | (coding-system-get cs 'mime-charset))) | 563 | (not (eq t (setq mule |
| 795 | (when (and mime | 564 | (coding-system-get cs 'safe-charsets)))) |
| 796 | (not (eq t (setq mule | 565 | (not (assq mime alist))) |
| 797 | (coding-system-get cs 'safe-charsets)))) | 566 | (push (cons mime (delq 'ascii mule)) alist))) |
| 798 | (not (assq mime alist))) | 567 | (setq mm-mime-mule-charset-alist (nreverse alist)))) |
| 799 | (push (cons mime (delq 'ascii mule)) alist))) | ||
| 800 | (setq mm-mime-mule-charset-alist (nreverse alist))))) | ||
| 801 | 568 | ||
| 802 | (defvar mm-hack-charsets '(iso-8859-15 iso-2022-jp-2) | 569 | (defvar mm-hack-charsets '(iso-8859-15 iso-2022-jp-2) |
| 803 | "A list of special charsets. | 570 | "A list of special charsets. |
| @@ -903,21 +670,15 @@ like \"€\" to the euro sign, mainly in html messages.") | |||
| 903 | (pop alist)) | 670 | (pop alist)) |
| 904 | out))) | 671 | out))) |
| 905 | 672 | ||
| 906 | (eval-and-compile | 673 | (defun mm-enable-multibyte () |
| 907 | (if (featurep 'xemacs) | 674 | "Set the multibyte flag of the current buffer. |
| 908 | (defalias 'mm-enable-multibyte 'ignore) | ||
| 909 | (defun mm-enable-multibyte () | ||
| 910 | "Set the multibyte flag of the current buffer. | ||
| 911 | Only do this if the default value of `enable-multibyte-characters' is | 675 | Only do this if the default value of `enable-multibyte-characters' is |
| 912 | non-nil. This is a no-op in XEmacs." | 676 | non-nil." |
| 913 | (set-buffer-multibyte 'to))) | 677 | (set-buffer-multibyte 'to)) |
| 914 | 678 | ||
| 915 | (if (featurep 'xemacs) | 679 | (defun mm-disable-multibyte () |
| 916 | (defalias 'mm-disable-multibyte 'ignore) | 680 | "Unset the multibyte flag of in the current buffer." |
| 917 | (defun mm-disable-multibyte () | 681 | (set-buffer-multibyte nil)) |
| 918 | "Unset the multibyte flag of in the current buffer. | ||
| 919 | This is a no-op in XEmacs." | ||
| 920 | (set-buffer-multibyte nil)))) | ||
| 921 | 682 | ||
| 922 | (defun mm-preferred-coding-system (charset) | 683 | (defun mm-preferred-coding-system (charset) |
| 923 | ;; A typo in some Emacs versions. | 684 | ;; A typo in some Emacs versions. |
| @@ -951,7 +712,7 @@ If POS is nil, it defaults to the current point. | |||
| 951 | If POS is out of range, the value is nil. | 712 | If POS is out of range, the value is nil. |
| 952 | If the charset is `composition', return the actual one." | 713 | If the charset is `composition', return the actual one." |
| 953 | (let ((char (char-after pos)) charset) | 714 | (let ((char (char-after pos)) charset) |
| 954 | (if (< (mm-char-int char) 128) | 715 | (if (< char 128) |
| 955 | (setq charset 'ascii) | 716 | (setq charset 'ascii) |
| 956 | ;; charset-after is fake in some Emacsen. | 717 | ;; charset-after is fake in some Emacsen. |
| 957 | (setq charset (and (fboundp 'char-charset) (char-charset char))) | 718 | (setq charset (and (fboundp 'char-charset) (char-charset char))) |
| @@ -981,40 +742,11 @@ If the charset is `composition', return the actual one." | |||
| 981 | ;; This is for XEmacs. | 742 | ;; This is for XEmacs. |
| 982 | (mm-mule-charset-to-mime-charset charset))) | 743 | (mm-mule-charset-to-mime-charset charset))) |
| 983 | 744 | ||
| 984 | ;; `delete-dups' is not available in XEmacs 21.4. | ||
| 985 | (if (fboundp 'delete-dups) | ||
| 986 | (defalias 'mm-delete-duplicates 'delete-dups) | ||
| 987 | (defun mm-delete-duplicates (list) | ||
| 988 | "Destructively remove `equal' duplicates from LIST. | ||
| 989 | Store the result in LIST and return it. LIST must be a proper list. | ||
| 990 | Of several `equal' occurrences of an element in LIST, the first | ||
| 991 | one is kept. | ||
| 992 | |||
| 993 | This is a compatibility function for Emacsen without `delete-dups'." | ||
| 994 | ;; Code from `subr.el' in Emacs 22: | ||
| 995 | (let ((tail list)) | ||
| 996 | (while tail | ||
| 997 | (setcdr tail (delete (car tail) (cdr tail))) | ||
| 998 | (setq tail (cdr tail)))) | ||
| 999 | list)) | ||
| 1000 | |||
| 1001 | ;; Fixme: This is used in places when it should be testing the | 745 | ;; Fixme: This is used in places when it should be testing the |
| 1002 | ;; default multibyteness. See mm-default-multibyte-p. | 746 | ;; default multibyteness. |
| 1003 | (eval-and-compile | 747 | (defun mm-multibyte-p () |
| 1004 | (if (and (not (featurep 'xemacs)) | 748 | "Non-nil if multibyte is enabled in the current buffer." |
| 1005 | (boundp 'enable-multibyte-characters)) | 749 | enable-multibyte-characters) |
| 1006 | (defun mm-multibyte-p () | ||
| 1007 | "Non-nil if multibyte is enabled in the current buffer." | ||
| 1008 | enable-multibyte-characters) | ||
| 1009 | (defun mm-multibyte-p () (featurep 'mule)))) | ||
| 1010 | |||
| 1011 | (defun mm-default-multibyte-p () | ||
| 1012 | "Return non-nil if the session is multibyte. | ||
| 1013 | This affects whether coding conversion should be attempted generally." | ||
| 1014 | (if (featurep 'mule) | ||
| 1015 | (if (boundp 'enable-multibyte-characters) | ||
| 1016 | (default-value 'enable-multibyte-characters) | ||
| 1017 | t))) | ||
| 1018 | 750 | ||
| 1019 | (defun mm-iso-8859-x-to-15-region (&optional b e) | 751 | (defun mm-iso-8859-x-to-15-region (&optional b e) |
| 1020 | (if (fboundp 'char-charset) | 752 | (if (fboundp 'char-charset) |
| @@ -1050,85 +782,6 @@ This affects whether coding conversion should be attempted generally." | |||
| 1050 | (length (memq (coding-system-base b) priorities))) | 782 | (length (memq (coding-system-base b) priorities))) |
| 1051 | t)))) | 783 | t)))) |
| 1052 | 784 | ||
| 1053 | (declare-function latin-unity-massage-name "ext:latin-unity") | ||
| 1054 | (declare-function latin-unity-maybe-remap "ext:latin-unity") | ||
| 1055 | (declare-function latin-unity-representations-feasible-region "ext:latin-unity") | ||
| 1056 | (declare-function latin-unity-representations-present-region "ext:latin-unity") | ||
| 1057 | |||
| 1058 | (defvar latin-unity-coding-systems) | ||
| 1059 | (defvar latin-unity-ucs-list) | ||
| 1060 | |||
| 1061 | (defun mm-xemacs-find-mime-charset-1 (begin end) | ||
| 1062 | "Determine which MIME charset to use to send region as message. | ||
| 1063 | This uses the XEmacs-specific latin-unity package to better handle the | ||
| 1064 | case where identical characters from diverse ISO-8859-? character sets | ||
| 1065 | can be encoded using a single one of the corresponding coding systems. | ||
| 1066 | |||
| 1067 | It treats `mm-coding-system-priorities' as the list of preferred | ||
| 1068 | coding systems; a useful example setting for this list in Western | ||
| 1069 | Europe would be (iso-8859-1 iso-8859-15 utf-8), which would default | ||
| 1070 | to the very standard Latin 1 coding system, and only move to coding | ||
| 1071 | systems that are less supported as is necessary to encode the | ||
| 1072 | characters that exist in the buffer. | ||
| 1073 | |||
| 1074 | Latin Unity doesn't know about those non-ASCII Roman characters that | ||
| 1075 | are available in various East Asian character sets. As such, its | ||
| 1076 | behavior if you have a JIS 0212 LATIN SMALL LETTER A WITH ACUTE in a | ||
| 1077 | buffer and it can otherwise be encoded as Latin 1, won't be ideal. | ||
| 1078 | But this is very much a corner case, so don't worry about it." | ||
| 1079 | (let ((systems mm-coding-system-priorities) csets psets curset) | ||
| 1080 | |||
| 1081 | ;; Load the Latin Unity library, if available. | ||
| 1082 | (when (and (not (featurep 'latin-unity)) (locate-library "latin-unity")) | ||
| 1083 | (require 'latin-unity)) | ||
| 1084 | |||
| 1085 | ;; Now, can we use it? | ||
| 1086 | (if (featurep 'latin-unity) | ||
| 1087 | (progn | ||
| 1088 | (setq csets (latin-unity-representations-feasible-region begin end) | ||
| 1089 | psets (latin-unity-representations-present-region begin end)) | ||
| 1090 | |||
| 1091 | (catch 'done | ||
| 1092 | |||
| 1093 | ;; Pass back the first coding system in the preferred list | ||
| 1094 | ;; that can encode the whole region. | ||
| 1095 | (dolist (curset systems) | ||
| 1096 | (setq curset (latin-unity-massage-name 'buffer-default curset)) | ||
| 1097 | |||
| 1098 | ;; If the coding system is a universal coding system, then | ||
| 1099 | ;; it can certainly encode all the characters in the region. | ||
| 1100 | (if (memq curset latin-unity-ucs-list) | ||
| 1101 | (throw 'done (list curset))) | ||
| 1102 | |||
| 1103 | ;; If a coding system isn't universal, and isn't in | ||
| 1104 | ;; the list that latin unity knows about, we can't | ||
| 1105 | ;; decide whether to use it here. Leave that until later | ||
| 1106 | ;; in `mm-find-mime-charset-region' function, whence we | ||
| 1107 | ;; have been called. | ||
| 1108 | (unless (memq curset latin-unity-coding-systems) | ||
| 1109 | (throw 'done nil)) | ||
| 1110 | |||
| 1111 | ;; Right, we know about this coding system, and it may | ||
| 1112 | ;; conceivably be able to encode all the characters in | ||
| 1113 | ;; the region. | ||
| 1114 | (if (latin-unity-maybe-remap begin end curset csets psets t) | ||
| 1115 | (throw 'done (list curset)))) | ||
| 1116 | |||
| 1117 | ;; Can't encode using anything from the | ||
| 1118 | ;; `mm-coding-system-priorities' list. | ||
| 1119 | ;; Leave `mm-find-mime-charset' to do most of the work. | ||
| 1120 | nil)) | ||
| 1121 | |||
| 1122 | ;; Right, latin unity isn't available; let `mm-find-charset-region' | ||
| 1123 | ;; take its default action, which equally applies to GNU Emacs. | ||
| 1124 | nil))) | ||
| 1125 | |||
| 1126 | (defmacro mm-xemacs-find-mime-charset (begin end) | ||
| 1127 | (when (featurep 'xemacs) | ||
| 1128 | `(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end)))) | ||
| 1129 | |||
| 1130 | (declare-function mm-delete-duplicates "mm-util" (list)) | ||
| 1131 | |||
| 1132 | (defun mm-find-mime-charset-region (b e &optional hack-charsets) | 785 | (defun mm-find-mime-charset-region (b e &optional hack-charsets) |
| 1133 | "Return the MIME charsets needed to encode the region between B and E. | 786 | "Return the MIME charsets needed to encode the region between B and E. |
| 1134 | nil means ASCII, a single-element list represents an appropriate MIME | 787 | nil means ASCII, a single-element list represents an appropriate MIME |
| @@ -1170,16 +823,9 @@ charset, and a longer list means no appropriate charset." | |||
| 1170 | (setq systems nil | 823 | (setq systems nil |
| 1171 | charsets (list cs)))))) | 824 | charsets (list cs)))))) |
| 1172 | charsets)) | 825 | charsets)) |
| 1173 | ;; If we're XEmacs, and some coding system is appropriate, | ||
| 1174 | ;; mm-xemacs-find-mime-charset will return an appropriate list. | ||
| 1175 | ;; Otherwise, we'll get nil, and the next setq will get invoked. | ||
| 1176 | (setq charsets (mm-xemacs-find-mime-charset b e)) | ||
| 1177 | |||
| 1178 | ;; Fixme: won't work for unibyte Emacs 23: | ||
| 1179 | |||
| 1180 | ;; We're not multibyte, or a single coding system won't cover it. | 826 | ;; We're not multibyte, or a single coding system won't cover it. |
| 1181 | (setq charsets | 827 | (setq charsets |
| 1182 | (mm-delete-duplicates | 828 | (delete-dups |
| 1183 | (mapcar 'mm-mime-charset | 829 | (mapcar 'mm-mime-charset |
| 1184 | (delq 'ascii | 830 | (delq 'ascii |
| 1185 | (mm-find-charset-region b e)))))) | 831 | (mm-find-charset-region b e)))))) |
| @@ -1192,17 +838,6 @@ charset, and a longer list means no appropriate charset." | |||
| 1192 | (if (and (memq 'iso-2022-jp-2 charsets) | 838 | (if (and (memq 'iso-2022-jp-2 charsets) |
| 1193 | (memq 'iso-2022-jp-2 hack-charsets)) | 839 | (memq 'iso-2022-jp-2 hack-charsets)) |
| 1194 | (setq charsets (delq 'iso-2022-jp charsets))) | 840 | (setq charsets (delq 'iso-2022-jp charsets))) |
| 1195 | ;; Attempt to reduce the number of charsets if utf-8 is available. | ||
| 1196 | (if (and (featurep 'xemacs) | ||
| 1197 | (> (length charsets) 1) | ||
| 1198 | (mm-coding-system-p 'utf-8)) | ||
| 1199 | (let ((mm-coding-system-priorities | ||
| 1200 | (cons 'utf-8 mm-coding-system-priorities))) | ||
| 1201 | (setq charsets | ||
| 1202 | (mm-delete-duplicates | ||
| 1203 | (mapcar 'mm-mime-charset | ||
| 1204 | (delq 'ascii | ||
| 1205 | (mm-find-charset-region b e))))))) | ||
| 1206 | charsets)) | 841 | charsets)) |
| 1207 | 842 | ||
| 1208 | (defmacro mm-with-unibyte-buffer (&rest forms) | 843 | (defmacro mm-with-unibyte-buffer (&rest forms) |
| @@ -1225,7 +860,6 @@ Use multibyte mode for this." | |||
| 1225 | 860 | ||
| 1226 | (defmacro mm-with-unibyte-current-buffer (&rest forms) | 861 | (defmacro mm-with-unibyte-current-buffer (&rest forms) |
| 1227 | "Evaluate FORMS with current buffer temporarily made unibyte. | 862 | "Evaluate FORMS with current buffer temporarily made unibyte. |
| 1228 | Equivalent to `progn' in XEmacs. | ||
| 1229 | 863 | ||
| 1230 | Note: We recommend not using this macro any more; there should be | 864 | Note: We recommend not using this macro any more; there should be |
| 1231 | better ways to do a similar thing. The previous version of this macro | 865 | better ways to do a similar thing. The previous version of this macro |
| @@ -1233,16 +867,14 @@ bound the default value of `enable-multibyte-characters' to nil while | |||
| 1233 | evaluating FORMS but it is no longer done. So, some programs assuming | 867 | evaluating FORMS but it is no longer done. So, some programs assuming |
| 1234 | it if any may malfunction." | 868 | it if any may malfunction." |
| 1235 | (declare (obsolete nil "25.1") (indent 0) (debug t)) | 869 | (declare (obsolete nil "25.1") (indent 0) (debug t)) |
| 1236 | (if (featurep 'xemacs) | 870 | (let ((multibyte (make-symbol "multibyte"))) |
| 1237 | `(progn ,@forms) | 871 | `(let ((,multibyte enable-multibyte-characters)) |
| 1238 | (let ((multibyte (make-symbol "multibyte"))) | 872 | (when ,multibyte |
| 1239 | `(let ((,multibyte enable-multibyte-characters)) | 873 | (set-buffer-multibyte nil)) |
| 874 | (prog1 | ||
| 875 | (progn ,@forms) | ||
| 1240 | (when ,multibyte | 876 | (when ,multibyte |
| 1241 | (set-buffer-multibyte nil)) | 877 | (set-buffer-multibyte t)))))) |
| 1242 | (prog1 | ||
| 1243 | (progn ,@forms) | ||
| 1244 | (when ,multibyte | ||
| 1245 | (set-buffer-multibyte t))))))) | ||
| 1246 | 878 | ||
| 1247 | (defun mm-find-charset-region (b e) | 879 | (defun mm-find-charset-region (b e) |
| 1248 | "Return a list of Emacs charsets in the region B to E." | 880 | "Return a list of Emacs charsets in the region B to E." |
| @@ -1257,7 +889,7 @@ it if any may malfunction." | |||
| 1257 | css) | 889 | css) |
| 1258 | (setq css (delq cs css))))) | 890 | (setq css (delq cs css))))) |
| 1259 | (t | 891 | (t |
| 1260 | ;; We are in a unibyte buffer or XEmacs non-mule, so we futz around a bit. | 892 | ;; We are in a unibyte buffer, so we futz around a bit. |
| 1261 | (save-excursion | 893 | (save-excursion |
| 1262 | (save-restriction | 894 | (save-restriction |
| 1263 | (narrow-to-region b e) | 895 | (narrow-to-region b e) |
| @@ -1363,64 +995,8 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." | |||
| 1363 | inhibit-file-name-handlers))) | 995 | inhibit-file-name-handlers))) |
| 1364 | (write-region start end filename append visit lockname))) | 996 | (write-region start end filename append visit lockname))) |
| 1365 | 997 | ||
| 1366 | ;; It is not a MIME function, but some MIME functions use it. | 998 | (defalias 'mm-make-temp-file 'make-temp-file) |
| 1367 | (if (and (fboundp 'make-temp-file) | 999 | (define-obsolete-function-alias 'mm-make-temp-file 'make-temp-file "25.2") |
| 1368 | (ignore-errors | ||
| 1369 | (let ((def (if (fboundp 'compiled-function-arglist) ;; XEmacs | ||
| 1370 | (eval (list 'compiled-function-arglist | ||
| 1371 | (symbol-function 'make-temp-file))) | ||
| 1372 | (require 'help-fns) | ||
| 1373 | (help-function-arglist 'make-temp-file t)))) | ||
| 1374 | (and (>= (length def) 4) | ||
| 1375 | (eq (nth 3 def) 'suffix))))) | ||
| 1376 | (defalias 'mm-make-temp-file 'make-temp-file) | ||
| 1377 | ;; Stolen (and modified for XEmacs) from Emacs 22. | ||
| 1378 | (defun mm-make-temp-file (prefix &optional dir-flag suffix) | ||
| 1379 | "Create a temporary file. | ||
| 1380 | The returned file name (created by appending some random characters at the end | ||
| 1381 | of PREFIX, and expanding against `temporary-file-directory' if necessary), | ||
| 1382 | is guaranteed to point to a newly created empty file. | ||
| 1383 | You can then use `write-region' to write new data into the file. | ||
| 1384 | |||
| 1385 | If DIR-FLAG is non-nil, create a new empty directory instead of a file. | ||
| 1386 | |||
| 1387 | If SUFFIX is non-nil, add that at the end of the file name." | ||
| 1388 | (let ((umask (default-file-modes)) | ||
| 1389 | file) | ||
| 1390 | (unwind-protect | ||
| 1391 | (progn | ||
| 1392 | ;; Create temp files with strict access rights. It's easy to | ||
| 1393 | ;; loosen them later, whereas it's impossible to close the | ||
| 1394 | ;; time-window of loose permissions otherwise. | ||
| 1395 | (set-default-file-modes 448) | ||
| 1396 | (while (condition-case err | ||
| 1397 | (progn | ||
| 1398 | (setq file | ||
| 1399 | (make-temp-name | ||
| 1400 | (expand-file-name | ||
| 1401 | prefix | ||
| 1402 | (if (fboundp 'temp-directory) | ||
| 1403 | ;; XEmacs | ||
| 1404 | (temp-directory) | ||
| 1405 | temporary-file-directory)))) | ||
| 1406 | (if suffix | ||
| 1407 | (setq file (concat file suffix))) | ||
| 1408 | (if dir-flag | ||
| 1409 | (make-directory file) | ||
| 1410 | (write-region "" nil file nil 'silent nil 'excl)) | ||
| 1411 | nil) | ||
| 1412 | (file-already-exists t) | ||
| 1413 | ;; The XEmacs version of `make-directory' issues | ||
| 1414 | ;; `file-error'. | ||
| 1415 | (file-error (or (and (featurep 'xemacs) | ||
| 1416 | (file-exists-p file)) | ||
| 1417 | (signal (car err) (cdr err))))) | ||
| 1418 | ;; the file was somehow created by someone else between | ||
| 1419 | ;; `make-temp-name' and `write-region', let's try again. | ||
| 1420 | nil) | ||
| 1421 | file) | ||
| 1422 | ;; Reset the umask. | ||
| 1423 | (set-default-file-modes umask))))) | ||
| 1424 | 1000 | ||
| 1425 | (defvar mm-image-load-path-cache nil) | 1001 | (defvar mm-image-load-path-cache nil) |
| 1426 | 1002 | ||
| @@ -1469,26 +1045,11 @@ If SUFFIX is non-nil, add that at the end of the file name." | |||
| 1469 | (let ((cs (mm-detect-coding-region start end))) | 1045 | (let ((cs (mm-detect-coding-region start end))) |
| 1470 | cs))) | 1046 | cs))) |
| 1471 | 1047 | ||
| 1472 | (eval-when-compile | ||
| 1473 | (unless (fboundp 'coding-system-to-mime-charset) | ||
| 1474 | (defalias 'coding-system-to-mime-charset 'ignore))) | ||
| 1475 | |||
| 1476 | (defun mm-coding-system-to-mime-charset (coding-system) | 1048 | (defun mm-coding-system-to-mime-charset (coding-system) |
| 1477 | "Return the MIME charset corresponding to CODING-SYSTEM. | 1049 | "Return the MIME charset corresponding to CODING-SYSTEM." |
| 1478 | To make this function work with XEmacs, the APEL package is required." | ||
| 1479 | (when coding-system | 1050 | (when coding-system |
| 1480 | (or (and (fboundp 'coding-system-get) | 1051 | (or (coding-system-get coding-system :mime-charset) |
| 1481 | (or (coding-system-get coding-system :mime-charset) | 1052 | (coding-system-get coding-system 'mime-charset)))) |
| 1482 | (coding-system-get coding-system 'mime-charset))) | ||
| 1483 | (and (featurep 'xemacs) | ||
| 1484 | (or (and (fboundp 'coding-system-to-mime-charset) | ||
| 1485 | (not (eq (symbol-function 'coding-system-to-mime-charset) | ||
| 1486 | 'ignore))) | ||
| 1487 | (and (condition-case nil | ||
| 1488 | (require 'mcharset) | ||
| 1489 | (error nil)) | ||
| 1490 | (fboundp 'coding-system-to-mime-charset))) | ||
| 1491 | (coding-system-to-mime-charset coding-system))))) | ||
| 1492 | 1053 | ||
| 1493 | (defvar jka-compr-acceptable-retval-list) | 1054 | (defvar jka-compr-acceptable-retval-list) |
| 1494 | (declare-function jka-compr-make-temp-name "jka-compr" (&optional local)) | 1055 | (declare-function jka-compr-make-temp-name "jka-compr" (&optional local)) |
| @@ -1587,66 +1148,16 @@ gzip, bzip2, etc. are allowed." | |||
| 1587 | (setq filename (file-name-sans-extension filename))) | 1148 | (setq filename (file-name-sans-extension filename))) |
| 1588 | (goto-char (point-min)) | 1149 | (goto-char (point-min)) |
| 1589 | (unwind-protect | 1150 | (unwind-protect |
| 1590 | (cond | 1151 | (if filename |
| 1591 | ((boundp 'set-auto-coding-function) ;; Emacs | 1152 | (or (funcall (symbol-value 'set-auto-coding-function) |
| 1592 | (if filename | 1153 | filename (- (point-max) (point-min))) |
| 1593 | (or (funcall (symbol-value 'set-auto-coding-function) | 1154 | (car (find-operation-coding-system 'insert-file-contents |
| 1594 | filename (- (point-max) (point-min))) | 1155 | filename))) |
| 1595 | (car (find-operation-coding-system 'insert-file-contents | 1156 | (let (auto-coding-alist) |
| 1596 | filename))) | 1157 | (condition-case nil |
| 1597 | (let (auto-coding-alist) | 1158 | (funcall (symbol-value 'set-auto-coding-function) |
| 1598 | (condition-case nil | 1159 | nil (- (point-max) (point-min))) |
| 1599 | (funcall (symbol-value 'set-auto-coding-function) | 1160 | (error nil)))) |
| 1600 | nil (- (point-max) (point-min))) | ||
| 1601 | (error nil))))) | ||
| 1602 | ((and (featurep 'xemacs) (featurep 'file-coding)) ;; XEmacs | ||
| 1603 | (let ((case-fold-search t) | ||
| 1604 | (end (point-at-eol)) | ||
| 1605 | codesys start) | ||
| 1606 | (or | ||
| 1607 | (and (re-search-forward "-\\*-+[\t ]*" end t) | ||
| 1608 | (progn | ||
| 1609 | (setq start (match-end 0)) | ||
| 1610 | (re-search-forward "[\t ]*-+\\*-" end t)) | ||
| 1611 | (progn | ||
| 1612 | (setq end (match-beginning 0)) | ||
| 1613 | (goto-char start) | ||
| 1614 | (or (looking-at "coding:[\t ]*\\([^\t ;]+\\)") | ||
| 1615 | (re-search-forward | ||
| 1616 | "[\t ;]+coding:[\t ]*\\([^\t ;]+\\)" | ||
| 1617 | end t))) | ||
| 1618 | (find-coding-system (setq codesys | ||
| 1619 | (intern (match-string 1)))) | ||
| 1620 | codesys) | ||
| 1621 | (and (re-search-forward "^[\t ]*;+[\t ]*Local[\t ]+Variables:" | ||
| 1622 | nil t) | ||
| 1623 | (progn | ||
| 1624 | (setq start (match-end 0)) | ||
| 1625 | (re-search-forward "^[\t ]*;+[\t ]*End:" nil t)) | ||
| 1626 | (progn | ||
| 1627 | (setq end (match-beginning 0)) | ||
| 1628 | (goto-char start) | ||
| 1629 | (re-search-forward | ||
| 1630 | "^[\t ]*;+[\t ]*coding:[\t ]*\\([^\t\n\r ]+\\)" | ||
| 1631 | end t)) | ||
| 1632 | (find-coding-system (setq codesys | ||
| 1633 | (intern (match-string 1)))) | ||
| 1634 | codesys) | ||
| 1635 | (and (progn | ||
| 1636 | (goto-char (point-min)) | ||
| 1637 | (setq case-fold-search nil) | ||
| 1638 | (re-search-forward "^;;;coding system: " | ||
| 1639 | ;;(+ (point-min) 3000) t)) | ||
| 1640 | nil t)) | ||
| 1641 | (looking-at "[^\t\n\r ]+") | ||
| 1642 | (find-coding-system | ||
| 1643 | (setq codesys (intern (match-string 0)))) | ||
| 1644 | codesys) | ||
| 1645 | (and filename | ||
| 1646 | (setq codesys | ||
| 1647 | (find-file-coding-system-for-read-from-filename | ||
| 1648 | filename)) | ||
| 1649 | (coding-system-name (coding-system-base codesys))))))) | ||
| 1650 | (when decomp | 1161 | (when decomp |
| 1651 | (kill-buffer (current-buffer))))))) | 1162 | (kill-buffer (current-buffer))))))) |
| 1652 | 1163 | ||
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index a5b06b2699f..2fa856cc1ef 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el | |||
| @@ -587,11 +587,11 @@ apply the face `mm-uu-extract'." | |||
| 587 | (not (eq charset 'ascii))) | 587 | (not (eq charset 'ascii))) |
| 588 | ;; Assume that buffer's multibyteness is turned off. | 588 | ;; Assume that buffer's multibyteness is turned off. |
| 589 | ;; See `mml2015-pgg-clear-decrypt'. | 589 | ;; See `mml2015-pgg-clear-decrypt'. |
| 590 | (insert (mm-decode-coding-string (prog1 | 590 | (insert (decode-coding-string (prog1 |
| 591 | (buffer-string) | 591 | (buffer-string) |
| 592 | (erase-buffer) | 592 | (erase-buffer) |
| 593 | (mm-enable-multibyte)) | 593 | (mm-enable-multibyte)) |
| 594 | charset)) | 594 | charset)) |
| 595 | (mm-enable-multibyte)) | 595 | (mm-enable-multibyte)) |
| 596 | (list (mm-make-handle buf mm-uu-text-plain-type))) | 596 | (list (mm-make-handle buf mm-uu-text-plain-type))) |
| 597 | (list (mm-make-handle buf '("application/pgp-encrypted"))))))) | 597 | (list (mm-make-handle buf '("application/pgp-encrypted"))))))) |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index ed163135f9c..d8da137e0dc 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -230,7 +230,7 @@ | |||
| 230 | ((condition-case nil | 230 | ((condition-case nil |
| 231 | (let ((coding-system-for-write 'iso-2022-jp) | 231 | (let ((coding-system-for-write 'iso-2022-jp) |
| 232 | (coding-system-for-read 'iso-2022-jp) | 232 | (coding-system-for-read 'iso-2022-jp) |
| 233 | (str (mm-decode-coding-string "\ | 233 | (str (decode-coding-string "\ |
| 234 | \e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t!!#m#1#7#n!)\e(B" 'iso-2022-jp))) | 234 | \e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t!!#m#1#7#n!)\e(B" 'iso-2022-jp))) |
| 235 | (mm-with-multibyte-buffer | 235 | (mm-with-multibyte-buffer |
| 236 | (insert str) | 236 | (insert str) |
| @@ -282,7 +282,7 @@ | |||
| 282 | (delete-region (match-beginning 0) (match-end 0)))) | 282 | (delete-region (match-beginning 0) (match-end 0)))) |
| 283 | 283 | ||
| 284 | (defun mm-inline-wash-with-file (post-func cmd &rest args) | 284 | (defun mm-inline-wash-with-file (post-func cmd &rest args) |
| 285 | (let ((file (mm-make-temp-file | 285 | (let ((file (make-temp-file |
| 286 | (expand-file-name "mm" mm-tmp-directory)))) | 286 | (expand-file-name "mm" mm-tmp-directory)))) |
| 287 | (let ((coding-system-for-write 'binary)) | 287 | (let ((coding-system-for-write 'binary)) |
| 288 | (write-region (point-min) (point-max) file nil 'silent)) | 288 | (write-region (point-min) (point-max) file nil 'silent)) |
| @@ -496,7 +496,7 @@ If MODE is not set, try to find mode automatically." | |||
| 496 | (with-current-buffer (mm-handle-buffer handle) | 496 | (with-current-buffer (mm-handle-buffer handle) |
| 497 | (buffer-string))) | 497 | (buffer-string))) |
| 498 | (coding-system | 498 | (coding-system |
| 499 | (mm-decode-coding-string text coding-system)) | 499 | (decode-coding-string text coding-system)) |
| 500 | (charset | 500 | (charset |
| 501 | (mm-decode-string text charset)) | 501 | (mm-decode-string text charset)) |
| 502 | (t | 502 | (t |
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 3ac3da0127d..5bfed9fb254 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el | |||
| @@ -947,8 +947,9 @@ If no one is selected, symmetric encryption will be performed. " | |||
| 947 | (if (eq 'OpenPGP protocol) | 947 | (if (eq 'OpenPGP protocol) |
| 948 | (epg-sign-string context (buffer-string) mode) | 948 | (epg-sign-string context (buffer-string) mode) |
| 949 | (epg-sign-string context | 949 | (epg-sign-string context |
| 950 | (mm-replace-in-string (buffer-string) | 950 | (replace-regexp-in-string (buffer-string) |
| 951 | "\n" "\r\n") t)) | 951 | "\n" "\r\n") |
| 952 | t)) | ||
| 952 | mml-secure-secret-key-id-list nil) | 953 | mml-secure-secret-key-id-list nil) |
| 953 | (error | 954 | (error |
| 954 | (mml-secure-clear-secret-key-id-list) | 955 | (mml-secure-clear-secret-key-id-list) |
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 407963fdb8a..02be62e6038 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el | |||
| @@ -425,7 +425,7 @@ Content-Disposition: attachment; filename=smime.p7m | |||
| 425 | (mm-set-handle-multipart-parameter | 425 | (mm-set-handle-multipart-parameter |
| 426 | mm-security-handle 'gnus-info "Corrupted") | 426 | mm-security-handle 'gnus-info "Corrupted") |
| 427 | (throw 'error handle)) | 427 | (throw 'error handle)) |
| 428 | (setq part (mm-replace-in-string part "\n" "\r\n") | 428 | (setq part (replace-regexp-in-string part "\n" "\r\n") |
| 429 | context (epg-make-context 'CMS)) | 429 | context (epg-make-context 'CMS)) |
| 430 | (condition-case error | 430 | (condition-case error |
| 431 | (setq plain (epg-verify-string context (mm-get-part signature) part)) | 431 | (setq plain (epg-verify-string context (mm-get-part signature) part)) |
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index ac84fbf02d7..c4cb7635a56 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el | |||
| @@ -643,7 +643,7 @@ be \"related\" or \"alternate\"." | |||
| 643 | (mm-with-unibyte-buffer | 643 | (mm-with-unibyte-buffer |
| 644 | (cond | 644 | (cond |
| 645 | ((cdr (assq 'buffer cont)) | 645 | ((cdr (assq 'buffer cont)) |
| 646 | (insert (mm-string-as-unibyte | 646 | (insert (string-as-unibyte |
| 647 | (with-current-buffer (cdr (assq 'buffer cont)) | 647 | (with-current-buffer (cdr (assq 'buffer cont)) |
| 648 | (buffer-string))))) | 648 | (buffer-string))))) |
| 649 | ((and filename | 649 | ((and filename |
| @@ -658,7 +658,7 @@ be \"related\" or \"alternate\"." | |||
| 658 | (let ((contents (cdr (assq 'contents cont)))) | 658 | (let ((contents (cdr (assq 'contents cont)))) |
| 659 | (if (if (featurep 'xemacs) | 659 | (if (if (featurep 'xemacs) |
| 660 | (string-match "[^\000-\377]" contents) | 660 | (string-match "[^\000-\377]" contents) |
| 661 | (mm-multibyte-string-p contents)) | 661 | (multibyte-string-p contents)) |
| 662 | (progn | 662 | (progn |
| 663 | (mm-enable-multibyte) | 663 | (mm-enable-multibyte) |
| 664 | (insert contents) | 664 | (insert contents) |
| @@ -1377,7 +1377,7 @@ body) or \"attachment\" (separate from the body)." | |||
| 1377 | 'type type | 1377 | 'type type |
| 1378 | ;; icicles redefines read-file-name and returns a | 1378 | ;; icicles redefines read-file-name and returns a |
| 1379 | ;; string w/ text properties :-/ | 1379 | ;; string w/ text properties :-/ |
| 1380 | 'filename (mm-substring-no-properties file) | 1380 | 'filename (substring-no-properties file) |
| 1381 | 'disposition (or disposition "attachment") | 1381 | 'disposition (or disposition "attachment") |
| 1382 | 'description description) | 1382 | 'description description) |
| 1383 | ;; When using Mail mode, make sure it does the mime encoding | 1383 | ;; When using Mail mode, make sure it does the mime encoding |
| @@ -1606,7 +1606,7 @@ or the `pop-to-buffer' function." | |||
| 1606 | ;; FIXME: Buffer is in article mode, but most tool bar commands won't | 1606 | ;; FIXME: Buffer is in article mode, but most tool bar commands won't |
| 1607 | ;; work. Maybe only keep the following icons: search, print, quit | 1607 | ;; work. Maybe only keep the following icons: search, print, quit |
| 1608 | (goto-char (point-min)))) | 1608 | (goto-char (point-min)))) |
| 1609 | (if (and (not (mm-special-display-p (buffer-name mml-preview-buffer))) | 1609 | (if (and (not (special-display-p (buffer-name mml-preview-buffer))) |
| 1610 | (boundp 'gnus-buffer-configuration) | 1610 | (boundp 'gnus-buffer-configuration) |
| 1611 | (assq 'mml-preview gnus-buffer-configuration)) | 1611 | (assq 'mml-preview gnus-buffer-configuration)) |
| 1612 | (let ((gnus-message-buffer (current-buffer))) | 1612 | (let ((gnus-message-buffer (current-buffer))) |
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 0125ddbcc2a..60fddedf899 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el | |||
| @@ -619,7 +619,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 619 | (insert "\r")) | 619 | (insert "\r")) |
| 620 | (forward-line) | 620 | (forward-line) |
| 621 | (end-of-line)) | 621 | (end-of-line)) |
| 622 | (with-temp-file (setq signature-file (mm-make-temp-file "pgg")) | 622 | (with-temp-file (setq signature-file (make-temp-file "pgg")) |
| 623 | (mm-insert-part signature)) | 623 | (mm-insert-part signature)) |
| 624 | (if (condition-case err | 624 | (if (condition-case err |
| 625 | (prog1 | 625 | (prog1 |
| @@ -660,7 +660,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 660 | (if (condition-case err | 660 | (if (condition-case err |
| 661 | (prog1 | 661 | (prog1 |
| 662 | (mm-with-unibyte-buffer | 662 | (mm-with-unibyte-buffer |
| 663 | (insert (mm-encode-coding-string text coding-system)) | 663 | (insert (encode-coding-string text coding-system)) |
| 664 | (pgg-verify-region (point-min) (point-max) nil t)) | 664 | (pgg-verify-region (point-min) (point-max) nil t)) |
| 665 | (goto-char (point-min)) | 665 | (goto-char (point-min)) |
| 666 | (while (search-forward "\r\n" nil t) | 666 | (while (search-forward "\r\n" nil t) |
| @@ -783,7 +783,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 783 | (defun mml2015-epg-key-image (key-id) | 783 | (defun mml2015-epg-key-image (key-id) |
| 784 | "Return the image of a key, if any" | 784 | "Return the image of a key, if any" |
| 785 | (with-temp-buffer | 785 | (with-temp-buffer |
| 786 | (mm-set-buffer-multibyte nil) | 786 | (set-buffer-multibyte nil) |
| 787 | (let* ((coding-system-for-write 'binary) | 787 | (let* ((coding-system-for-write 'binary) |
| 788 | (coding-system-for-read 'binary) | 788 | (coding-system-for-read 'binary) |
| 789 | (data (shell-command-to-string | 789 | (data (shell-command-to-string |
| @@ -923,7 +923,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 923 | (mm-set-handle-multipart-parameter | 923 | (mm-set-handle-multipart-parameter |
| 924 | mm-security-handle 'gnus-info "Corrupted") | 924 | mm-security-handle 'gnus-info "Corrupted") |
| 925 | (throw 'error handle)) | 925 | (throw 'error handle)) |
| 926 | (setq part (mm-replace-in-string part "\n" "\r\n") | 926 | (setq part (replace-regexp-in-string part "\n" "\r\n") |
| 927 | signature (mm-get-part signature) | 927 | signature (mm-get-part signature) |
| 928 | context (epg-make-context)) | 928 | context (epg-make-context)) |
| 929 | (condition-case error | 929 | (condition-case error |
| @@ -946,8 +946,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 946 | (defun mml2015-epg-clear-verify () | 946 | (defun mml2015-epg-clear-verify () |
| 947 | (let ((inhibit-redisplay t) | 947 | (let ((inhibit-redisplay t) |
| 948 | (context (epg-make-context)) | 948 | (context (epg-make-context)) |
| 949 | (signature (mm-encode-coding-string (buffer-string) | 949 | (signature (encode-coding-string (buffer-string) |
| 950 | coding-system-for-write)) | 950 | coding-system-for-write)) |
| 951 | plain) | 951 | plain) |
| 952 | (condition-case error | 952 | (condition-case error |
| 953 | (setq plain (epg-verify-string context signature)) | 953 | (setq plain (epg-verify-string context signature)) |
| @@ -966,7 +966,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 966 | (mml2015-epg-verify-result-to-string | 966 | (mml2015-epg-verify-result-to-string |
| 967 | (epg-context-result-for context 'verify))) | 967 | (epg-context-result-for context 'verify))) |
| 968 | (delete-region (point-min) (point-max)) | 968 | (delete-region (point-min) (point-max)) |
| 969 | (insert (mm-decode-coding-string plain coding-system-for-read))) | 969 | (insert (decode-coding-string plain coding-system-for-read))) |
| 970 | (mml2015-extract-cleartext-signature)))) | 970 | (mml2015-extract-cleartext-signature)))) |
| 971 | 971 | ||
| 972 | (defun mml2015-epg-sign (cont) | 972 | (defun mml2015-epg-sign (cont) |
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el index f8fefeb4ae1..09260cf33d1 100644 --- a/lisp/gnus/nndoc.el +++ b/lisp/gnus/nndoc.el | |||
| @@ -761,7 +761,7 @@ from the document.") | |||
| 761 | (looking-at "JMF")) | 761 | (looking-at "JMF")) |
| 762 | 762 | ||
| 763 | (defun nndoc-oe-dbx-type-p () | 763 | (defun nndoc-oe-dbx-type-p () |
| 764 | (looking-at (mm-string-to-multibyte "\317\255\022\376"))) | 764 | (looking-at (string-to-multibyte "\317\255\022\376"))) |
| 765 | 765 | ||
| 766 | (defun nndoc-read-little-endian () | 766 | (defun nndoc-read-little-endian () |
| 767 | (+ (prog1 (char-after) (forward-char 1)) | 767 | (+ (prog1 (char-after) (forward-char 1)) |
diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el index e60a4920626..28561c05946 100644 --- a/lisp/gnus/nneething.el +++ b/lisp/gnus/nneething.el | |||
| @@ -284,7 +284,7 @@ included.") | |||
| 284 | (defun nneething-encode-file-name (file &optional coding-system) | 284 | (defun nneething-encode-file-name (file &optional coding-system) |
| 285 | "Encode the name of the FILE in CODING-SYSTEM." | 285 | "Encode the name of the FILE in CODING-SYSTEM." |
| 286 | (let ((pos 0) buf) | 286 | (let ((pos 0) buf) |
| 287 | (setq file (mm-encode-coding-string | 287 | (setq file (encode-coding-string |
| 288 | file (or coding-system nnmail-pathname-coding-system))) | 288 | file (or coding-system nnmail-pathname-coding-system))) |
| 289 | (while (string-match "[^-0-9a-zA-Z_:/.]" file pos) | 289 | (while (string-match "[^-0-9a-zA-Z_:/.]" file pos) |
| 290 | (setq buf (cons (format "%%%02x" (aref file (match-beginning 0))) | 290 | (setq buf (cons (format "%%%02x" (aref file (match-beginning 0))) |
| @@ -300,7 +300,7 @@ included.") | |||
| 300 | (setq buf (cons (string (string-to-number (match-string 1 file) 16)) | 300 | (setq buf (cons (string (string-to-number (match-string 1 file) 16)) |
| 301 | (cons (substring file pos (match-beginning 0)) buf)) | 301 | (cons (substring file pos (match-beginning 0)) buf)) |
| 302 | pos (match-end 0))) | 302 | pos (match-end 0))) |
| 303 | (mm-decode-coding-string | 303 | (decode-coding-string |
| 304 | (apply (function concat) | 304 | (apply (function concat) |
| 305 | (nreverse (cons (substring file pos) buf))) | 305 | (nreverse (cons (substring file pos) buf))) |
| 306 | (or coding-system nnmail-pathname-coding-system)))) | 306 | (or coding-system nnmail-pathname-coding-system)))) |
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index ee60e3e18f2..ff020557494 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el | |||
| @@ -1061,7 +1061,7 @@ This command does not work if you use short group names." | |||
| 1061 | (defun nnfolder-group-pathname (group) | 1061 | (defun nnfolder-group-pathname (group) |
| 1062 | "Make file name for GROUP." | 1062 | "Make file name for GROUP." |
| 1063 | (setq group | 1063 | (setq group |
| 1064 | (mm-encode-coding-string group nnmail-pathname-coding-system)) | 1064 | (encode-coding-string group nnmail-pathname-coding-system)) |
| 1065 | (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory)))) | 1065 | (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory)))) |
| 1066 | ;; If this file exists, we use it directly. | 1066 | ;; If this file exists, we use it directly. |
| 1067 | (if (or nnmail-use-long-file-names | 1067 | (if (or nnmail-use-long-file-names |
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index cd43016014e..c8c95f00117 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el | |||
| @@ -621,8 +621,8 @@ the line could be found." | |||
| 621 | (< beg nnheader-max-head-length)))) | 621 | (< beg nnheader-max-head-length)))) |
| 622 | ;; Finally decode the contents. | 622 | ;; Finally decode the contents. |
| 623 | (when (mm-coding-system-p nnheader-file-coding-system) | 623 | (when (mm-coding-system-p nnheader-file-coding-system) |
| 624 | (mm-decode-coding-region start (point-max) | 624 | (decode-coding-region start (point-max) |
| 625 | nnheader-file-coding-system)))) | 625 | nnheader-file-coding-system)))) |
| 626 | t)) | 626 | t)) |
| 627 | 627 | ||
| 628 | (defun nnheader-article-p () | 628 | (defun nnheader-article-p () |
| @@ -842,7 +842,7 @@ without formatting." | |||
| 842 | t)) | 842 | t)) |
| 843 | 843 | ||
| 844 | (defsubst nnheader-replace-chars-in-string (string from to) | 844 | (defsubst nnheader-replace-chars-in-string (string from to) |
| 845 | (mm-subst-char-in-string from to string)) | 845 | (subst-char-in-string from to string)) |
| 846 | 846 | ||
| 847 | (defun nnheader-replace-duplicate-chars-in-string (string from to) | 847 | (defun nnheader-replace-duplicate-chars-in-string (string from to) |
| 848 | "Replace characters in STRING from FROM to TO." | 848 | "Replace characters in STRING from FROM to TO." |
| @@ -898,7 +898,7 @@ without formatting." | |||
| 898 | (if (file-directory-p (concat dir group)) | 898 | (if (file-directory-p (concat dir group)) |
| 899 | (expand-file-name group dir) | 899 | (expand-file-name group dir) |
| 900 | ;; If not, we translate dots into slashes. | 900 | ;; If not, we translate dots into slashes. |
| 901 | (expand-file-name (mm-encode-coding-string | 901 | (expand-file-name (encode-coding-string |
| 902 | (nnheader-replace-chars-in-string group ?. ?/) | 902 | (nnheader-replace-chars-in-string group ?. ?/) |
| 903 | nnheader-pathname-coding-system) | 903 | nnheader-pathname-coding-system) |
| 904 | dir)))) | 904 | dir)))) |
| @@ -1102,7 +1102,7 @@ See `find-file-noselect' for the arguments." | |||
| 1102 | `(insert-buffer-substring ,buffer ,start ,end) | 1102 | `(insert-buffer-substring ,buffer ,start ,end) |
| 1103 | `(if enable-multibyte-characters | 1103 | `(if enable-multibyte-characters |
| 1104 | (insert (with-current-buffer ,buffer | 1104 | (insert (with-current-buffer ,buffer |
| 1105 | (mm-string-to-multibyte | 1105 | (string-to-multibyte |
| 1106 | ,(if (or start end) | 1106 | ,(if (or start end) |
| 1107 | `(buffer-substring (or ,start (point-min)) | 1107 | `(buffer-substring (or ,start (point-min)) |
| 1108 | (or ,end (point-max))) | 1108 | (or ,end (point-max))) |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 130658cd367..7ad7b7ea4c5 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -234,7 +234,7 @@ textual parts.") | |||
| 234 | (delete-region (+ (match-beginning 0) 2) (point)) | 234 | (delete-region (+ (match-beginning 0) 2) (point)) |
| 235 | (setq string (buffer-substring (point) (+ (point) size))) | 235 | (setq string (buffer-substring (point) (+ (point) size))) |
| 236 | (delete-region (point) (+ (point) size)) | 236 | (delete-region (point) (+ (point) size)) |
| 237 | (insert (format "%S" (mm-subst-char-in-string ?\n ?\s string)))) | 237 | (insert (format "%S" (subst-char-in-string ?\n ?\s string)))) |
| 238 | (beginning-of-line) | 238 | (beginning-of-line) |
| 239 | (setq article | 239 | (setq article |
| 240 | (and (re-search-forward "UID \\([0-9]+\\)" (line-end-position) | 240 | (and (re-search-forward "UID \\([0-9]+\\)" (line-end-position) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 783d1b93038..09fd7b3c264 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -1689,7 +1689,7 @@ actually)." | |||
| 1689 | `(("query" . ,search) | 1689 | `(("query" . ,search) |
| 1690 | ("HITSPERPAGE" . "999"))))) | 1690 | ("HITSPERPAGE" . "999"))))) |
| 1691 | (unless (featurep 'xemacs) (set-buffer-multibyte t)) | 1691 | (unless (featurep 'xemacs) (set-buffer-multibyte t)) |
| 1692 | (mm-decode-coding-region (point-min) (point-max) 'utf-8) | 1692 | (decode-coding-region (point-min) (point-max) 'utf-8) |
| 1693 | (goto-char (point-min)) | 1693 | (goto-char (point-min)) |
| 1694 | (forward-line 1) | 1694 | (forward-line 1) |
| 1695 | (while (not (eobp)) | 1695 | (while (not (eobp)) |
| @@ -1705,7 +1705,7 @@ actually)." | |||
| 1705 | (string-to-number (match-string 2 xref)) xscore) | 1705 | (string-to-number (match-string 2 xref)) xscore) |
| 1706 | artlist))))) | 1706 | artlist))))) |
| 1707 | (forward-line 1))) | 1707 | (forward-line 1))) |
| 1708 | (apply 'vector (nreverse (mm-delete-duplicates artlist))))) | 1708 | (apply 'vector (nreverse (delete-dups artlist))))) |
| 1709 | 1709 | ||
| 1710 | ;;; Util Code: | 1710 | ;;; Util Code: |
| 1711 | 1711 | ||
| @@ -1814,18 +1814,19 @@ article came from is also searched." | |||
| 1814 | (if (eq (car method) 'nntp) | 1814 | (if (eq (car method) 'nntp) |
| 1815 | (while (not (eobp)) | 1815 | (while (not (eobp)) |
| 1816 | (ignore-errors | 1816 | (ignore-errors |
| 1817 | (push (mm-string-as-unibyte | 1817 | (push (string-as-unibyte |
| 1818 | (gnus-group-full-name | 1818 | (gnus-group-full-name |
| 1819 | (buffer-substring | 1819 | (buffer-substring |
| 1820 | (point) | 1820 | (point) |
| 1821 | (progn | 1821 | (progn |
| 1822 | (skip-chars-forward "^ \t") | 1822 | (skip-chars-forward "^ \t") |
| 1823 | (point))) method)) | 1823 | (point))) |
| 1824 | method)) | ||
| 1824 | groups)) | 1825 | groups)) |
| 1825 | (forward-line)) | 1826 | (forward-line)) |
| 1826 | (while (not (eobp)) | 1827 | (while (not (eobp)) |
| 1827 | (ignore-errors | 1828 | (ignore-errors |
| 1828 | (push (mm-string-as-unibyte | 1829 | (push (string-as-unibyte |
| 1829 | (if (eq (char-after) ?\") | 1830 | (if (eq (char-after) ?\") |
| 1830 | (gnus-group-full-name (read cur) method) | 1831 | (gnus-group-full-name (read cur) method) |
| 1831 | (let ((p (point)) (name "")) | 1832 | (let ((p (point)) (name "")) |
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 3d4178d1022..625b41794ad 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el | |||
| @@ -697,7 +697,7 @@ nn*-request-list should have been called before calling this function." | |||
| 697 | (setq group (symbol-name group))) | 697 | (setq group (symbol-name group))) |
| 698 | (if (and (numberp (setq max (read buffer))) | 698 | (if (and (numberp (setq max (read buffer))) |
| 699 | (numberp (setq min (read buffer)))) | 699 | (numberp (setq min (read buffer)))) |
| 700 | (push (list (mm-string-as-unibyte group) (cons min max)) | 700 | (push (list (string-as-unibyte group) (cons min max)) |
| 701 | group-assoc))) | 701 | group-assoc))) |
| 702 | (error nil)) | 702 | (error nil)) |
| 703 | (widen) | 703 | (widen) |
| @@ -1173,7 +1173,7 @@ FUNC will be called with the group name to determine the article number." | |||
| 1173 | 5 "Error in `nnmail-split-methods'; using `bogus' mail group: %S" error-info) | 1173 | 5 "Error in `nnmail-split-methods'; using `bogus' mail group: %S" error-info) |
| 1174 | (sit-for 1) | 1174 | (sit-for 1) |
| 1175 | '("bogus"))))) | 1175 | '("bogus"))))) |
| 1176 | (setq split (mm-delete-duplicates split)) | 1176 | (setq split (delete-dups split)) |
| 1177 | ;; The article may be "cross-posted" to `junk'. What | 1177 | ;; The article may be "cross-posted" to `junk'. What |
| 1178 | ;; to do? Just remove the `junk' spec. Don't really | 1178 | ;; to do? Just remove the `junk' spec. Don't really |
| 1179 | ;; see anything else to do... | 1179 | ;; see anything else to do... |
| @@ -1281,7 +1281,7 @@ Return the number of characters in the body." | |||
| 1281 | (insert (if (mm-multibyte-p) | 1281 | (insert (if (mm-multibyte-p) |
| 1282 | (mm-string-as-multibyte | 1282 | (mm-string-as-multibyte |
| 1283 | (format " %s:%d" (caar group-alist) (cdar group-alist))) | 1283 | (format " %s:%d" (caar group-alist) (cdar group-alist))) |
| 1284 | (mm-string-as-unibyte | 1284 | (string-as-unibyte |
| 1285 | (format " %s:%d" (caar group-alist) (cdar group-alist))))) | 1285 | (format " %s:%d" (caar group-alist) (cdar group-alist))))) |
| 1286 | (setq group-alist (cdr group-alist))) | 1286 | (setq group-alist (cdr group-alist))) |
| 1287 | (insert "\n"))) | 1287 | (insert "\n"))) |
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el index c60e84567f7..51048bb2998 100644 --- a/lisp/gnus/nnmh.el +++ b/lisp/gnus/nnmh.el | |||
| @@ -242,8 +242,8 @@ as unread by Gnus.") | |||
| 242 | (file-truename (file-name-as-directory | 242 | (file-truename (file-name-as-directory |
| 243 | (expand-file-name nnmh-toplev)))) | 243 | (expand-file-name nnmh-toplev)))) |
| 244 | dir) | 244 | dir) |
| 245 | (mm-string-to-multibyte ;Why? Isn't it multibyte already? | 245 | (string-to-multibyte ;Why? Isn't it multibyte already? |
| 246 | (mm-encode-coding-string | 246 | (encode-coding-string |
| 247 | (nnheader-replace-chars-in-string | 247 | (nnheader-replace-chars-in-string |
| 248 | (substring dir (match-end 0)) | 248 | (substring dir (match-end 0)) |
| 249 | ?/ ?.) | 249 | ?/ ?.) |
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 28dcd9aad4a..5b471e8d736 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el | |||
| @@ -128,13 +128,13 @@ non-nil.") | |||
| 128 | "Return a decoded group name of GROUP on SERVER-OR-METHOD." | 128 | "Return a decoded group name of GROUP on SERVER-OR-METHOD." |
| 129 | (if nnmail-group-names-not-encoded-p | 129 | (if nnmail-group-names-not-encoded-p |
| 130 | group | 130 | group |
| 131 | (mm-decode-coding-string | 131 | (decode-coding-string |
| 132 | group | 132 | group |
| 133 | (nnml-group-name-charset group server-or-method)))) | 133 | (nnml-group-name-charset group server-or-method)))) |
| 134 | 134 | ||
| 135 | (defun nnml-encoded-group-name (group &optional server-or-method) | 135 | (defun nnml-encoded-group-name (group &optional server-or-method) |
| 136 | "Return an encoded group name of GROUP on SERVER-OR-METHOD." | 136 | "Return an encoded group name of GROUP on SERVER-OR-METHOD." |
| 137 | (mm-encode-coding-string | 137 | (encode-coding-string |
| 138 | group | 138 | group |
| 139 | (nnml-group-name-charset group server-or-method))) | 139 | (nnml-group-name-charset group server-or-method))) |
| 140 | 140 | ||
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 857c58a478e..57c3af08163 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el | |||
| @@ -115,7 +115,7 @@ for decoding when the cdr that the data specify is not available.") | |||
| 115 | 115 | ||
| 116 | (defun nnrss-decode-group-name (group) | 116 | (defun nnrss-decode-group-name (group) |
| 117 | (if (and group (mm-coding-system-p 'utf-8)) | 117 | (if (and group (mm-coding-system-p 'utf-8)) |
| 118 | (setq group (mm-decode-coding-string group 'utf-8)) | 118 | (setq group (decode-coding-string group 'utf-8)) |
| 119 | group)) | 119 | group)) |
| 120 | 120 | ||
| 121 | (deffoo nnrss-retrieve-headers (articles &optional group server fetch-old) | 121 | (deffoo nnrss-retrieve-headers (articles &optional group server fetch-old) |
| @@ -412,7 +412,7 @@ otherwise return nil." | |||
| 412 | ;; Decode text according to the encoding attribute. | 412 | ;; Decode text according to the encoding attribute. |
| 413 | (when (setq cs (nnrss-get-encoding)) | 413 | (when (setq cs (nnrss-get-encoding)) |
| 414 | (insert (prog1 | 414 | (insert (prog1 |
| 415 | (mm-decode-coding-string (buffer-string) cs) | 415 | (decode-coding-string (buffer-string) cs) |
| 416 | (erase-buffer) | 416 | (erase-buffer) |
| 417 | (mm-enable-multibyte)))) | 417 | (mm-enable-multibyte)))) |
| 418 | (goto-char (point-min)) | 418 | (goto-char (point-min)) |
| @@ -758,7 +758,7 @@ Read the file and attempt to subscribe to each Feed in the file." | |||
| 758 | Export subscriptions to a buffer in OPML Format." | 758 | Export subscriptions to a buffer in OPML Format." |
| 759 | (interactive) | 759 | (interactive) |
| 760 | (with-current-buffer (get-buffer-create "*OPML Export*") | 760 | (with-current-buffer (get-buffer-create "*OPML Export*") |
| 761 | (mm-set-buffer-file-coding-system 'utf-8) | 761 | (set-buffer-file-coding-system 'utf-8) |
| 762 | (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" | 762 | (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" |
| 763 | "<!-- OPML generated by Emacs Gnus' nnrss.el -->\n" | 763 | "<!-- OPML generated by Emacs Gnus' nnrss.el -->\n" |
| 764 | "<opml version=\"1.1\">\n" | 764 | "<opml version=\"1.1\">\n" |
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index f56b04568c8..d339cb2bca9 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el | |||
| @@ -350,7 +350,7 @@ retried once before actually displaying the error report." | |||
| 350 | (with-current-buffer ,buffer | 350 | (with-current-buffer ,buffer |
| 351 | (erase-buffer) | 351 | (erase-buffer) |
| 352 | (insert (if enable-multibyte-characters | 352 | (insert (if enable-multibyte-characters |
| 353 | (mm-string-to-multibyte string) | 353 | (string-to-multibyte string) |
| 354 | string)) | 354 | string)) |
| 355 | (goto-char (point-min)) | 355 | (goto-char (point-min)) |
| 356 | nil)))) | 356 | nil)))) |
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 925f65f8dda..347a91d392e 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el | |||
| @@ -514,7 +514,7 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 514 | )))) | 514 | )))) |
| 515 | (setq buffer-file-name nil) | 515 | (setq buffer-file-name nil) |
| 516 | (unless (featurep 'xemacs) (set-buffer-multibyte t)) | 516 | (unless (featurep 'xemacs) (set-buffer-multibyte t)) |
| 517 | (mm-decode-coding-region (point-min) (point-max) 'utf-8) | 517 | (decode-coding-region (point-min) (point-max) 'utf-8) |
| 518 | t) | 518 | t) |
| 519 | 519 | ||
| 520 | (defun nnweb-gmane-identity (url) | 520 | (defun nnweb-gmane-identity (url) |
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index d179cbb2cbd..71e838a9b39 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el | |||
| @@ -59,7 +59,7 @@ them into characters should be done separately." | |||
| 59 | ;; which already contains non-ASCII characters which would | 59 | ;; which already contains non-ASCII characters which would |
| 60 | ;; then get doubly-decoded below. | 60 | ;; then get doubly-decoded below. |
| 61 | (if coding-system | 61 | (if coding-system |
| 62 | (mm-encode-coding-region (point-min) (point-max) coding-system)) | 62 | (encode-coding-region (point-min) (point-max) coding-system)) |
| 63 | (goto-char (point-min)) | 63 | (goto-char (point-min)) |
| 64 | (while (and (skip-chars-forward "^=") | 64 | (while (and (skip-chars-forward "^=") |
| 65 | (not (eobp))) | 65 | (not (eobp))) |
| @@ -87,7 +87,7 @@ them into characters should be done separately." | |||
| 87 | (message "Malformed quoted-printable text") | 87 | (message "Malformed quoted-printable text") |
| 88 | (forward-char))))) | 88 | (forward-char))))) |
| 89 | (if coding-system | 89 | (if coding-system |
| 90 | (mm-decode-coding-region (point-min) (point-max) coding-system))))) | 90 | (decode-coding-region (point-min) (point-max) coding-system))))) |
| 91 | 91 | ||
| 92 | (defun quoted-printable-decode-string (string &optional coding-system) | 92 | (defun quoted-printable-decode-string (string &optional coding-system) |
| 93 | "Decode the quoted-printable encoded STRING and return the result. | 93 | "Decode the quoted-printable encoded STRING and return the result. |
| @@ -116,7 +116,7 @@ encode lines starting with \"From\"." | |||
| 116 | (setq class "\010-\012\014\040-\074\076-\177")) | 116 | (setq class "\010-\012\014\040-\074\076-\177")) |
| 117 | (save-excursion | 117 | (save-excursion |
| 118 | (goto-char from) | 118 | (goto-char from) |
| 119 | (if (re-search-forward (mm-string-to-multibyte "[^\x0-\x7f\x80-\xff]") | 119 | (if (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]") |
| 120 | to t) | 120 | to t) |
| 121 | (error "Multibyte character in QP encoding region")) | 121 | (error "Multibyte character in QP encoding region")) |
| 122 | (save-restriction | 122 | (save-restriction |
| @@ -127,8 +127,7 @@ encode lines starting with \"From\"." | |||
| 127 | (not (eobp))) | 127 | (not (eobp))) |
| 128 | (insert | 128 | (insert |
| 129 | (prog1 | 129 | (prog1 |
| 130 | ;; To unibyte in case of Emacs 23 (unicode) eight-bit. | 130 | (format "=%02X" (char-after)) |
| 131 | (format "=%02X" (mm-multibyte-char-to-unibyte (char-after))) | ||
| 132 | (delete-char 1)))) | 131 | (delete-char 1)))) |
| 133 | ;; Encode white space at the end of lines. | 132 | ;; Encode white space at the end of lines. |
| 134 | (goto-char (point-min)) | 133 | (goto-char (point-min)) |
| @@ -167,7 +166,7 @@ encode lines starting with \"From\"." | |||
| 167 | (defun quoted-printable-encode-string (string) | 166 | (defun quoted-printable-encode-string (string) |
| 168 | "Encode the STRING as quoted-printable and return the result." | 167 | "Encode the STRING as quoted-printable and return the result." |
| 169 | (with-temp-buffer | 168 | (with-temp-buffer |
| 170 | (if (mm-multibyte-string-p string) | 169 | (if (multibyte-string-p string) |
| 171 | (mm-enable-multibyte) | 170 | (mm-enable-multibyte) |
| 172 | (mm-disable-multibyte)) | 171 | (mm-disable-multibyte)) |
| 173 | (insert string) | 172 | (insert string) |
diff --git a/lisp/gnus/rfc1843.el b/lisp/gnus/rfc1843.el index 1dbd11debd4..81646b4e196 100644 --- a/lisp/gnus/rfc1843.el +++ b/lisp/gnus/rfc1843.el | |||
| @@ -95,7 +95,7 @@ ftp://ftp.math.psu.edu/pub/simpson/chinese/hzp/hzp.doc" | |||
| 95 | (match-beginning 1) | 95 | (match-beginning 1) |
| 96 | (match-end 1))) | 96 | (match-end 1))) |
| 97 | (setq firstc (aref str 0)) | 97 | (setq firstc (aref str 0)) |
| 98 | (insert (mm-decode-coding-string | 98 | (insert (decode-coding-string |
| 99 | (rfc1843-decode | 99 | (rfc1843-decode |
| 100 | (prog1 | 100 | (prog1 |
| 101 | (substring str 1) | 101 | (substring str 1) |
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 6647d10b0b2..be491e9db99 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el | |||
| @@ -267,7 +267,7 @@ Should be called narrowed to the head of the message." | |||
| 267 | (mm-coding-system-p | 267 | (mm-coding-system-p |
| 268 | (car message-posting-charset))) | 268 | (car message-posting-charset))) |
| 269 | ;; 8 bit must be decoded. | 269 | ;; 8 bit must be decoded. |
| 270 | (mm-encode-coding-region | 270 | (encode-coding-region |
| 271 | (point-min) (point-max) | 271 | (point-min) (point-max) |
| 272 | (mm-charset-to-coding-system | 272 | (mm-charset-to-coding-system |
| 273 | (car message-posting-charset)))) | 273 | (car message-posting-charset)))) |
| @@ -294,8 +294,8 @@ Should be called narrowed to the head of the message." | |||
| 294 | (if (boundp 'enable-multibyte-characters) | 294 | (if (boundp 'enable-multibyte-characters) |
| 295 | (default-value 'enable-multibyte-characters)) | 295 | (default-value 'enable-multibyte-characters)) |
| 296 | mail-parse-charset) | 296 | mail-parse-charset) |
| 297 | (mm-encode-coding-region (point) (point-max) | 297 | (encode-coding-region (point) (point-max) |
| 298 | mail-parse-charset))) | 298 | mail-parse-charset))) |
| 299 | ;; We get this when CC'ing messages to newsgroups with | 299 | ;; We get this when CC'ing messages to newsgroups with |
| 300 | ;; 8-bit names. The group name mail copy just got | 300 | ;; 8-bit names. The group name mail copy just got |
| 301 | ;; unconditionally encoded. Previously, it would ask | 301 | ;; unconditionally encoded. Previously, it would ask |
| @@ -321,7 +321,7 @@ Should be called narrowed to the head of the message." | |||
| 321 | (if (boundp 'enable-multibyte-characters) | 321 | (if (boundp 'enable-multibyte-characters) |
| 322 | (default-value 'enable-multibyte-characters))) | 322 | (default-value 'enable-multibyte-characters))) |
| 323 | (featurep 'file-coding)) | 323 | (featurep 'file-coding)) |
| 324 | (mm-encode-coding-region (point) (point-max) method))) | 324 | (encode-coding-region (point) (point-max) method))) |
| 325 | ;; Hm. | 325 | ;; Hm. |
| 326 | (t))) | 326 | (t))) |
| 327 | (goto-char (point-max)))))))) | 327 | (goto-char (point-max)))))))) |
| @@ -556,7 +556,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." | |||
| 556 | (if (or debug-on-quit debug-on-error) | 556 | (if (or debug-on-quit debug-on-error) |
| 557 | (signal (car err) (cdr err)) | 557 | (signal (car err) (cdr err)) |
| 558 | (error "Invalid data for rfc2047 encoding: %s" | 558 | (error "Invalid data for rfc2047 encoding: %s" |
| 559 | (mm-replace-in-string orig-text "[ \t\n]+" " ")))))))) | 559 | (replace-regexp-in-string orig-text "[ \t\n]+" " ")))))))) |
| 560 | (unless dont-fold | 560 | (unless dont-fold |
| 561 | (rfc2047-fold-region b (point))) | 561 | (rfc2047-fold-region b (point))) |
| 562 | (goto-char (point-max)))) | 562 | (goto-char (point-max)))) |
| @@ -592,7 +592,7 @@ should not change this value.") | |||
| 592 | ((not rfc2047-encode-max-chars) | 592 | ((not rfc2047-encode-max-chars) |
| 593 | (concat start | 593 | (concat start |
| 594 | (funcall encoder (if cs | 594 | (funcall encoder (if cs |
| 595 | (mm-encode-coding-string string cs) | 595 | (encode-coding-string string cs) |
| 596 | string)) | 596 | string)) |
| 597 | "?=")) | 597 | "?=")) |
| 598 | ((>= column rfc2047-encode-max-chars) | 598 | ((>= column rfc2047-encode-max-chars) |
| @@ -616,7 +616,7 @@ should not change this value.") | |||
| 616 | (setq next (concat start | 616 | (setq next (concat start |
| 617 | (funcall encoder | 617 | (funcall encoder |
| 618 | (if cs | 618 | (if cs |
| 619 | (mm-encode-coding-string | 619 | (encode-coding-string |
| 620 | (substring string 0 (1+ index)) | 620 | (substring string 0 (1+ index)) |
| 621 | cs) | 621 | cs) |
| 622 | (substring string 0 (1+ index)))) | 622 | (substring string 0 (1+ index)))) |
| @@ -700,7 +700,7 @@ Point moves to the end of the region." | |||
| 700 | (setq crest (buffer-substring-no-properties (point) b))) | 700 | (setq crest (buffer-substring-no-properties (point) b))) |
| 701 | (setq eword (rfc2047-encode-1 | 701 | (setq eword (rfc2047-encode-1 |
| 702 | (- b (point-at-bol)) | 702 | (- b (point-at-bol)) |
| 703 | (mm-replace-in-string | 703 | (replace-regexp-in-string |
| 704 | (buffer-substring-no-properties b e) | 704 | (buffer-substring-no-properties b e) |
| 705 | "\n\\([ \t]?\\)" "\\1") | 705 | "\n\\([ \t]?\\)" "\\1") |
| 706 | cs | 706 | cs |
| @@ -947,7 +947,7 @@ ENCODED-WORD)." | |||
| 947 | (rfc2047-pad-base64 (nth 2 word))))) | 947 | (rfc2047-pad-base64 (nth 2 word))))) |
| 948 | ((char-equal ?Q (nth 1 word)) | 948 | ((char-equal ?Q (nth 1 word)) |
| 949 | (setq text (quoted-printable-decode-string | 949 | (setq text (quoted-printable-decode-string |
| 950 | (mm-subst-char-in-string | 950 | (subst-char-in-string |
| 951 | ?_ ? (nth 2 word) t))))) | 951 | ?_ ? (nth 2 word) t))))) |
| 952 | (error | 952 | (error |
| 953 | (message "%s" (error-message-string code)) | 953 | (message "%s" (error-message-string code)) |
| @@ -963,7 +963,7 @@ ENCODED-WORD)." | |||
| 963 | (setq words (concat | 963 | (setq words (concat |
| 964 | (or (and (setq cs (caar rest)) | 964 | (or (and (setq cs (caar rest)) |
| 965 | (condition-case code | 965 | (condition-case code |
| 966 | (mm-decode-coding-string (cdar rest) cs) | 966 | (decode-coding-string (cdar rest) cs) |
| 967 | (error | 967 | (error |
| 968 | (message "%s" (error-message-string code)) | 968 | (message "%s" (error-message-string code)) |
| 969 | nil))) | 969 | nil))) |
| @@ -1087,13 +1087,13 @@ other than `\"' and `\\' in quoted strings." | |||
| 1087 | mail-parse-charset | 1087 | mail-parse-charset |
| 1088 | (not (eq mail-parse-charset 'us-ascii)) | 1088 | (not (eq mail-parse-charset 'us-ascii)) |
| 1089 | (not (eq mail-parse-charset 'gnus-decoded))) | 1089 | (not (eq mail-parse-charset 'gnus-decoded))) |
| 1090 | (mm-decode-coding-region b e mail-parse-charset)) | 1090 | (decode-coding-region b e mail-parse-charset)) |
| 1091 | (setq b (point))) | 1091 | (setq b (point))) |
| 1092 | (when (and (mm-multibyte-p) | 1092 | (when (and (mm-multibyte-p) |
| 1093 | mail-parse-charset | 1093 | mail-parse-charset |
| 1094 | (not (eq mail-parse-charset 'us-ascii)) | 1094 | (not (eq mail-parse-charset 'us-ascii)) |
| 1095 | (not (eq mail-parse-charset 'gnus-decoded))) | 1095 | (not (eq mail-parse-charset 'gnus-decoded))) |
| 1096 | (mm-decode-coding-region b (point-max) mail-parse-charset)))))) | 1096 | (decode-coding-region b (point-max) mail-parse-charset)))))) |
| 1097 | 1097 | ||
| 1098 | (defun rfc2047-decode-address-region (start end) | 1098 | (defun rfc2047-decode-address-region (start end) |
| 1099 | "Decode MIME-encoded words in region between START and END. | 1099 | "Decode MIME-encoded words in region between START and END. |
| @@ -1123,7 +1123,7 @@ other than `\"' and `\\' in quoted strings." | |||
| 1123 | (when address-mime | 1123 | (when address-mime |
| 1124 | (setq string | 1124 | (setq string |
| 1125 | (with-temp-buffer | 1125 | (with-temp-buffer |
| 1126 | (when (mm-multibyte-string-p string) | 1126 | (when (multibyte-string-p string) |
| 1127 | (mm-enable-multibyte)) | 1127 | (mm-enable-multibyte)) |
| 1128 | (insert string) | 1128 | (insert string) |
| 1129 | (rfc2047-strip-backslashes-in-quoted-strings) | 1129 | (rfc2047-strip-backslashes-in-quoted-strings) |
| @@ -1146,8 +1146,8 @@ other than `\"' and `\\' in quoted strings." | |||
| 1146 | ;; string is purely ASCII | 1146 | ;; string is purely ASCII |
| 1147 | (eq (detect-coding-string string t) 'undecided)) | 1147 | (eq (detect-coding-string string t) 'undecided)) |
| 1148 | string | 1148 | string |
| 1149 | (mm-decode-coding-string string mail-parse-charset)) | 1149 | (decode-coding-string string mail-parse-charset)) |
| 1150 | (mm-string-to-multibyte string)))) ;; ) | 1150 | (string-to-multibyte string)))) ;; ) |
| 1151 | 1151 | ||
| 1152 | (defun rfc2047-decode-address-string (string) | 1152 | (defun rfc2047-decode-address-string (string) |
| 1153 | "Decode MIME-encoded STRING and return the result. | 1153 | "Decode MIME-encoded STRING and return the result. |
diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el index 34c8ecd4583..f5f0c818294 100644 --- a/lisp/gnus/rfc2231.el +++ b/lisp/gnus/rfc2231.el | |||
| @@ -63,12 +63,13 @@ must never cause a Lisp error." | |||
| 63 | (let (mod) | 63 | (let (mod) |
| 64 | (when (and (string-match "\\\\\"" string) | 64 | (when (and (string-match "\\\\\"" string) |
| 65 | (not (string-match "\\`\"\\|[^\\]\"" string))) | 65 | (not (string-match "\\`\"\\|[^\\]\"" string))) |
| 66 | (setq string (mm-replace-in-string string "\\\\\"" "\"") | 66 | (setq string (replace-regexp-in-string string "\\\\\"" "\"") |
| 67 | mod t)) | 67 | mod t)) |
| 68 | (when (and (string-match "\\\\(" string) | 68 | (when (and (string-match "\\\\(" string) |
| 69 | (string-match "\\\\)" string) | 69 | (string-match "\\\\)" string) |
| 70 | (not (string-match "\\`(\\|[^\\][()]" string))) | 70 | (not (string-match "\\`(\\|[^\\][()]" string))) |
| 71 | (setq string (mm-replace-in-string string "\\\\\\([()]\\)" "\\1") | 71 | (setq string (replace-regexp-in-string string |
| 72 | "\\\\\\([()]\\)" "\\1") | ||
| 72 | mod t)) | 73 | mod t)) |
| 73 | (or (and mod | 74 | (or (and mod |
| 74 | (ignore-errors | 75 | (ignore-errors |
| @@ -230,7 +231,7 @@ These look like: | |||
| 230 | ;; Decode using the charset, if any. | 231 | ;; Decode using the charset, if any. |
| 231 | (if (memq coding-system '(nil ascii)) | 232 | (if (memq coding-system '(nil ascii)) |
| 232 | (buffer-string) | 233 | (buffer-string) |
| 233 | (mm-decode-coding-string (buffer-string) coding-system))))) | 234 | (decode-coding-string (buffer-string) coding-system))))) |
| 234 | 235 | ||
| 235 | (defun rfc2231-encode-string (param value) | 236 | (defun rfc2231-encode-string (param value) |
| 236 | "Return and PARAM=VALUE string encoded according to RFC2231. | 237 | "Return and PARAM=VALUE string encoded according to RFC2231. |
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index 722186ed702..eb7d862e99c 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el | |||
| @@ -297,8 +297,7 @@ symbol `ask', query before flushing the queue file." | |||
| 297 | (re-search-forward | 297 | (re-search-forward |
| 298 | "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t)) | 298 | "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t)) |
| 299 | (let ((spam-report-gmane-wait | 299 | (let ((spam-report-gmane-wait |
| 300 | (zerop (% (mm-line-number-at-pos) | 300 | (zerop (% (line-number-at-pos) spam-report-gmane-max-requests)))) |
| 301 | spam-report-gmane-max-requests)))) | ||
| 302 | (gnus-message 6 "Reporting %s%s..." | 301 | (gnus-message 6 "Reporting %s%s..." |
| 303 | (match-string 1) (match-string 2)) | 302 | (match-string 1) (match-string 2)) |
| 304 | (funcall spam-report-url-ping-function | 303 | (funcall spam-report-url-ping-function |
diff --git a/lisp/gnus/utf7.el b/lisp/gnus/utf7.el index 9b7191b21e1..2168b7cf67c 100644 --- a/lisp/gnus/utf7.el +++ b/lisp/gnus/utf7.el | |||
| @@ -185,7 +185,7 @@ Use IMAP modification if FOR-IMAP is non-nil." | |||
| 185 | (defun utf7-latin1-u16-char-converter () | 185 | (defun utf7-latin1-u16-char-converter () |
| 186 | "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode. | 186 | "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode. |
| 187 | Characters are converted to raw byte pairs in narrowed buffer." | 187 | Characters are converted to raw byte pairs in narrowed buffer." |
| 188 | (mm-encode-coding-region (point-min) (point-max) 'iso-8859-1) | 188 | (encode-coding-region (point-min) (point-max) 'iso-8859-1) |
| 189 | (mm-disable-multibyte) | 189 | (mm-disable-multibyte) |
| 190 | (goto-char (point-min)) | 190 | (goto-char (point-min)) |
| 191 | (while (not (eobp)) | 191 | (while (not (eobp)) |
| @@ -201,7 +201,7 @@ Characters are in raw byte pairs in narrowed buffer." | |||
| 201 | (delete-char 1) | 201 | (delete-char 1) |
| 202 | (error "Unable to convert from Unicode")) | 202 | (error "Unable to convert from Unicode")) |
| 203 | (forward-char)) | 203 | (forward-char)) |
| 204 | (mm-decode-coding-region (point-min) (point-max) 'iso-8859-1) | 204 | (decode-coding-region (point-min) (point-max) 'iso-8859-1) |
| 205 | (mm-enable-multibyte)) | 205 | (mm-enable-multibyte)) |
| 206 | 206 | ||
| 207 | ;;;###autoload | 207 | ;;;###autoload |
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 4e64cfb12d3..72980b7ead8 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el | |||
| @@ -916,14 +916,14 @@ CONFIG is the window configuration before sending mail." | |||
| 916 | ;; use it as the drafts folder. Then copy the skeleton to a regular | 916 | ;; use it as the drafts folder. Then copy the skeleton to a regular |
| 917 | ;; temp file, and return the regular temp file. | 917 | ;; temp file, and return the regular temp file. |
| 918 | (let (new | 918 | (let (new |
| 919 | (temp-folder (mm-make-temp-file | 919 | (temp-folder (make-temp-file |
| 920 | (concat mh-user-path "draftfolder.") t))) | 920 | (concat mh-user-path "draftfolder.") t))) |
| 921 | (mh-exec-cmd "comp" "-nowhatnowproc" | 921 | (mh-exec-cmd "comp" "-nowhatnowproc" |
| 922 | "-draftfolder" (format "+%s" | 922 | "-draftfolder" (format "+%s" |
| 923 | (file-name-nondirectory temp-folder)) | 923 | (file-name-nondirectory temp-folder)) |
| 924 | (if (stringp mh-comp-formfile) | 924 | (if (stringp mh-comp-formfile) |
| 925 | (list "-form" mh-comp-formfile))) | 925 | (list "-form" mh-comp-formfile))) |
| 926 | (setq new (mm-make-temp-file "comp.")) | 926 | (setq new (make-temp-file "comp.")) |
| 927 | (rename-file (concat temp-folder "/" "1") new t) | 927 | (rename-file (concat temp-folder "/" "1") new t) |
| 928 | (delete-file (concat temp-folder "/" ".mh_sequences")) | 928 | (delete-file (concat temp-folder "/" ".mh_sequences")) |
| 929 | (delete-directory temp-folder) | 929 | (delete-directory temp-folder) |