Re: Selecting next message

"J.B. Nicholson-Owens" <[email protected]>
Newsgroups gmane.network.slrn.user
Message-ID <[email protected]>
Marc Tardif wrote:
> When I'm reading a message and hit the <header_line_down> key, the
> cursor in the header moves down. However, the content of the message
> corresponding to the cursor is not displayed for reading. Instead, I
> have to hit the <Enter> key. Is there a way to display the content of
> the message automatically?

Yes, with an S-Lang macro you can make downloading the next article implicit 
with header_line_down.  Something like the following should do the trick:

--------------------------------------------------------------------

implements ("my");
define header_line_down ()
{
    % Call the function we're wrapping including any prefix
    % argument that goes with it (i.e., don't try to hide
    % the prefix argument this time).
    call ("header_line_down");

    % Is the cursor pointing to the article seen in the
    % article view?
    if (1 == _is_article_visible ())
      {
         % Don't let the prefix argument get passed here.
         % Someday that might mean something and it will not
         % be easy to debug later.  This might not be needed
         % if the previous call() "eats up" the prefix arg.
         variable prefix = get_prefix_arg ();
         reset_prefix_arg ();

         % Hide the currently displayed article and then
         % unhide the article at the cursor.
         loop (2) { call ("hide_article"); }

         % Restore whatever prefix argument the user tried
         % to pass.
         if (-1 != prefix) { set_prefix_argument (prefix); }
      }
}
definekey ("my->header_line_down", "^N", "article");

--------------------------------------------------------------------

Copy the above and paste it into a text file (say, ~/.my_macros.sl).  Then load 
that macros file with slrn by appending

    interpret ".my_macros.sl"

This is set to work with Control-N by default.  If you prefer a different key 
for running the macro, change the last line ("definekey ...") to suit your 
needs.  I've commented this macro so that you should have some idea of what's 
going on even if you're not a programmer.

Happy newsreading.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
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.