<<< Date Index >>>     <<< Thread Index >>>

Re: changing the subject line of a thread



* Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> [2007-08-28 13:58]:
> 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.

I worked around the same problem in some $editor script by incrementing
the mtime via touch(1) as I didn't want the script to sleep(1).

I guess it would be nice if Mutt (optionally?) used the MD5 sum or
something instead of the mtime to check whether a file is modified.

Holger