Re: editor_command and file not modified message

Christian Ebert <[email protected]>
Newsgroups gmane.network.slrn.user
Organization Black Trash Productions <http://www.blacktrash.org/>
Message-ID <[email protected]>
* Troy Piggins on Wednesday, April 25, 2007 at 09:21:39 +1000:
> 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.
> 
> Here's what I have:
> 
> #v+
> define auto_message(){
>
>  set_string_variable ("editor_command", "cat auto_message.txt >> '%s'");
>  set_string_variable ("signature","");
> 
>  set_input_chars ("yy");
>  set_prefix_argument(1);
>  call ("followup");
> 
>  set_string_variable ("editor_command", "vim '+set ft=mail' '+set
> tw=65' '+%d' '%s'");
>  set_string_variable
> ("signature","/home/troy/.signature/usenet.signature");
> 
> }
> 
> definekey ("auto_message", "\e8", "article");
> #v-
> 
> 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.
> 
> Any ideas?

Do you have
set abort_unmodified_edits 1
in your slrnrc, by any chance? Then you'd have to set this
temporarily to 0:

variable
  abort_unmodified_edits = get_variable_value ("abort_unmodified_edits");
set_integer_variable ("abort_unmodified_edits", 0);
% do stuff
set_integer_variable ("abort_unmodified_edits", abort_unmodified_edits);

You could do the same with your editor_command and signature
variable, so you don't have to change your script when you decide
a configure change.

c
-- 
Make Slrn newsreader read MIME (Python required):
<http://www.blacktrash.org/cgi-bin/mercurial/SlrnMime/>

-------------------------------------------------------------------------
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.