Article View: news.software.readers
Article #48132Re: slrn's locate_header_by_msgid and another deleting_thread without moving the cursor
From: da... John E. Davis
Date: Tue, 20 Apr 1999 00:00
Date: Tue, 20 Apr 1999 00:00
67 lines
3802 bytes
3802 bytes
On 19 Apr 1999 09:11:32 GMT, Dawn Owens-Nicholson <blue...@ux6.cso.uiuc.edu>
wrote:
>Here's a couple things to look out for when using locate_header_by_msgid
>(and the related goto_article):
>
>* Unnecessarily uncollapsing threads--lhbm will uncollapse the thread even
0.9.5.5 will fix this.
>* lhbm will cause a download--if you give lhbm the message-ID of an article
> not in the header list but on the server, that article will be added to
> the bottom of the current header list.
A new intrinsic function has been added to 0.9.5.5 that allows you
to locate an article by message-id and whether or not to query the
server.
>define delete_thread_no_move ()
>{
> if (is_group_mode ())
> error (_function_name () + " doesn\'t work in group mode!");
>
> variable
> starting_article = extract_article_header ("Message-ID"),
> thread_was_collapsed = is_thread_collapsed ();
>
> uncollapse_thread ();
> loop (thread_size ()) % call("delete_thread")-ish
> {
> set_header_flags (get_header_flags () | HEADER_READ);
> () = header_down (1); % just because I'm lazy and
> } % it's sufficiently terse
>
> set_input_string (starting_article); % go back to where we started
> call ("locate_header_by_msgid"); % lhbm is slightly buggy
> if (thread_was_collapsed) collapse_thread (); % restore thread collapse
> else uncollapse_thread (); % to work around lhbm bug
>}
Currently, through 0.9.5.4, locate_header_by_msgid guarantees that the
thread will always be uncollapsed. Hence, you can replace
if (thread_was_collapsed) collapse_thread ();
else uncollapse_thread ();
by:
if (thread_was_collapsed) collapse_thread ();
For 0.9.5.5, you can replace:
set_input_string (starting_article); % go back to where we started
call ("locate_header_by_msgid"); % lhbm is slightly buggy
by:
() = locate_header_by_msgid (starting_article, 0);
Keep in mind that for 0.9.5.5, locate_header_by_msgid will preserve
the state of the thread as long as the header that you are seeking is
not collapsed.
I hope to release 0.9.5.5 (mainly a bug-fix release) next weekend.
--John
Technical Details
Message-ID:
<slrn7hnt9d.vbj.davis@aluche.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mailReferences:
<slrn7h3o65.jcd.hezu@tuuri.ling.helsinki.fi> <slrn7h472c.6d.c928400@urdybet.pbk.dk> <slrn7h4883.or7.davis@aluche.mit.edu> <slrn7h62fn.s3k.hezu@tuuri.ling.helsinki.fi> <slrn7h6vl6.103.c928400@urdybet.pbk.dk> <slrn7h8g72.8s3.hezu@tuuri.ling.helsinki.fi> <slrn7hac9a.upb.sas@hpprobe.div111.bell-labs.com> <slrn7hbepo.2nb.c928400@urdybet.pbk.dk> <slrn7hf4jr.a1k.bluemoon@ux6.cso.uiuc.edu> <slrn7hf9ek.ae.c928400@urdybet.pbk.dk> <slrn7hfd9j.51k.bluemoon@ux6.cso.uiuc.edu> <slrn7hglm7.1hh.c928400@urdybet.pbk.dk> <slrn7hl067.idp.bluemoon@ux6.cso.uiuc.edu> <slrn7hlnho.5h.c928400@urdybet.pbk.dk> <slrn7hlsq3.ptv.bluemoon@ux6.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Message-ID: <slrn7hnt9d.vbj.davis@aluche.mit.edu> Subject: Re: slrn's locate_header_by_msgid and another deleting_thread without moving the cursor Date: Tue, 20 Apr 1999 00:00:00 +0000 From: da...@space.mit.edu (John E. Davis) References: <slrn7h3o65.jcd.hezu@tuuri.ling.helsinki.fi> <slrn7h472c.6d.c928400@urdybet.pbk.dk> <slrn7h4883.or7.davis@aluche.mit.edu> <slrn7h62fn.s3k.hezu@tuuri.ling.helsinki.fi> <slrn7h6vl6.103.c928400@urdybet.pbk.dk> <slrn7h8g72.8s3.hezu@tuuri.ling.helsinki.fi> <slrn7hac9a.upb.sas@hpprobe.div111.bell-labs.com> <slrn7hbepo.2nb.c928400@urdybet.pbk.dk> <slrn7hf4jr.a1k.bluemoon@ux6.cso.uiuc.edu> <slrn7hf9ek.ae.c928400@urdybet.pbk.dk> <slrn7hfd9j.51k.bluemoon@ux6.cso.uiuc.edu> <slrn7hglm7.1hh.c928400@urdybet.pbk.dk> <slrn7hl067.idp.bluemoon@ux6.cso.uiuc.edu> <slrn7hlnho.5h.c928400@urdybet.pbk.dk> <slrn7hlsq3.ptv.bluemoon@ux6.cso.uiuc.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail X-Deja-AN: 468572961 X-Complaints-To: use...@eecs-usenet-02.mit.edu X-Trace: eecs-usenet-02.mit.edu 924579123 27559 18.75.2.45 (20 Apr 1999 03:32:03 GMT) Organization: Center for Space Research User-Agent: slrn/0.9.5.5 (UNIX) Reply-To: da...@space.mit.edu NNTP-Posting-Date: 20 Apr 1999 03:32:03 GMT Newsgroups: news.software.readers,alt.lang.s-lang