user/dev discussion of public-inbox itself
 help / color / Atom feed
From: Eric Wong <e@yhbt.net>
To: Kyle Meyer <kyle@kyleam.com>
Cc: meta@public-inbox.org
Subject: Re: [PATCH 1/2] view: strip omission character from current message in thread view
Date: Wed, 22 Apr 2020 07:01:12 +0000
Message-ID: <20200422070112.GA3882@dcvr> (raw)
In-Reply-To: <20200422013359.16149-2-kyle@kyleam.com>

Kyle Meyer <kyle@kyleam.com> wrote:

Thanks for this series (and for figuring out how some of this
code works :)

> +++ b/lib/PublicInbox/View.pm
> @@ -322,7 +322,7 @@ sub _th_index_lite {
>  	my $s_s = nr_to_s($nr_s, 'sibling', 'siblings');
>  	my $s_c = nr_to_s($nr_c, 'reply', 'replies');
>  	$attr =~ s!\n\z!</b>\n!s;
> -	$attr =~ s!<a\nhref.*</a> !!s; # no point in duplicating subject
> +	$attr =~ s!<a\nhref.*</a> (&#34; )?!!s; # no point in duplicating subject

PATCH 2/2 looked fine, some minor nits on this one:

1) use `?:' when you don't intend to use $1 before the next RE match.
   `?:' avoids a small amount of overhead for saving $1.

2) line exceeds 80 columns, I just shortened "duplicating" to "dup"
   (I like really big fonts)

Will squash this in before pushing:

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 30928fdb..5144a130 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -322,7 +322,7 @@ sub _th_index_lite {
 	my $s_s = nr_to_s($nr_s, 'sibling', 'siblings');
 	my $s_c = nr_to_s($nr_c, 'reply', 'replies');
 	$attr =~ s!\n\z!</b>\n!s;
-	$attr =~ s!<a\nhref.*</a> (&#34; )?!!s; # no point in duplicating subject
+	$attr =~ s!<a\nhref.*</a> (?:&#34; )?!!s; # no point in dup subject
 	$attr =~ s!<a\nhref=[^>]+>([^<]+)</a>!$1!s; # no point linking to self
 	$rv .= "<b>@ $attr";
 	if ($nr_c) {

Thanks again.

  reply index

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 [this message]
2020-04-22 15:44     ` Kyle Meyer
2020-04-22  1:33 ` [PATCH 2/2] view: actually omit subject text when dumping topics Kyle Meyer

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=20200422070112.GA3882@dcvr \
    --to=e@yhbt.net \
    --cc=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

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git