VM

XEmacs compatible cached data encoding

Bug #1637785 reported by Uday Reddy
6
This bug affects 1 person
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
             'vm-su-message) sexp)))))
! (cond ((and (not token) vm-display-using-mime)
! ;; 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-mime-encoded-words-in-string
! (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
             'vm-su-message) sexp)))))
! ;; we're going to encode them, so don't decode them.
! ;; JCB 2014-11-23
! ;; (cond ((and (not token) vm-display-using-mime)
! ;; ;; 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-mime-encoded-words-in-string
! ;; (car sexp)))))
         (cond ((and (not token) (match-beginning 1) (match-beginning 2))
         (setcar sexp
          (list
***************
*** 990,999 ****
              (match-beginning 4)
              (match-end 4)))))))
         ;; Why do we reencode decoded strings? USR, 2010-05-12
! ;; (cond ((and (not token) vm-display-using-mime)
! ;; (setcar sexp
! ;; (list 'vm-reencode-mime-encoded-words-in-string
! ;; (car sexp)))))
         (setq sexp-fmt
        (cons (if token "" "%s")
       (cons (substring format
--- 992,1003 ----
              (match-beginning 4)
              (match-end 4)))))))
         ;; 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-using-mime)
! (setcar sexp
! (list 'vm-reencode-mime-encoded-words-in-string
! (car sexp)))))
         (setq sexp-fmt
        (cons (if token "" "%s")
       (cons (substring format

Uday Reddy (reddyuday)
tags: added: mime
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.2.1a → 8.3.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.