🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
11 messages
11 total messages Started by andrew Sun, 10 Aug 2008 00:52
Reading only 3 groups with nn?
#10841
Author: andrew
Date: Sun, 10 Aug 2008 00:52
25 lines
1697 bytes
Hi,

As this is only my second day using nn I hope a few noob questions
will be excused?

1. I only expect to read 3 groups with nn: news.software.readers,
   news.software.nn and a leafnode 'local' test group. What is
   the best way to limit nn to these groups only? nn has its own
   .newsrc file but I manages to kill this fairly quickly when 
   editing :-).

2. I would like to set editor instructions in the .nn/init file
   for vim but the syntax escapes me. I would like to add something
   along the lines of:

   set editor vim '+set tw=72' +%d '%s'

   but nn was not happy with varying combinations of ", ', etc.

Thank you very much for your trouble, and thanks Aaron for putting
me onto this great newsreader :-).

   Andrew
-- 
http://www.andrews-corner.org
Re: Reading only 3 groups with nn?
#10842
Author: Aaron W. Hsu
Date: Sun, 10 Aug 2008 03:27
120 lines
6749 bytes
andrew <andrew@ilium.invalid> writes:

>As this is only my second day using nn I hope a few noob questions
>will be excused?

Not a problem at all. ;-)

>1. I only expect to read 3 groups with nn: news.software.readers,
>   news.software.nn and a leafnode 'local' test group. What is
>   the best way to limit nn to these groups only? nn has its own
>   .newsrc file but I manages to kill this fairly quickly when 
>   editing :-).

Actually, NN uses the "standard" .newsrc file that most other
newsreaders can handle. However, if you do not have any other news 
reader that will be using that file, you can just enter a few lines: 

	news.software.nn:
	news.software.readers:
	local:

If those are the names of the newsgroups. Now, NN checks for new groups 
on startup by default, so you'll want to add the following to your 
init file:

	set new-group-action 0

And, you can see the relavent information from the man page:

       new-group-action action  (integer, default 3)
              This variable controls how new groups  are  treated
              by  nn.  It is an integer variable, and the follow-
              ing values can be  used.   Some  of  these  actions
              (marked  with an *) will only work when keep-unsub-
              scribed is set, since the presence of  a  group  in
              .newsrc  is  the only way to recognize it as an old
              group:
              0)  Ignore groups which are not in  .newsrc.   This
              will  obviously  include  new groups, and therefore
              you must explictly add any new groups that you care
              about (by editting the .newsrc file, or using the G
              menu command and then subscribing  to  the  group).
              When  NNTP is being used, this setting prevents the
              active.times data from being read from the  server;
              this  can  be helpful when using a slow link, since
              the data can often be hundreds of KBytes long.
              1*)  Groups not in .newsrc  are  considered  to  be
              new,  and  are  inserted  at  the  beginning of the
              .newsrc file.
              2*)  Groups not in .newsrc  are  considered  to  be
              new,  and  are  appended  to the end of the .newsrc
              file.
              3)  New groups  are  recognized  via  a  time-stamp
              saved  in  the  file  .nn/LAST and in the database,
              i.e. it is not dependent on the groups currently in
              .newsrc.  The new groups are automatically appended
              to .newsrc with subscription.  Old groups not  pre-
              sent  in  .newsrc  will  be considered to be unsub-
              scribed.
              4)  As 3, but the user is asked to confirm that the
              new  group  should  be  appended  to  .newsrc.   If
              rejected,  the  group  will  not  be  appended   to
              .newsrc, and thus be regarded as unsubscribed.
              5)   As 4, except that the information is stored in
              a  format  compatible  with  the  rn  news   reader
              (.rnlast).  This needs to be tested!

>2. I would like to set editor instructions in the .nn/init file
>   for vim but the syntax escapes me. I would like to add something
>   along the lines of:

>   set editor vim '+set tw=72' +%d '%s'

>   but nn was not happy with varying combinations of ", ', etc.

Well, see, normally, you would just set your editor in the EDITOR 
environment, and everything would just work. In fact, normally, 
nn will automatically position the editor on the right line for you. 
However, looking at the copy of my aux file, vim will not be 
automatically recognized. :-) So, a little fancy stuff can be done. 

The problem is that the editor variable -- I think -- does not take 
options, but just a string to the program. This program is then fed 
into a script, known as the aux script in the library directory of 
NN. It then scans the string to figure out if it knows how to handle 
this editor. If it does, then it will invoke the right options. 

First thing you should do is just set your environment variable to 
vim unless you want to use another editor for other programs, in 
which case "set editor /usr/local/bin/vim" in your init file or the 
equivalent will work. 

Secondly, you need to look at where you put your executable utilities 
when you installed NN, maybe /usr/local/lib or /usr/local/libexec. You 
are looking for the aux* file. Once you find that file, you will see 
around line 303 where it decides what options to feed to the program. 
You'll want to add after line 310:

	vim )
	  # Vim with width Limit
	  eval $EDITOR '+set tw=72' +%d '%s'
	  ;;

This will provide a case for handling vim with your options in it. :-)

How did I know this? THe archives help, a lot. :-)

>Thank you very much for your trouble, and thanks Aaron for putting
>me onto this great newsreader :-).

Well, I am glad that I could be of some service. I hope that you'll 
come to appreciate NN as much as I have.

	Sincerely,
		Aaron Hsu
-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: Reading only 3 groups with nn?
#10843
Author: andrew
Date: Sun, 10 Aug 2008 07:11
62 lines
3200 bytes
Aaron W. Hsu <arcfide@sacrideo.us> writes:

>andrew <andrew@ilium.invalid> writes:

>>1. I only expect to read 3 groups with nn: news.software.readers,
>>   news.software.nn and a leafnode 'local' test group. What is
>>   the best way to limit nn to these groups only? 

>Actually, NN uses the "standard" .newsrc file that most other
>newsreaders can handle. However, if you do not have any other news 
>reader that will be using that file, you can just enter a few lines: 

>	news.software.nn:
>	news.software.readers:
>	local:

>If those are the names of the newsgroups. Now, NN checks for new groups 
>on startup by default, so you'll want to add the following to your 
>init file:

>	set new-group-action 0

Thanks for that it works well. I read tha man pages a little more closely
and also added:

       set newsrc /home/andrew/.nn/.newsrc

to insulate my nn efforts from other newsreaders I may try. Using
vim has not woked as well I am afraid:

>First thing you should do is just set your environment variable to 
>vim unless you want to use another editor for other programs, in 
>which case "set editor /usr/local/bin/vim" in your init file or the 
>equivalent will work. 

No probs as vim is already set as $EDITOR.

>Secondly, you need to look at where you put your executable utilities 
>when you installed NN, maybe /usr/local/lib or /usr/local/libexec. You 
>are looking for the aux* file. Once you find that file, you will see 
>around line 303 where it decides what options to feed to the program. 
>You'll want to add after line 310:

>	vim )
>	  # Vim with width Limit
>	  eval $EDITOR '+set tw=72' +%d '%s'
>	  ;;

Changed this and then I was puzzling over why some standard vim commands did
not work and I eventually realised that I was using vi rather than vim.
Slackware appears to ship with both which I did not realise up until now.

I am a little puzzled as to why nn would call vi? I could try a symlink
from vi --> vim I guess. At the moment it is linked:

andrew@ilium~$ ls -l /usr/bin/vi
lrwxrwxrwx 1 root root 5 2008-02-18 11:06 /usr/bin/vi -> elvis

  Andrew

-- 
http://www.andrews-corner.org
Re: Reading only 3 groups with nn?
#10844
Author: Aaron W. Hsu
Date: Sun, 10 Aug 2008 16:15
49 lines
3449 bytes
andrew <andrew@ilium.invalid> writes:

>Aaron W. Hsu <arcfide@sacrideo.us> writes:

>>First thing you should do is just set your environment variable to 
>>vim unless you want to use another editor for other programs, in 
>>which case "set editor /usr/local/bin/vim" in your init file or the 
>>equivalent will work. 

>No probs as vim is already set as $EDITOR.

You should try setting and not setting the editor value in your init 
file. 

>>Secondly, you need to look at where you put your executable utilities 
>>when you installed NN, maybe /usr/local/lib or /usr/local/libexec. You 
>>are looking for the aux* file. Once you find that file, you will see 
>>around line 303 where it decides what options to feed to the program. 
>>You'll want to add after line 310:

>>	vim )
>>	  # Vim with width Limit
>>	  eval $EDITOR '+set tw=72' +%d '%s'
>>	  ;;

>Changed this and then I was puzzling over why some standard vim commands did
>not work and I eventually realised that I was using vi rather than vim.
>Slackware appears to ship with both which I did not realise up until now.

>I am a little puzzled as to why nn would call vi? I could try a symlink
>from vi --> vim I guess. At the moment it is linked:

It should not be necessary for you to symlink vi to vim, as that script 
above was meant to fix that problem. To debug this, you might want to add 
in an echo $EDITOR; sleep 10 into the script. The only reason it would 
call vi that I can think of is if it can't find any other option. That 
is, if the EDITOR variable isn't set properly, then it may default to 
vi, which is what ${EDITOR-vi} does in lines 303-310 of aux. If you 
add a command to echo and then sleep, you'll get a few seconds to see 
exactly what you are calling. 

	Sincerely,
		Aaron Hsu

-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: Reading only 3 groups with nn?
#10845
Author: Aaron W. Hsu
Date: Sun, 10 Aug 2008 16:19
32 lines
2429 bytes
andrew <andrew@ilium.invalid> writes:

>Aaron W. Hsu <arcfide@sacrideo.us> writes:

>>Secondly, you need to look at where you put your executable utilities 
>>when you installed NN, maybe /usr/local/lib or /usr/local/libexec. You 
>>are looking for the aux* file. Once you find that file, you will see 
>>around line 303 where it decides what options to feed to the program. 
>>You'll want to add after line 310:

>>	vim )
>>	  # Vim with width Limit
>>	  eval $EDITOR '+set tw=72' +%d '%s'
>>	  ;;

I just realized that if you decided to add this verbatim, it's not going 
to work. :-) You need to add:

	vim )
	  # Vim with width limit
	  $EDITOR '+set tw=72' +$ED_LINE $WORK
	  ;;

And that might work better. Adding the eval part in front might also 
help. 

	Aaron
-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: Reading only 3 groups with nn?
#10846
Author: andrew
Date: Mon, 11 Aug 2008 04:30
24 lines
2248 bytes
Aaron W. Hsu <arcfide@sacrideo.us> writes:

>It should not be necessary for you to symlink vi to vim, as that script 
>above was meant to fix that problem. To debug this, you might want to add 
>in an echo $EDITOR; sleep 10 into the script. The only reason it would 
>call vi that I can think of is if it can't find any other option. That 
>is, if the EDITOR variable isn't set properly, then it may default to 
>vi, which is what ${EDITOR-vi} does in lines 303-310 of aux. If you 
>add a command to echo and then sleep, you'll get a few seconds to see 
>exactly what you are calling. 

To tell the truth Aaron it really seemed to be a huge amount of trouble 
to accomplish such a small thing that I have decided to use nano which 
is new to me but seems like a great little editor and fits in quite 
neatly with nn. I was spending a little too much time getting vim 
working and then I thought: 'new newsreader so why not a new editor?'.
Now I just have to stop myself automatically using vim commands on this 
little editor:-).

Can I ask what platform and editor you use yourself?

   Andrew
-- 
http://www.andrews-corner.org
Re: Reading only 3 groups with nn?
#10847
Author: Aaron W. Hsu
Date: Mon, 11 Aug 2008 06:37
13 lines
1879 bytes
andrew <andrew@ilium.invalid> writes:

>Can I ask what platform and editor you use yourself?

I use vi on OpenBSD which is really nex/nvi. 

	Aaron

-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: Reading only 3 groups with nn?
#10848
Author: andrew
Date: Mon, 11 Aug 2008 08:28
22 lines
2055 bytes
Aaron W. Hsu <arcfide@sacrideo.us> writes:

>andrew <andrew@ilium.invalid> writes:

>>Can I ask what platform and editor you use yourself?

>I use vi on OpenBSD which is really nex/nvi. 

Interesting. I have to admit that I think I have found my own niche with 
slackware / vim / slrn but nn is a fascinating newsreader that I will 
continue to explore. I had never seriously considered nano before and it 
looks like it will do some syntax highlighting as well if coaxed a 
little.

So, thanks for this introduction to nn! It is nice to have 'met' you, I 
enjoyed watching your calm reaction to a little bit of pressure in 
n.s.r. and I am tickled pink that I am using a slackware package that 
you were involved with for slackware.

  Andrew
-- 
http://www.andrews-corner.org
Re: Reading only 3 groups with nn?
#10849
Author: Aaron W. Hsu
Date: Mon, 11 Aug 2008 20:45
47 lines
3544 bytes
andrew <andrew@ilium.invalid> writes:

>Aaron W. Hsu <arcfide@sacrideo.us> writes:

>>andrew <andrew@ilium.invalid> writes:

>>>Can I ask what platform and editor you use yourself?

>>I use vi on OpenBSD which is really nex/nvi. 

>Interesting. I have to admit that I think I have found my own niche with 
>slackware / vim / slrn but nn is a fascinating newsreader that I will 
>continue to explore. 

I actually find that most Slackware folks are pretty fond of slrn, even 
if they choose to use a different newsreader. I like slrn because it has 
s-expressions and using slang, IIRC. 

NN is always fun simply for its different way of doing things. 

>I had never seriously considered nano before and it 
>looks like it will do some syntax highlighting as well if coaxed a 
>little.

Nano is certainly a decent editor, but if you like Vim, I can't imagine 
it being *that* enjoyable. ;-) There was a simple editor, maybe nano, 
which was particularly suited to composing mail messages, because it 
automatically recognized the format of the message and highlighted 
fields and the like in a nice way. And no, it wasn't Emacs. 

>So, thanks for this introduction to nn! It is nice to have 'met' you, I 
>enjoyed watching your calm reaction to a little bit of pressure in 
>n.s.r. and I am tickled pink that I am using a slackware package that 
>you were involved with for slackware.

Well, it was a real shame that someone had put together an NN package 
before me, but it was old, broken, and didn't work for anything. I do 
not know how long it sat like that, but I finally wanted it to work, 
so I put it together and sent it in. Patrick is pretty good about 
stuff like that. 

	Aaron
-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: Reading only 3 groups with nn?
#10850
Author: andrew
Date: Tue, 12 Aug 2008 12:31
26 lines
2205 bytes
andrew <andrew@ilium.invalid> writes:

>Interesting. I have to admit that I think I have found my own niche with 
>slackware / vim / slrn but nn is a fascinating newsreader that I will 
>continue to explore. I had never seriously considered nano before and it 
>looks like it will do some syntax highlighting as well if coaxed a 
>little.

Well curioser and curiouser it looks as if nn _is_ actually opening vim
as a simple 

:help

accidentally revealed to me, my apologies for leading you up the garden
path with that one. What is happening is that for some reason it is
reading neither the root vimrc or my own ~/.vimrc and thus I think is
behaving like 'unimproved' vim.

I am a little at a loss on this one unless the following is a hint:

andrew@ilium~$ ls -l /usr/bin/nn
-rwxr-xr-x 1 news news 232052 2006-06-28 09:12 /usr/bin/nn

   Andrew
-- 
http://www.andrews-corner.org
Re: Reading only 3 groups with nn?
#10851
Author: Aaron W. Hsu
Date: Tue, 12 Aug 2008 20:41
19 lines
2393 bytes
andrew <andrew@ilium.invalid> writes:

>What is happening is that for some reason it is
>reading neither the root vimrc or my own ~/.vimrc and thus I think is
>behaving like 'unimproved' vim.

The only reason I can imagine this happening is if some kind of setting 
you are using with Vim (options, for example) are such that they force 
Vim into a Vi mode. This could happen, maybe, with the way that you 
specify the lines, which is an older standard. POSIX has a different 
method for Vi, and maybe Vim does too.

	Aaron

-- 
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arcfide@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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