🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #71466

Re: [slrn] tab compleation of filenames

#71466
From: jwk
Date: Fri, 02 Feb 2001 07:05
51 lines
2853 bytes
On 1 Feb 2001 19:54:01 GMT, Thomas Schultz
<tststs@gmx.de> wrote:
>On 01 February 2001 at 12:11 GMT, jwk <_hate_spam_thunder7@xs4all.nl> wrote:
>[...]
>> I think I'm going to start to look at Vim.
>
>You should be aware that Vim isn't available under the terms of the
>GPL, so I won't be able to accept a patch containing code from it.

Oh, I meant more for the way it is working, not copying straight from
it. I think I see how to start to program this, but I have another
question.

I'd like to add a line

#v+
#if SLRN_HAS_TAB_COMPLETION
   SLkm_define_key  ("\t", (FVOID_STAR) tab_complete, Slrn_Keymap_RLI->keymap);
#endif
#v-

in generic_read_input() in misc.c. I think that should be a good
starting point. What goes in tab_complete() is to be examined later :-)

Now the problem: <tab> shouldn't always try to find a filename, it's
rather ridiculous when entering a mail-address for example. So there has
to be a way to switch this on or off.

1 - copy the whole generic_read_input() function to 
    generic_read_input_with_tab().

2 - add an extra argument to the function and wrap the whole thing into
    several #if ... #endif constructs.

3 - use a global variable.

4 - add an extra argument and just add 0 all over the source where it's
    not wanted.

What say the 'Guidelines to succesful Slrn patching' ? I'm inclined
toward 4, with 3 as a close second, since that seems to be the way a lot
of Slrn is programmed. 2 is just unreadable, and 1 is inelegant.

Greetings,
Jurriaan
-- 
BOFH excuse #271:

The kernel license has expired
GNU/Linux 2.2.19pre7 SMP 2x1402 bogomips load av: 0.29 0.06 0.02
Technical Details
Message-ID: <slrn97kn99.6kl._hate_spam_thunder7@middle.of.nowhere>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.109.6.150!transit.news.xs4all.nl!_hate_spam_thunder7
References: <d1wd6.14046$E6.544876@news1.rdc1.sdca.home.com> <slrn97e5p3.q5.tststs@starflower.tststs.ddns.org> <slrn97fa6s.3v6._hate_spam_thunder7@middle.of.nowhere> <slrn97gm2t.b8.tststs@starflower.tststs.ddns.org> <slrn97ikqu.2g0._hate_spam_thunder7@middle.of.nowhere> <slrn97jfmp.1jn.tststs@starflower.tststs.ddns.org>

Show Full Headers
Complete Article Headers
Message-ID: <slrn97kn99.6kl._hate_spam_thunder7@middle.of.nowhere>
Subject: Re: [slrn] tab compleation of filenames
Date: Fri, 02 Feb 2001 07:05:12 +0000
From: _hate_spam_thunder7@xs4all.nl (jwk)
References: <d1wd6.14046$E6.544876@news1.rdc1.sdca.home.com> <slrn97e5p3.q5.tststs@starflower.tststs.ddns.org> <slrn97fa6s.3v6._hate_spam_thunder7@middle.of.nowhere> <slrn97gm2t.b8.tststs@starflower.tststs.ddns.org> <slrn97ikqu.2g0._hate_spam_thunder7@middle.of.nowhere> <slrn97jfmp.1jn.tststs@starflower.tststs.ddns.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.109.6.150!transit.news.xs4all.nl!_hate_spam_thunder7
Newsgroups: news.software.readers
Organization: XS4ALL Internet BV
Lines: 50
NNTP-Posting-Host: rivierenland.xs4all.nl
X-Trace: news1.xs4all.nl 981097512 14655 194.109.14.47 (2 Feb 2001 07:05:12 GMT)
X-Complaints-To: abuse@xs4all.nl
NNTP-Posting-Date: 2 Feb 2001 07:05:12 GMT
User-Agent: slrn/0.9.6.3 (GNU/Linux)