-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, August 28 at 03:14 PM, quoth martin f krafft:
> So I wanted to change the subject line on all thread mails. First, I 
> missed the "pass (Maildir) files of tagged messages to external 
> command as *arguments*" command in mutt, so I had to create a new 
> folder and put the files in there, then go to the shell and invoke 
> sed. An alternative would have of course been to set $editor to the 
> sed -i command, but I could not get this working. Even setting 
> editor="sed -i -e '/./d'" just got me "message not modified".

HEH. This *would* work, if you were on a much slower machine (or if 
you just got really lucky). The way mutt determines whether a file is 
modified is by comparing the mtime of the temp file it created to the 
mtime of the temp file once the editor is done editing. The mtime is 
stored in seconds. Sed, of course, executes in less than a second, so 
the mtime is unchanged in all but the rarest of cases. It would work 
if you'd piped it to a script like this:

      #!/bin/sh
      sleep 1
      sed -i -e '/./d' "$1"

Because then the mtime would be guaranteed (more or less) to be 
different from when mutt created the tmp file.

> So I tracked this down to the header_cache (can I tell mutt to 
> remake that?) and after I had deleted it, I got what I wanted.

Yeah, that's what you have to do when your messages change out from 
underneath you. Mutt doesn't do much to check on the validity of the 
hcache, and since mutt trusts the hcache (for obvious reasons), we're 
forced to occasionally blow it away after we go mucking about behind 
mutt's back. That's just the way it goes.

> Now my question simply is: is there a better way to change the 
> subject of messages in a thread, such that mutt is actually aware of 
> it and I don't have to coerce it to accept the change?

The editor trick would work, as long as you make sure the mtime is 
going to be different (e.g. the above script).

~Kyle
- -- 
Be sincere; be brief; be seated.
                                                -- Franklin D. Roosevelt
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFG1H5tBkIOoMqOI14RAiuKAJ9YPPK0xw9HBi4T4ODuKfuIsopa/gCfc0US
Tcz5Ut/fiea7ckA1IC/vlfw=
=lTHo
-----END PGP SIGNATURE-----

Reply via email to