Article View: news.software.readers
Article #79838Re: [slrn] Slang Macros question
From: J.B. Nicholson-Owens
Date: Tue, 05 Jun 2001 03:14
Date: Tue, 05 Jun 2001 03:14
44 lines
2681 bytes
2681 bytes
Pete Young wrote:
> if (is_substr (current_newsgroup (), "ourco"))
current_newsgroup() returns the name of the group at the group mode cursor.
Thus current_newsgroup() doesn't always coincide with where you are in
article mode when you call current_newsgroup() from article mode.
Perhaps you're crossposting between some group not in the ourco hierarchy
and an ourco group but the group mode cursor is pointing to the other group?
Perhaps you've inadvertantly moved the group mode cursor (which one can do
from article mode) with some other macro before posting?
Also, in the "this will be hard to find 5 months from now" category: you
will (or should) get false positives if you post to any group with "ourco"
in the group name -- alt.ourco or rec.food.sourcom -- both of those
(fictional) groups have "ourco" in them. As I understand your post, you
only want to use the different settings in a particular hierarchy. You
might want to branch on a string_match() instead:
if (string_match (strlow (current_newsgroup ()), "^ourco\\.", 1))
will only match if "ourco" (in a case-insensitive match due to the strlow())
is the first 5 characters in the newsgroup name. The double backslash will
be reduced to a single backslash before string_match() sees the regular
expression.
> Trouble is, my postings to ourco.test are showing up with the wrong
> headers [...]
Do you have any other macro that is resetting them? Perhaps a
post_filter_hook()? Off hand I don't see anything wrong with your code but
I don't have enough information to trace what's really happening. Perhaps
appending
_debug_info = 1;
_traceback = 1;
_slangtrace = 1;
_trace_function ("post_hook");
to the that source file and reloading would help to see what goes wrong
where.
Good luck.
Technical Details
Message-ID:
<slrn9hojhe.85.jbn@forestfield.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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mailReferences:
<slrn9hn3p7.sq4.pete@cornfed.alien.bt.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <slrn9hojhe.85.jbn@forestfield.org> Subject: Re: [slrn] Slang Macros question Date: Tue, 05 Jun 2001 03:14:14 +0000 From: jbn@forestfield.org (J.B. Nicholson-Owens) References: <slrn9hn3p7.sq4.pete@cornfed.alien.bt.co.uk> 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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail Newsgroups: news.software.readers Organization: Forest Field OmniMedia Lines: 43 NNTP-Posting-Host: forestfield.org (208.216.67.173) X-Trace: fu-berlin.de 991710854 4376301 208.216.67.173 (16 [35848]) X-Orig-Path: jbn User-Agent: slrn/0.9.7.0 (Unix)