From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column' Date: Wed, 09 Jun 2021 02:31:17 -0700 Message-ID: <87czsv4c62.fsf__41266.4964956761$1623231157$gmane$org@neverwas.me> References: <1821306.tpkKSVv8f3@ravel> <87v96n61xu.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16332"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44140@debbugs.gnu.org, emacs-erc@gnu.org To: Olivier Certner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 09 11:32:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lquZa-00045N-H9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 11:32:30 +0200 Original-Received: from localhost ([::1]:44186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lquZZ-0003Uv-JI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 05:32:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lquZ7-00031i-Sf for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 05:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lquZ7-0001zI-Lu for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 05:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lquZ7-0001rq-KM for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 05:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Jun 2021 09:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44140 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44140-submit@debbugs.gnu.org id=B44140.16232310927143 (code B ref 44140); Wed, 09 Jun 2021 09:32:01 +0000 Original-Received: (at 44140) by debbugs.gnu.org; 9 Jun 2021 09:31:32 +0000 Original-Received: from localhost ([127.0.0.1]:60438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lquYd-0001r8-Ss for submit@debbugs.gnu.org; Wed, 09 Jun 2021 05:31:32 -0400 Original-Received: from mail-109-mta81.mxroute.com ([136.175.109.81]:42171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lquYb-0001qr-TJ for 44140@debbugs.gnu.org; Wed, 09 Jun 2021 05:31:30 -0400 Original-Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-109-mta81.mxroute.com (ZoneMTA) with ESMTPSA id 179f01cac3d000774e.001 for <44140@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 09 Jun 2021 09:31:21 +0000 X-Zone-Loop: 343f2ad138b388a1789998ff55d5658c89efefa7eadc X-Originating-IP: [149.28.56.236] In-Reply-To: <87v96n61xu.fsf@neverwas.me> (J. P.'s message of "Tue, 08 Jun 2021 22:29:17 -0700") X-AuthUser: masked@neverwas.me X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208274 Archived-At: "J.P." writes: > Actually, you'd probably have to include that silly gap variable I added As well as something like @@ -303,12 +298,8 @@ erc-insert-timestamp-right ;; some margin of error if what is displayed on the line differs ;; from the number of characters on the line. (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6)))) - (if (< col pos) - (erc-insert-aligned string pos) - (newline) - (indent-to pos) - (setq from (point)) - (insert string)) + (when (>= col (- pos erc-timestamp-align-to-gap)) (newline)) + (erc-insert-aligned string (unless erc-timestamp-last-window-width pos)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (erc-put-text-property from (point) 'field 'erc-timestamp) (erc-put-text-property from (point) 'rear-nonsticky t) (when erc-timestamp-intangible to honor existing behavior when erc-fill-mode is active. (As well as other common-sense stuff I'm surely missing.) It also strikes me that some 'fill users might prefer only having `erc-fill-mode' affect message text while having timestamps instead aligned to a window's width. So, yet another option could be added to make something like that a reality if you think there'd be sufficient demand.