summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Steib <Reiner.Steib@gmx.de>2008-11-29 15:26:49 +0000
committerReiner Steib <Reiner.Steib@gmx.de>2008-11-29 15:26:49 +0000
commit9255ec865f643cbeb9403ef86901b7bf10c2e7b8 (patch)
tree05d11254e0f394811000b73e736f24498fb404c2
parent8cc53f96e5dc3d647411e01298e4125ed4b00928 (diff)
downloademacs-9255ec865f643cbeb9403ef86901b7bf10c2e7b8.tar.gz
(nnimap-demule-use-string-to-multibyte): New temporary
variable for debugging bug#464 and bug#1174. (nnimap-demule): Use it.
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/nnimap.el23
2 files changed, 29 insertions, 0 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index b9ebd92e682..9801c459467 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-29 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * nnimap.el (nnimap-demule-use-string-to-multibyte): New temporary
+ variable for debugging bug#464 and bug#1174.
+ (nnimap-demule): Use it.
+
2008-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
* message.el (message-send-mail): Just set the buffer to unibyte
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 49166b8de82..06a52103043 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -901,12 +901,35 @@ function is generally only called when Gnus is shutting down."
(when (nnimap-possibly-change-server server)
(nnoo-status-message 'nnimap server)))
+(defvar nnimap-demule-use-string-to-multibyte (fboundp 'string-to-multibyte)
+ "Temporary internal debug variable.
+If you have problems (UTF-8 not decoded correctly on IMAP) with
+the default value, please report it as a bug!")
+;; FIXME: Clarify if we need to make this variable conditional on the Emacs
+;; version (Emacs 22 vs. Emacs 23;Emacs 21 doesn't have `string-to-multibyte'
+;; anyhow). --rsteib
+;;
+;; http://thread.gmane.org/gmane.emacs.gnus.general/67112
+;; (bug#464, reported by James Cloos)
+;; http://thread.gmane.org/gmane.emacs.bugs/21524
+;; (bug#1174, reported by Frank Schmitt)
+
(defun nnimap-demule (string)
;; BEWARE: we used to use string-as-multibyte here which is braindead
;; because it will turn accidental emacs-mule-valid byte sequences
;; into multibyte chars. --Stef
;; Reverted, braindead got 7.5 out of 10 on imdb, so it can't be
;; that bad. --Simon
+ (gnus-message 9 "nnimap-demule-use-string-to-multibyte: %s"
+ nnimap-demule-use-string-to-multibyte)
+ (if nnimap-demule-use-string-to-multibyte
+ ;; Stefan
+ (funcall (if (and (fboundp 'string-to-multibyte)
+ (subrp (symbol-function 'string-to-multibyte)))
+ 'string-to-multibyte
+ 'identity)
+ (or string "")))
+ ;; Simon
(funcall (if (and (fboundp 'string-as-multibyte)
(subrp (symbol-function 'string-as-multibyte)))
'string-as-multibyte