Article View: news.software.readers
Article #259974Re: [slrn] Automattic subject modification
From: Doug713705
Date: Fri, 15 Jan 2016 09:22
Date: Fri, 15 Jan 2016 09:22
69 lines
4716 bytes
4716 bytes
Le 15-01-2016, J.B. Nicholson nous expliquait dans
news.software.readers (<slrnn9gt1i.65f.jbn@forestfield.org>) :
>> That what I thought at first and I already succeed in using
>> replace_article().
>
> It's good that you're experimenting. Since you've posted no code it's
> hard to know what you tried.
I have overwritten the code that had been written with replace_article()
so I can't show you but this was as simple as you described before:
- Get the article with article_as_string()
- Get the subject with extract_displayed_article_header()
- Replace the subject within that string using strreplace()
- Replace the article by the modified string with replace_article()
Very simple code indeed.
I tried many version of that code (using strchop to get the article line
by line, etc).
All worked and subject was replaced in slrn article view but when I
attempt to followup such a replaced article, the editor gets a prepared
reply based on the the original article (subject and references headers
are still based on the original headers).
>> It does the job on screen but it does not modify the article and when I
>> followup as usual such a replaced article, the subject is still based
>> on the original one as "Re: <original subject>" althought some other
>> parts of the article are replaced. The artcile body part and some of
>> the headers are replaced but *not* the subject header or the References
>> header that are generated by slrn prior to passing it to the editor.
>
> Consider trying a combination of slrn macro plus editor macro: a slrn
> macro that sets the tempfile to a new known place, sets the slrn
> editor setting to call an editor that will run a macro on load, then
> calls the intrinsic to send a reply or post a followup. Then also make
> an editor macro that replaces the subject as needed. After
> posting/replying, the slrn macro can restore the previous values of
> the modified slrn settings to what they were before the slrn macro
> began. Thus this macro shouldn't interfere with normal
> posting/replying.
The point is that I use nano as my editor which is a very basic editor
that do not have any macro feature. It may be time for me to switch to a
better but more complex editor like vi or so.
Note that also tried to 'sed' the article in tmp file and get that tmp
file to the editor with no success (I didn't try too hard though).
For now my script works good even if it does not remove the original
subject header but I can manage this situation by a single keystroke.
Comparing the effort to get used to a new editor, a single keystroke
once or two a day is far easyer. I may come to it one day but not now
;-)
> I don't quite see the point in overriding the references header as
> that risks breaking threading. Regardless of what you change the
> subject to, if you're posting a followup it should thread properly.
I only tried to override the references for testing purpose as I noticed
that header was based on the original article ;-)
Thank you again for your help.
--
Mais dans les souterrains, les rêveurs sont perdants.
Serions-nous condamnés à nous sentir trop lourds ?
H.F. Thiéfaine- 713705 Cherche Futur
Technical Details
Message-ID:
<n7adnp$2nu$1@golgoth98.redatomik.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.(126883).mbox.7z!not-for-mailReferences:
<n742hs$8j2$1@golgoth98.redatomik.org> <slrnn9b613.39r.jbn@forestfield.org> <n7554d$olo$1@golgoth98.redatomik.org> <slrnn9e654.h97.jbn@forestfield.org> <n786j1$47m$1@golgoth98.redatomik.org> <slrnn9gt1i.65f.jbn@forestfield.org>Show Full Headers
Complete Article Headers
Message-ID: <n7adnp$2nu$1@golgoth98.redatomik.org>
Subject: Re: [slrn] Automattic subject modification
Date: Fri, 15 Jan 2016 09:22:01 +0000
From: Doug713705 <doug.letough@free.fr>
References: <n742hs$8j2$1@golgoth98.redatomik.org> <slrnn9b613.39r.jbn@forestfield.org> <n7554d$olo$1@golgoth98.redatomik.org> <slrnn9e654.h97.jbn@forestfield.org> <n786j1$47m$1@golgoth98.redatomik.org> <slrnn9gt1i.65f.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.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Organization: Les cassoulets tropicaux reunis
Lines: 69
Sender: doug.letough@free.fr
Reply-To: Doug Le Tough <doug.letough@free.fr>
NNTP-Posting-Host: golgoth98.redatomik.org
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Trace: golgoth98.redatomik.org 1452849721 2814 195.154.70.45 (15 Jan 2016 09:22:01 GMT)
X-Complaints-To: abuse@redatomik.org
NNTP-Posting-Date: Fri, 15 Jan 2016 09:22:01 +0000 (UTC)
User-Agent: slrn/pre1.0.0-18 (Linux)
X-Face: 'Sh}&9(gyOf[,6&8(Gv#k(:g=wUCLP}b#oqMPkLKpV"|y1TatXGYTh.jK\!@!&OsR}'~a
%D7>:N$)5?\hx$?7Vu5U}GgJaY[&Hb!ThY_TB}.EsQn%JD4k<<)V_f*]P'FM<BJz{NJ$d<3S1<D*{
,0^l<z&NxluMUHA<c
X-Received-Bytes: 4533
X-Received-Body-CRC: 1320757784