On Sat, Feb 19, 2011 at 12:54:20AM +0100, Pau wrote: > Hi Paul, > > thanks! > > I have currently set this to > > set editor="vim +/^$ ++1 +start +nohlsearch" > > So I guess this would go into > > ${editor:-vi} $file > > But how?
Instead of this: exec ${editor:-vi} $file Use this: exec vim '+/^$' ++1 +start +nohlsearch > In any case, thanks a lot. You're very welcome. Could you please write your replies *after* the text you're replying to, as I am doing now? The way you've been writing your replies ("top posting") makes it hard to see what you're replying to. Thanks. Paul. > You too, Ed. > > Cheers. > > On 18 February 2011 23:13, Paul Hoffman <nkui...@nkuitse.com> wrote: > > On Fri, Feb 18, 2011 at 08:41:18PM +0100, Pau wrote: > >> sorry... I am totally lost... how am I supposed to do this with > >> edit_headers??? > >> > >> I can write scripts, but could you please give me an example of what I > >> have to add to muttrc in the headers to call a script that will link > >> that temporary file (what's the syntax for it) with the script?? > >> > >> thanks and apologies for my ignorance... I did look at the manual, but > >> it's again the same problem as usual: I am lost when looking at > >> keywords or meaning of expressions, because I am not fluent in English > > > > In ~/.muttrc: > > > > set edit_headers=yes > > set editor=/path/to/my/script > > set tmpdir=/path/to/tempfiles > > > > Then /path/to/my/script has something along these lines: > > > > #!/bin/zsh > > > > typeset file=$1 label subject; shift > > typeset editor=${VISUAL:-$EDITOR} > > > > main() { > > grep '^Subject: ' $file | read label subject > > if [[ -n $subject ]]; then > > newfile=$(sanitize-subject $subject) > > ln -f $file $file:h/$newfile > > fi > > exec ${editor:-vi} $file > > } > > > > sanitize-subject() { > > print -- $1 | perl -pe 's/ +/_/g; tr/A-Z_/a-z_/d; tr/a-z_//cd' > > } > > > > main $@ > > > > For example, this would leave a copy of this draft I'm composing right > > now in /path/to/tempfiles/re_renaming_temporary_files. > > > > Paul. > > > >> On 18 February 2011 17:53, Richard <r...@linux-m68k.org> wrote: > >> > On Fri, Feb 18, 2011 at 02:58:49AM +0100, Pau wrote: > >> >> Hi, > >> >> > >> >> thanks for the answer... unfortunately I have a precompiled binary. Do > >> >> I really have to change the source for that? I guess so... the change > >> >> is not trivial > >> > > >> > you could define editor to call a wrapper script which would evaluate the > >> > headers and create a "readable" link to the file. With edit-headers you > >> > have > >> > all the information you need inside the file. > >> > > >> > > >> > Richard > >> > > >> > --- > >> > Name and OpenPGP keys available from pgp key servers > >> > > >> > > > > > -- > > Paul Hoffman <nkui...@nkuitse.com> > > -- Paul Hoffman <nkui...@nkuitse.com>