unofficial mirror of meta@public-inbox.org
 help / color / mirror / 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	[thread overview]
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	other threads:[~2020-04-22  7:01 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 [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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).