Re: How to save article w/o running it through "display hook" filter?

Christian Ebert <[email protected]>
Newsgroups gmane.network.slrn.user
Organization Black Trash Productions <http://www.blacktrash.org/>
Message-ID <[email protected]>
* Grant Edwards on Thursday, March 29, 2007 at 15:25:16 +0000:
> I find it odd that the "display-hook" filter appears to be run
> even when an article is saved without being displayed (e.g.
> saved from the thread index screen).  How does one either save
> or view a "raw" article?

I don't think this is necessarily related to an additional filter
but inherent to Slrn: If you save a /displayed/ or already read
article that has eg. Content-Transfer-Encoding quoted-printable
with umlauts, the article is saved decoded (but with the "wrong"
header).

Workarounds:

1) Mark article as new, exit group, reenter, and save unread
article from index /before/ displaying.

2) Create a read_article_hook that saves raw_article_as_string()
(because calling raw_article_as_string has above restriction as
well) in a variable make that accessible to a function; roughly
like this (untested):

implements ("RawArt");

variable rawart;

static define read_article_hook ()
{
  rawart = raw_article_as_string ();
}
  

static define get_raw ()
{
  replace_article (rawart);
  message (strcat (_function_name (), ": replaced article with raw version"));
}

definekey ("RawArt->get_raw", "R", "article");


c
-- 
_B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.