🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #230566

Re: [slrn] signature selection dependent on hierarchy, howto?

#230566
From: John E. Davis
Date: Sun, 22 Feb 2009 15:24
35 lines
2299 bytes
On Sun, 22 Feb 2009 15:19:56 +0100, houghi <houghi@houghi.org.invalid>
wrote:
> And it is. Here a list of hurdles I needed to take and why I did not
> succeed.

Try a variation of the following.  In your .slrnrc file, put:

   interpret "/path/to/slrn-signature.sl"

In "/path/to/slrn-signature.sl", put:

   private define set_signature ()
   {
      variable group = current_newsgroup ();
      variable sigfile = "$HOME/.signature"$;
   
      if (string_match (group, "^news", 1))
        sigfile = "${HOME}/.slrn_news_signature"$;
      else if (string_match (group, "^comp", 1))
        sigfile = "${HOME}/.slrn_comp_signature"$;
      else if (group == "alt.test")
        sigfile = "${HOME}/.slrn_alt_test_signature"$;

      set_string_variable ("signature", sigfile);
   }
   register_hook ("article_mode_hook", &set_signature);

That is all there is to it.  Of course you will need to create the
appropriate signature files and add your own tests.

Finally note the use of the $ suffix on the strings.  It indicates
that the ${variables} are to be expanded.

Good luck,
--John
Technical Details
Message-ID: <slrngq2rh2.jlt.jed@aluche.mit.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!xmission!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mail
References: <gnpkl9$14io$2@de-l.enfer-du-nord.net> <slrngq1bp7.prc.me@wannes.invalid> <slrngq2gn9.fb4.houghi@pasta.houghi> <slrngq2ihl.323.me@wannes.invalid> <slrngq2jve.4os.me@wannes.invalid> <slrngq2ls8.fb4.houghi@pasta.houghi> <slrngq2noc.6h6.houghi@pasta.houghi>

Show Full Headers
Complete Article Headers
Message-ID: <slrngq2rh2.jlt.jed@aluche.mit.edu>
Subject: Re: [slrn] signature selection dependent on hierarchy, howto?
Date: Sun, 22 Feb 2009 15:24:17 +0000
From: "John E. Davis" <jed@jedsoft.org>
References: <gnpkl9$14io$2@de-l.enfer-du-nord.net> <slrngq1bp7.prc.me@wannes.invalid> <slrngq2gn9.fb4.houghi@pasta.houghi> <slrngq2ihl.323.me@wannes.invalid> <slrngq2jve.4os.me@wannes.invalid> <slrngq2ls8.fb4.houghi@pasta.houghi> <slrngq2noc.6h6.houghi@pasta.houghi>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!xmission!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mail
Newsgroups: news.software.readers
Reply-To: davis@space.mit.edu
User-Agent: slrn/pre1.0.0-2 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 35
NNTP-Posting-Host: ALUCHE.MIT.EDU
X-Trace: 1235316257 senator-bedfellow.mit.edu 314 18.75.2.45