VM-BUG: vm-followup-include-text parses multipart message wrong

Julian Bradfield jcb+xeb at inf.ed.ac.uk
Sat May 10 06:05:27 EDT 2008


In article <871w4bmc3o.fsf at uwakimon.sk.tsukuba.ac.jp> "Stephen J. Turnbull" <stephen at xemacs.org> writes:

>Given a MIME message with content-type
>
>multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"
>
>and this structure
>
>multipart/mixed
>    text/plain, charset=us-ascii
>    text/x-patch, charset=us-ascii, content-disposition=inline
>    text/plain, charset=us-ascii
>application/pgp-signature
>
>`vm-reply-include-text' and `vm-followup-include-text' parse it
>incorrectly.  They leave you in a buffer with only the first
>text/plain part included and quoted.  The second text/plain part
>should definitely be included and quoted, and I would argue that the
>text/x-patch part should be included and quoted because it has
>content-disposition "inline", so the author expected it to be
>displayable.

I don't think this is a bug - you just don't agree with the spec.

MIME doesn't have a notion of include-and-quote, so if you want to include
a multipart message you have to include it as a MIME part. It's not obvious
what the right answer is to how to include-and-quote such a message.
Kyle (presumably) took the easiest option, which is to assume the
first text part is the message - which usually works.

An alternative view, which is what you appear to want here, is that
you should include-and-quote the text seen when you view the message.
If that's what you want, VM will do it for you - see
vm-reply-include-presentation .

I find that sometimes I want one, sometimes the other, so I have the
following little mod in my .vm:

; mods to R and F so that they include the presentation buffer
; if called with C-u.

(require 'vm-reply)

(defun vm-reply-include-text (count)
  "Reply to the sender (only) of the current message and include text
from the message.  See the documentation for function vm-reply for details.
Modified to include presentation buffer if given C-u prefix argument."
  (interactive "P")
  (vm-follow-summary-cursor)
  (vm-select-folder-buffer)
  (vm-check-for-killed-summary)
  (vm-error-if-folder-empty)
  (let ((c 1)
	(vm-reply-include-presentation vm-reply-include-presentation))
    (if (consp count)
	(setq vm-reply-include-presentation t)
      (setq c (prefix-numeric-value count)))
    (vm-do-reply nil t c)))

(defun vm-followup-include-text (count)
  "Reply to all recipients of the current message and include text from
the message.  See the documentation for the function vm-reply for details.
Modified to include presentation buffer if given C-u prefix argument."
  (interactive "P")
  (vm-follow-summary-cursor)
  (vm-select-folder-buffer)
  (vm-check-for-killed-summary)
  (vm-error-if-folder-empty)
  (let ((c 1)
	(vm-reply-include-presentation vm-reply-include-presentation))
    (if (consp count)
	(setq vm-reply-include-presentation t)
      (setq c (prefix-numeric-value count)))
    (vm-do-reply t t c)))


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the XEmacs-Beta mailing list