user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: meta@public-inbox.org
Cc: Kyle Meyer <kyle@kyleam.com>
Subject: [PATCH 2/2] view: actually omit subject text when dumping topics
Date: Tue, 21 Apr 2020 21:33:59 -0400	[thread overview]
Message-ID: <20200422013359.16149-3-kyle@kyleam.com> (raw)
In-Reply-To: <20200422013359.16149-1-kyle@kyleam.com>

Despite dump_topics() calling dedupe_subject() on the subject, the
index shows partly duplicated subjects, for example

  ` [PATCH 2/2] t/www_listing: avoid 'once' warnings
    ` [PATCH v2] t/www_listing: avoid 'once' warnings "

In the second line, the omission character " is appended, but the
entire subject is shown.  To display the subject with duplicated parts
omitted, regenerate it from the array that is modified by
dedupe_subject().
---
 lib/PublicInbox/View.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c90eaf6a..30928fdb 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -1096,6 +1096,7 @@ sub dump_topics {
 			my @next_prev = @subj; # full copy
 			my $omit = dedupe_subject($prev_subj, \@subj, ' &#34;');
 			$prev_subj = \@next_prev;
+			$subj = join(' ', @subj);
 			$subj = ascii_html($subj);
 			obfuscate_addrs($obfs_ibx, $subj) if $obfs_ibx;
 			$href = mid_href($mid);
-- 
2.26.0


      parent reply	other threads:[~2020-04-22  1:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  1:33 [PATCH 0/2] view: two display fixes for deduped subjects Kyle Meyer
2020-04-22  1:33 ` [PATCH 1/2] view: strip omission character from current message in thread view Kyle Meyer
2020-04-22  7:01   ` Eric Wong
2020-04-22 15:44     ` Kyle Meyer
2020-04-22  1:33 ` Kyle Meyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200422013359.16149-3-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).