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#60936: 30.0.50; ERC >5.5: Add erc-fill style based on visual-line-mode Date: Mon, 13 Nov 2023 13:01:47 -0800 Message-ID: <87r0ktxt8k.fsf__46372.5184135669$1699909440$gmane$org@neverwas.me> References: <87tu0nao77.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-erc@gnu.org To: 60936@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 13 22:03:52 2023 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 1r2e63-0005EO-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Nov 2023 22:03:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2e5n-000582-7p; Mon, 13 Nov 2023 16:03:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2e5Z-00057L-0w for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 16:03:22 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2e5Y-00043v-Ls for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 16:03:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2e6D-0003MQ-Qe for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 16:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Nov 2023 21:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60936 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60936-submit@debbugs.gnu.org id=B60936.169990938112820 (code B ref 60936); Mon, 13 Nov 2023 21:04:01 +0000 Original-Received: (at 60936) by debbugs.gnu.org; 13 Nov 2023 21:03:01 +0000 Original-Received: from localhost ([127.0.0.1]:59435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2e5E-0003Kc-TR for submit@debbugs.gnu.org; Mon, 13 Nov 2023 16:03:01 -0500 Original-Received: from mail-108-mta23.mxroute.com ([136.175.108.23]:45783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2e5B-0003KR-Q7 for 60936@debbugs.gnu.org; Mon, 13 Nov 2023 16:02:59 -0500 Original-Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta23.mxroute.com (ZoneMTA) with ESMTPSA id 18bca7df449000190b.001 for <60936@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 13 Nov 2023 21:02:14 +0000 X-Zone-Loop: 2c11021e9563118bcd1185322e4399cb516eb4635c86 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Sae+Wn/QibswXuM+rCYhfPJSAPtHozqxrL1nZU1S/0g=; b=NXS3POy3kWOnN4WX85P7hFn1Y0 qwtGmr2g3N+fbWlUSa5r6+Cu7T36QqRm60WSFlKBYQCzkYVWkhLkjP1hWkf9HJbIPsW/PmqikdwOa PFRSyd8x1yOMDmtOt1gNOKdFD2zgAs6SX3OjQttIvEiYH1iem3hi+ilNblPp9k0Inzn7pWRKsLV0Z 7b8d5iBuUMJxUvOV5V6sJT1lj44hI14mslkHgZmM3vUmakKdtbL7BsfC8S/gzMqcJJQb9aK2zgAzN HnagvQTXoY/LnKfDY8NHhMtcuv4s8G1U13zMfZBl31Cl+Te9/DC44iPdChSlkwGTaZJTz2eHk3ed/ MsSb1o0Q==; In-Reply-To: <87tu0nao77.fsf@neverwas.me> (J. P.'s message of "Wed, 18 Jan 2023 06:53:48 -0800") X-Authenticated-Id: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274284 Archived-At: --=-=-= Content-Type: text/plain I'm thinking it might make sense to have `fill-wrap' formally depend on `scrolltobottom', even though there's no technical reason to do so. The rare user who prefers otherwise can still get their way via `erc-scrolltobottom-mode-hook'. Alternatively, we could just enable `scrolltobottom' by default in a future release. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-5.6-Make-erc-fill-wrap-depend-on-scrolltobottom.patch >From 66a7f1a34924a7244ac27b25e8d6b36d9c3ceaf2 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 13 Nov 2023 12:07:36 -0800 Subject: [PATCH] [5.6] Make erc-fill-wrap depend on scrolltobottom * lisp/erc/erc-fill.el (erc-fill-mode, erc-fill-function): Add reference to `erc-fill-wrap-mode' in doc string. (erc--fill-scrolltobottom-exempt-p): New variable. (erc-fill--wrap-ensure-dependencies): Warn and enable `erc-scrolltobottom-mode' if necessary. (erc-fill-wrap-mode): Mention workaround for users who don't want this module to automatically enable `scrolltobottom'. * test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate): Exempt tests from `scrolltobottom' dependency. (Bug#60936) --- lisp/erc/erc-fill.el | 44 +++++++++++++++++++-------------- test/lisp/erc/erc-fill-tests.el | 1 + 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index e48d5540c86..457e51e6053 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -44,11 +44,7 @@ erc-fill (define-erc-module fill nil "Manage filling in ERC buffers. ERC fill mode is a global minor mode. When enabled, messages in -the channel buffers are filled." - ;; FIXME ensure a consistent ordering relative to hook members from - ;; other modules. Ideally, this module's processing should happen - ;; after "morphological" modifications to a message's text but - ;; before superficial decorations. +the channel buffers are filled. See also `erc-fill-wrap-mode'." ((add-hook 'erc-insert-modify-hook #'erc-fill 60) (add-hook 'erc-send-modify-hook #'erc-fill 60)) ((remove-hook 'erc-insert-modify-hook #'erc-fill) @@ -86,11 +82,12 @@ erc-fill-function A third style resembles static filling but \"wraps\" instead of fills, thanks to `visual-line-mode' mode, which ERC automatically -enables when this option is `erc-fill-wrap' or when the module -`fill-wrap' is active. Use `erc-fill-static-center' to specify -an initial \"prefix\" width and `erc-fill-wrap-margin-width' -instead of `erc-fill-column' for influencing initial message -width. For adjusting these during a session, see the commands +enables when this option is set to `erc-fill-wrap' or when the +module `fill-wrap' is active \(see `erc-fill-wrap-mode' for +details). Use `erc-fill-static-center' to specify an initial +\"prefix\" width and `erc-fill-wrap-margin-width' instead of +`erc-fill-column' for influencing initial message width. For +adjusting these during a session, see the commands `erc-fill-wrap-nudge' and `erc-fill-wrap-refill-buffer'." :type '(choice (const :tag "Variable Filling" erc-fill-variable) (const :tag "Static Filling" erc-fill-static) @@ -367,8 +364,11 @@ erc-fill-wrap-mode-map " " #'erc-fill--wrap-beginning-of-line) (defvar erc-button-mode) +(defvar erc-scrolltobottom-mode) (defvar erc-legacy-invisible-bounds-p) +(defvar erc--fill-scrolltobottom-exempt-p nil) + (defun erc-fill--wrap-ensure-dependencies () (with-suppressed-warnings ((obsolete erc-legacy-invisible-bounds-p)) (when erc-legacy-invisible-bounds-p @@ -381,6 +381,10 @@ erc-fill--wrap-ensure-dependencies (unless erc-fill-mode (push 'fill missing-deps) (erc-fill-mode +1)) + (unless (or erc-scrolltobottom-mode (memq 'scrolltobottom erc-modules) + erc--fill-scrolltobottom-exempt-p) + (push 'scrolltobottom missing-deps) + (erc-scrolltobottom-mode +1)) (when erc-fill-wrap-merge (require 'erc-button) (unless erc-button-mode @@ -401,20 +405,22 @@ erc-fill--wrap-ensure-dependencies ;;;###autoload(put 'fill-wrap 'erc--feature 'erc-fill) (define-erc-module fill-wrap nil "Fill style leveraging `visual-line-mode'. + This module displays nicks overhanging leftward to a common offset, as determined by the option `erc-fill-static-center'. And it \"wraps\" messages at a common margin width, as determined by the option `erc-fill-wrap-margin-width'. To use it, either include `fill-wrap' in `erc-modules' or set `erc-fill-function' -to `erc-fill-wrap'. Most users will want to enable the -`scrolltobottom' module as well. Once active, use -\\[erc-fill-wrap-nudge] to adjust the width of the indent and the -stamp margin, and use \\[erc-fill-wrap-toggle-truncate-lines] for -cycling between logical- and screen-line oriented command -movement. Similarly, use \\[erc-fill-wrap-refill-buffer] to fix -alignment problems after running certain commands, like -`text-scale-adjust'. Also see related stylistic options -`erc-fill-line-spacing' and `erc-fill-wrap-merge'. +to `erc-fill-wrap'. Once active, use \\[erc-fill-wrap-nudge] to +adjust the width of the indent and the stamp margin, and use +\\[erc-fill-wrap-toggle-truncate-lines] for cycling between +logical- and screen-line oriented command movement. Similarly, +use \\[erc-fill-wrap-refill-buffer] to fix alignment problems +after running certain commands, like `text-scale-adjust'. Also +see related stylistic options `erc-fill-line-spacing' and +`erc-fill-wrap-merge'. Note that this module currently ensures +`erc-scrolltobottom-mode' is active. Users wishing otherwise can +suppress that behavior by leveraging `erc-fill-wrap-mode-hook'. This module imposes various restrictions on the appearance of timestamps. Most notably, it insists on displaying them in the diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el index c21f3935503..d54204eb0ce 100644 --- a/test/lisp/erc/erc-fill-tests.el +++ b/test/lisp/erc/erc-fill-tests.el @@ -47,6 +47,7 @@ erc-fill-tests--insert-privmsg (defun erc-fill-tests--wrap-populate (test) (let ((original-window-buffer (window-buffer (selected-window))) + (erc--fill-scrolltobottom-exempt-p t) (erc-stamp--tz t) (erc-fill-function 'erc-fill-wrap) (pre-command-hook pre-command-hook) -- 2.41.0 --=-=-=--