🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
11 messages
11 total messages Started by Sandman Mon, 28 Oct 2013 07:18
slrn keyboard commands
#255881
Author: Sandman
Date: Mon, 28 Oct 2013 07:18
25 lines
1514 bytes
So, I've been trying to figure out how to change the keyboard commands in 
slrn, and maybe I'll start with what I want to achieve.

In list mode, I want this:

right = expand thread tree
left = collapse thread tree
return = view article full screen (default "h")

in article mode (i.e. when I've hit return)
w = close article (default "h")
down = down one line
up = up one line


As I understand it, there is no separate "list" and "article" view, both 
are in the "article" view really. But since the keyboard commands doesn't 
collide, it would still be possible.

Also - is there a "mark this group read and open the next" command?
And - is there a "mark this thread read and go to next thread" command?


-- 
Sandman[.net]
Re: slrn keyboard commands
#255884
Author: Lewis
Date: Mon, 28 Oct 2013 12:52
35 lines
2604 bytes
In message <slrnl6s4a0.26a.mr@irc.sandman.net> 
  Sandman <mr@sandman.net> wrote:
> down = down one line
> up = up one line

these are set to esc-up and esc-down

setkey article article_line_down    "<Esc><Down>"       % Scroll article down one line
setkey article article_line_up      "<Esc><Up>" % Scroll article up one line

Just add a line after that defines up and down. However, if you do
that, you will lose the up down in, as you call it, list mode.

> As I understand it, there is no separate "list" and "article" view, both 
> are in the "article" view really. But since the keyboard commands doesn't 
> collide, it would still be possible.

> Also - is there a "mark this group read and open the next" command?

There is

setkey article catchup                 "<Esc>C" % Catchup (up to this article)

Which will mark everything up to the current article as read. There is
also plain 's' which will mark the whole group read. The 'n' key will
then move to the next

> And - is there a "mark this thread read and go to next thread" command?

ESC-d marks the current (sub)thread as read, which is often not the
same thing, but then again, often is.

-- 
"It's like those French have a different word for *everything*" - Steve
Martin
Re: slrn keyboard commands
#255973
Author: Phil Boutros
Date: Sun, 03 Nov 2013 05:50
14 lines
1629 bytes
Sandman <mr@sandman.net> wrote:
<snip>
> And - is there a "mark this thread read and go to next thread" command?

    Here's what I've got for that:


setkey article "call(\"toggle_collapse_threads\");call(\"delete\")" "X"


Phil
-- 
AH#61  Wolf#14  BS#89  bus#1  CCB#1  SENS  KOTC#4       philb@philb.ca
http://philb.ca         EKIII rides with me:  http://eddiekieger.com
Re: slrn keyboard commands
#256053
Author: J.B. Nicholson-Owens
Date: Sun, 03 Nov 2013 22:22
31 lines
2479 bytes
Phil Boutros <philb@philb.ca> wrote:
> setkey article "call(\"toggle_collapse_threads\");call(\"delete\")" "X"

If the goal is to mark an entire thread as read, the above won't mark
the current thread read when the current thread is collapsed.

I think you're looking for something closer to the following:

#v+
define my_mark_thread_as_read () 
{
   % Note the article we started on and the collapse status
   % of the current thread so we can do this job without
   % disturbing the display.
   variable
     starting_article = extract_article_header ("Message-ID"),
     thread_was_collapsed = is_thread_collapsed ();
   
   !if (thread_was_collapsed) collapse_thread ();
   call ("delete");
   variable ending_article = extract_article_header ("Message-ID");
   
   % Leave the thread marked read as it was collapsed/uncollapsed.
   () = locate_header_by_msgid (starting_article, 0);
   !if (thread_was_collapsed) uncollapse_thread ();
   
   % Put the cursor where the interactive function "delete" left it.
   () = locate_header_by_msgid (ending_article, 0);
}
definekey ("Global->my_mark_thread_as_read", "X", "article");
#v-
Re: slrn keyboard commands
#256054
Author: Lewis
Date: Sun, 03 Nov 2013 22:43
26 lines
2146 bytes
In message <slrnl7dj62.mup.jbn@forestfield.org> 
  J.B. Nicholson-Owens <jbn@forestfield.org> wrote:
> Phil Boutros <philb@philb.ca> wrote:
>> setkey article "call(\"toggle_collapse_threads\");call(\"delete\")" "X"

> If the goal is to mark an entire thread as read, the above won't mark
> the current thread read when the current thread is collapsed.

> I think you're looking for something closer to the following:

>    !if (thread_was_collapsed) collapse_thread ();
>    call ("delete");
>    variable ending_article = extract_article_header ("Message-ID");

Can you just change the original line to

#v+
setkey article "call(\"!if is_thread_collapsed() collapse_thread\");call(\"delete\")" "X"
#v-

Or something like that?


-- 
'You're your own worst enemy, Rincewind,' said the sword.
Rincewind looked up at the grinning men.  'Bet?' --Colour of Magic
Re: slrn keyboard commands
#256055
Author: J.B. Nicholson-Owens
Date: Sun, 03 Nov 2013 23:56
11 lines
1743 bytes
Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
> Can you just change the original line to

I prefer it when there are no side effects, but your alteration will
always collapse uncollapsed threads. I also prefer code with comments
and I prefer to avoid a series of inline calls that require escaping
quotes. Inline calls and escaping strikes me as harder to read and
maintain.

So, as with anything, this depends on what you want the outcome to be
and what tradeoffs you're willing to make.
Re: slrn keyboard commands
#256066
Author: Lewis
Date: Mon, 04 Nov 2013 02:07
19 lines
2043 bytes
In message <slrnl7doko.pgu.jbn@forestfield.org> 
  J.B. Nicholson-Owens <jbn@forestfield.org> wrote:
> Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
>> Can you just change the original line to

> I prefer it when there are no side effects, but your alteration will
> always collapse uncollapsed threads.

Right, but since ou are marking the thread as read, collapsing it seems
like the right thing.

>I also prefer code with comments and I prefer to avoid a series of
>inline calls that require escaping quotes. Inline calls and escaping
>strikes me as harder to read and maintain.

Well, yes, escaping is evil.

-- 
The early bird gets the worm, but the second mouse gets the cheese.
Re: slrn keyboard commands
#256083
Author: J.B. Nicholson-Owens
Date: Mon, 04 Nov 2013 04:08
9 lines
1786 bytes
Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
> Right, but since ou are marking the thread as read, collapsing it seems
> like the right thing.

Are there slrn functions which collapse threads after marking
something read? I don't find the two actions of marking articles read
and collapsing a thread to be connected logically. Quite to the
contrary, when I see a function produce side effects I tend to wonder
what other things that function does that I didn't ask for.
Re: slrn keyboard commands
#256088
Author: Phil Boutros
Date: Mon, 04 Nov 2013 04:40
18 lines
1926 bytes
J.B. Nicholson-Owens <jbn@forestfield.org> wrote:
> Phil Boutros <philb@philb.ca> wrote:
>> setkey article "call(\"toggle_collapse_threads\");call(\"delete\")" "X"
>
> If the goal is to mark an entire thread as read, the above won't mark
> the current thread read when the current thread is collapsed.

    Correct you are.  I never had that case happen because I expand
all threads by default, and only hit that macro when I want to delete
the whole thread.

    Thanks for the correction.


Phil
-- 
AH#61  Wolf#14  BS#89  bus#1  CCB#1  SENS  KOTC#4       philb@philb.ca
http://philb.ca         EKIII rides with me:  http://eddiekieger.com
Re: slrn keyboard commands
#256132
Author: J.B. Nicholson-Owens
Date: Tue, 05 Nov 2013 02:18
33 lines
2469 bytes
Looking at the S-Lang change notes,
http://www.jedsoft.org/slang/doc/html/slang-23.html#ss23.2 in
particular, I see the function should probably read:

#v+
define my_mark_thread_as_read () 
{
   % Note the article we started on and the collapse status
   % of the current thread so we can do this job without
   % disturbing the display.
   variable
     starting_article = extract_article_header ("Message-ID"),
     thread_was_collapsed = is_thread_collapsed ();
   
   collapse_thread ();
   call ("delete");
   variable ending_article = extract_article_header ("Message-ID");
   
   % Leave the thread marked read as it was collapsed/uncollapsed.
   ifnot (thread_was_collapsed)
     {
       () = locate_header_by_msgid (starting_article, 0);
       uncollapse_thread ();
     }
   
   % Put the cursor where the interactive function "delete" left it.
   () = locate_header_by_msgid (ending_article, 0);
}
definekey ("Global->my_mark_thread_as_read", "X", "article");
#v-

which is a wee bit simpler and uses ifnot() which is (as of S-Lang
2.1) preferred over the older (and now deprecated) !if().
Re: slrn keyboard commands
#256134
Author: Lewis
Date: Tue, 05 Nov 2013 02:53
21 lines
2318 bytes
In message <slrnl7e7dt.sme.jbn@forestfield.org> 
  J.B. Nicholson-Owens <jbn@forestfield.org> wrote:
> Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
>> Right, but since ou are marking the thread as read, collapsing it seems
>> like the right thing.

> Are there slrn functions which collapse threads after marking
> something read?

No, you mark an entire thread read by first collapsing it, then marking
it read. That's what the command was trying to do.

> I don't find the two actions of marking articles read
> and collapsing a thread to be connected logically.

We're not trying to mark articles read; we're marking the entire thread
read.


-- 
The trouble with being a god is that you've got no one to pray to.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads