Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 256886

Summary: app-emacs/vm-8.0.12 does not work with Supercite anymore
Product: Gentoo Linux Reporter: Ulrich Müller <ulm>
Component: Current packagesAssignee: Emacs project <emacs>
Status: RESOLVED FIXED    
Severity: normal Keywords: REGRESSION
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: "test1" VM folder
VM state information
vm-8.0.12-fix-supercite-yank.patch
Updated patch with MIME header decoding

Description Ulrich Müller gentoo-dev 2009-01-30 07:02:39 UTC
The following report was already sent upstream <hack@robf.de> at 22 Nov 2008.


Since the dawn of time (actually, at least since 1993 and VM 5.40 ;-)
I use Supercite together with VM and never had any problems with it.
Now it looks like it ceased to work with VM version 8.0.12.


To reproduce the problem (this is with GNU Emacs 22.3 and VM 8.0.12):
1. Save attached file as folder "test1"
2. Eval the following expression:
   (add-hook 'mail-citation-hook 'sc-cite-original)
3. Type "M-x vm-visit-folder RET test1 RET"
4. Type "M-x load-library RET vm-pine RET" (to work around the missing
   autoload of vm-decode-postponed-mime-message, as reported earlier)
5a. Move to the first message ("Subject: test 1") and type "R"

Now some warning messages appear:
,----
| Mail header "Dies ist e..." doesn't conform to RFC 822. skipping...
| No mail headers found! Restoring old information.
`----

6a. When asked for the attribution name, type "RET"

The body of the reply buffer will now contain the following:
,----
|     Anon> Dies ist ein Test.
`----


Expected behaviour:
5b. Move to the second message ("Subject: test 2") and type "R"
6b. When asked for the attribution name, type "RET"

The body of the reply buffer will look as follows in this case:
,----
| >>>>> "Ulrich" == Ulrich Mueller <ulm@kph.uni-mainz.de> writes:
|
|     Ulrich> Dies ist ein Test.
`----

With VM 8.0.9 it is working as expected for _both_ messages.

The difference between the two messages is that the first one contains
MIME headers, while the second one doesn't.


For completeness, I'm also attaching VM's state information.
Comment 1 Ulrich Müller gentoo-dev 2009-01-30 07:04:34 UTC
Created attachment 180220 [details]
"test1" VM folder
Comment 2 Ulrich Müller gentoo-dev 2009-01-30 07:05:22 UTC
Created attachment 180221 [details]
VM state information
Comment 3 Ulrich Müller gentoo-dev 2009-01-30 07:16:23 UTC
Created attachment 180226 [details, diff]
vm-8.0.12-fix-supercite-yank.patch

Seems the problem is in function vm-yank-message, which doesn't work
as documented:
,----
| All message headers are yanked along with the text.  Point is
| left before the inserted text, the mark after.  Any hook
| functions bound to `mail-citation-hook' are run, after inserting
| the text and setting point and mark.
`----

(See also sc.info, node "Hints to MUA Authors".)

But vm-yank message includes the headers only in the non-MIME case:

        (if (eq layout 'none)
            (vm-insert-region-from-buffer (vm-buffer-of message)
                                          (vm-headers-of message)
                                          (vm-text-end-of message))
          (vm-decode-mime-layout layout)
          (if vm-mime-yank-attachments
              (vm-decode-postponed-mime-message))))

Inserting another "vm-insert-region-from-buffer" command (but with a
third argument "(vm-text-of message)") at the beginning of the "else"
part, as in attached patch, seems to fix the Supercite problem.

However, I don't understand the code well enough to decide if this is
a proper fix, or has other undesired side effects. (For example, what
is function "vm-decode-mime-layout" supposed to do? It is rather long
and has no documentation.)
Comment 4 Ulrich Müller gentoo-dev 2009-01-31 11:00:55 UTC
> Created an attachment (id=180226) [edit]
> vm-8.0.12-fix-supercite-yank.patch

> However, I don't understand the code well enough to decide if this is
> a proper fix, or has other undesired side effects.

Committed as -r2, as I'm using this myself since quite some time and haven't had any problems with it.
Comment 5 Ulrich Müller gentoo-dev 2009-11-02 20:59:28 UTC
VM should also decode the headers before calling mail-citation-hook.
See <http://thread.gmane.org/gmane.emacs.devel/116483>. Reopening.
Comment 6 Ulrich Müller gentoo-dev 2009-11-03 07:45:41 UTC
Created attachment 209113 [details, diff]
Updated patch with MIME header decoding
Comment 7 Ulrich Müller gentoo-dev 2009-11-03 07:46:31 UTC
Fixed in vm-8.0.12-r6.