XEmacs compatible cached data encoding
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VM |
Triaged
|
Medium
|
Uday Reddy |
Bug Description
From Julian Bradfield (viewmail-info, 2014-11-23)
I spoke too soon. Even after clearing out my old failed attempts to
fix the problem, I still have a problem.
However, now I know why.
It's a FSFmacs/XEmacs difference.
In XEmacs, #'princ, and hence #'format, do what they say do, namely
output the printed representation to an output stream. Hence, text
properties on strings are lost.
In FSFmacs, #'princ builds a string representation (complete with
inherited properties), and then prints it to a stream only if the
output stream is an i/o stream; otherwise it inserts the strings into
the output buffer/string.
Thus the summary line, which is ultimately built by calling #'format
on various mime-decoded strings, doesn't contain the text properties
necessary for mime-reencoding to work.
I have applied the following patch to my own copy of vm, which
appears, so far, to deal with the issue.
*** vm-summary.el 2014/11/16 11:47:50 1.4
--- vm-summary.el 2014/11/23 20:16:36 1.5
***************
*** 954,965 ****
(setq token ''mark)
(setq sexp (cons (list 'vm-su-mark
! (cond ((and (not token) vm-display-
! ;; strings might have been already mime-decoded,
! ;; but there is no harm in doing it again. USR, 2010-05-13
! (setcar sexp
! (list 'vm-decode-
! (car sexp)))))
(cond ((and (not token) (match-beginning 1) (match-beginning 2))
(setcar sexp
(list
--- 954,967 ----
(setq token ''mark)
(setq sexp (cons (list 'vm-su-mark
! ;; we're going to encode them, so don't decode them.
! ;; JCB 2014-11-23
! ;; (cond ((and (not token) vm-display-
! ;; ;; strings might have been already mime-decoded,
! ;; ;; but there is no harm in doing it again. USR, 2010-05-13
! ;; (setcar sexp
! ;; (list 'vm-decode-
! ;; (car sexp)))))
(cond ((and (not token) (match-beginning 1) (match-beginning 2))
(setcar sexp
(list
***************
*** 990,999 ****
;; Why do we reencode decoded strings? USR, 2010-05-12
! ;; (cond ((and (not token) vm-display-
! ;; (setcar sexp
! ;; (list 'vm-reencode-
! ;; (car sexp)))))
(setq sexp-fmt
(cons (if token "" "%s")
(cons (substring format
--- 992,1003 ----
;; Why do we reencode decoded strings? USR, 2010-05-12
! ;; Because XEmacs #'format doesn't preserve text properties
! ;; JCB 2014-11-23
! (cond ((and (not token) vm-display-
! (setcar sexp
! (list 'vm-reencode-
! (car sexp)))))
(setq sexp-fmt
(cons (if token "" "%s")
(cons (substring format