Re: editor_command and file not modified message

Sven Guckes <[email protected]>
Newsgroups gmane.network.slrn.user
Message-ID <[email protected]>
* Troy Piggins <[email protected]> [2007-04-25 03:03]:
> I'm playing with a macro that with one key press
> follows up an article with a predefined message.
>
> Basically I thought of changing the editor_command
> temporarily to a "cat file >> %s" type command,
> call followup, and change editor back to vim.

sounds way too complicated.  ;-)

> Trouble is that when I hit the key on a message, just the
> "file not modified" error comes up and no followup is sent.
> I've checked the .followup and it is indeed getting the correct
> text inserted, so the editor_command seems to be working.

that's because the changes were made before vim gets to do any itself.
so no changes are made - and no message gets sent.

> Any ideas?

it is so easy to add a text
at the end of the current buffer
as well as adding the signature:

" add "file" to end of current buffer:
  map ,a :$r file<cr>

" add "sig" to end of current buffer:
  map ,s :$r ~/.signature<cr>

" both add the text and the signature:
  map <f3> ,a,s

besides, vim config like setting the 
textwidth should be done in the vimrc:

  au BufNewFile,BufRead  tw=65

and vim shuld already know about the files
of slrn and "set ft=mail" automatically:

  :view $VIMRUNTIME/filetype.vim
  /slrn

  " Mail (for Elm, trn, mutt, rn, slrn)
  au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail

can you afford to type F3 before saving with "ZZ"?

i dont think it is a good idea to automize all of it.

because then you could bind it to the return key
and you might not see a message going out at all.

it is good to keep these things on a level where
the user send off a message with some thinking.

Sven

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.