aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-12-02 22:29:13 +0000
committerStefan Monnier2008-12-02 22:29:13 +0000
commit06c68f84d58d3ab5baefc56bbf2ef5f9143f1ef9 (patch)
tree3f3fb2e03ada6229796e5f7bdc0120b0cd52e42f
parentb97439ce3786af4a9cc6e8e882d2767ec1c1f69f (diff)
downloademacs-06c68f84d58d3ab5baefc56bbf2ef5f9143f1ef9.tar.gz
emacs-06c68f84d58d3ab5baefc56bbf2ef5f9143f1ef9.zip
(nnimap-retrieve-headers-progress): Don't use nnimap-demule
since the result is inserted in a unibyte buffer anyway. (nnimap-demule-use-string-to-multibyte): Remove. (nnimap-demule): Alias it to mm-string-to-multibyte.
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/nnimap.el56
2 files changed, 23 insertions, 40 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7088a837f2d..aad131c7362 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12008-12-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * nnimap.el (nnimap-retrieve-headers-progress): Don't use nnimap-demule
4 since the result is inserted in a unibyte buffer anyway.
5 (nnimap-demule-use-string-to-multibyte): Remove.
6 (nnimap-demule): Alias it to mm-string-to-multibyte.
7
12008-11-29 Reiner Steib <Reiner.Steib@gmx.de> 82008-11-29 Reiner Steib <Reiner.Steib@gmx.de>
2 9
3 * nnimap.el (nnimap-demule-use-string-to-multibyte): New temporary 10 * nnimap.el (nnimap-demule-use-string-to-multibyte): New temporary
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 06a52103043..e0bb5ad48f2 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -608,12 +608,11 @@ If EXAMINE is non-nil the group is selected read-only."
608 (with-current-buffer nnimap-server-buffer 608 (with-current-buffer nnimap-server-buffer
609 (setq uid imap-current-message 609 (setq uid imap-current-message
610 mbx imap-current-mailbox 610 mbx imap-current-mailbox
611 headers (nnimap-demule 611 headers (if (imap-capability 'IMAP4rev1)
612 (if (imap-capability 'IMAP4rev1) 612 ;; xxx don't just use car? alist doesn't contain
613 ;; xxx don't just use car? alist doesn't contain 613 ;; anything else now, but it might...
614 ;; anything else now, but it might... 614 (nth 2 (car (imap-message-get uid 'BODYDETAIL)))
615 (nth 2 (car (imap-message-get uid 'BODYDETAIL))) 615 (imap-message-get uid 'RFC822.HEADER))
616 (imap-message-get uid 'RFC822.HEADER)))
617 lines (imap-body-lines (imap-message-body imap-current-message)) 616 lines (imap-body-lines (imap-message-body imap-current-message))
618 chars (imap-message-get imap-current-message 'RFC822.SIZE))) 617 chars (imap-message-get imap-current-message 'RFC822.SIZE)))
619 (nnheader-insert-nov 618 (nnheader-insert-nov
@@ -901,40 +900,17 @@ function is generally only called when Gnus is shutting down."
901 (when (nnimap-possibly-change-server server) 900 (when (nnimap-possibly-change-server server)
902 (nnoo-status-message 'nnimap server))) 901 (nnoo-status-message 'nnimap server)))
903 902
904(defvar nnimap-demule-use-string-to-multibyte (fboundp 'string-to-multibyte) 903;; We used to use a string-as-multibyte here, but it is really incorrect.
905 "Temporary internal debug variable. 904;; This function is used when we're about to insert a unibyte string
906If you have problems (UTF-8 not decoded correctly on IMAP) with 905;; into a potentially multibyte buffer. The string is either an article
907the default value, please report it as a bug!") 906;; header or body (or both?), undecoded. When Emacs is asked to convert
908;; FIXME: Clarify if we need to make this variable conditional on the Emacs 907;; a unibyte string to multibyte, it may either use the equivalent of
909;; version (Emacs 22 vs. Emacs 23;Emacs 21 doesn't have `string-to-multibyte' 908;; nothing (e.g. non-Mule XEmacs), string-make-unibyte (i.e. decode using
910;; anyhow). --rsteib 909;; locale), string-as-multibyte (decode using emacs-internal coding system)
911;; 910;; or string-to-multibyte (keep the data undecoded as a sequence of bytes).
912;; http://thread.gmane.org/gmane.emacs.gnus.general/67112 911;; Only the last one preserves the data such that we can reliably later on
913;; (bug#464, reported by James Cloos) 912;; decode the text using the mime info.
914;; http://thread.gmane.org/gmane.emacs.bugs/21524 913(defalias 'nnimap-demule 'mm-string-to-multibyte)
915;; (bug#1174, reported by Frank Schmitt)
916
917(defun nnimap-demule (string)
918 ;; BEWARE: we used to use string-as-multibyte here which is braindead
919 ;; because it will turn accidental emacs-mule-valid byte sequences
920 ;; into multibyte chars. --Stef
921 ;; Reverted, braindead got 7.5 out of 10 on imdb, so it can't be
922 ;; that bad. --Simon
923 (gnus-message 9 "nnimap-demule-use-string-to-multibyte: %s"
924 nnimap-demule-use-string-to-multibyte)
925 (if nnimap-demule-use-string-to-multibyte
926 ;; Stefan
927 (funcall (if (and (fboundp 'string-to-multibyte)
928 (subrp (symbol-function 'string-to-multibyte)))
929 'string-to-multibyte
930 'identity)
931 (or string "")))
932 ;; Simon
933 (funcall (if (and (fboundp 'string-as-multibyte)
934 (subrp (symbol-function 'string-as-multibyte)))
935 'string-as-multibyte
936 'identity)
937 (or string "")))
938 914
939(defun nnimap-make-callback (article gnus-callback buffer) 915(defun nnimap-make-callback (article gnus-callback buffer)
940 "Return a callback function." 916 "Return a callback function."