From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.bugs Subject: bug#54406: 28.0.91; rcirc text wrapping Date: Tue, 15 Mar 2022 18:24:22 -0400 Message-ID: <87h77yc0rt.fsf_-___8528.07644275657$1647383138$gmane$org@redhat.com> References: <87lexac44t.fsf@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) To: 54406@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 15 23:25:34 2022 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 1nUFbh-0008Dj-LB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 23:25:33 +0100 Original-Received: from localhost ([::1]:43586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUFbg-0000Wf-2B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 18:25:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUFbC-0000WV-7i for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 18:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUFbB-00075i-UX for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 18:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUFbB-0004xy-Li for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 18:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Raeburn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Mar 2022 22:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54406 X-GNU-PR-Package: emacs X-Debbugs-Original-To: help-debbugs@gnu.org (GNU bug Tracking System) X-Debbugs-Original-Cc: 54406@debbugs.gnu.org Original-Received: via spool by 54406-submit@debbugs.gnu.org id=B54406.164738308719063 (code B ref 54406); Tue, 15 Mar 2022 22:25:01 +0000 Original-Received: (at 54406) by debbugs.gnu.org; 15 Mar 2022 22:24:47 +0000 Original-Received: from localhost ([127.0.0.1]:49780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUFaw-0004xN-TU for submit@debbugs.gnu.org; Tue, 15 Mar 2022 18:24:47 -0400 Original-Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUFav-0004xF-5U for 54406@debbugs.gnu.org; Tue, 15 Mar 2022 18:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647383084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOX2nZJSm5BoL9jqkQod5bg5lhsd45WNWqcIed4tvHE=; b=O8OoGJhBDXSbr5TyQihmSm/KFdYwy7Km5NTooaOKKwdSD7RYyHUro5MtWUjNHviG7Ye4tq xbk4pCKs0gsmAuy1JzgNOVeIA59/VvgR979FQ15c7TMgNXt36jBA+y5qdFx4JlRUkg+Q+M Gb+k9m9SyxSKfF6IZD/tIRyvkuKYlbs= Original-Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-626kt1iJN-2Oefc8HCh74g-1; Tue, 15 Mar 2022 18:24:25 -0400 X-MC-Unique: 626kt1iJN-2Oefc8HCh74g-1 Original-Received: by mail-qv1-f72.google.com with SMTP id hu9-20020a056214234900b0042c4017aeb3so500244qvb.14 for <54406@debbugs.gnu.org>; Tue, 15 Mar 2022 15:24:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=CgsH9xwU4i871xi6b1MJDvZgylaRp2kBcVddaCKgM1Y=; b=PbNPK0PeaddlBZr6LMSfN+oNFGtEAkby5O3FapCD7sr5YT+/NQSiB1EqwlTblEzlMv BP/XSBaTe13m/jVIEPANJuivILxOS4MhdfmYiOcqHAQ3rXetkP8pcKiDBHeZGdoT49Ik HZixmKV/0cozueZrArI9EWM+TaCnQLRzgJm3sWCJnRTnmjHyECYqZJAbxTF1IE0XQoy3 tB1/eLvdR26RnjDwMcdFX/toPElidldYe+oLbogclkaw/q+LcvPsxIEBIVynH9OBf7ZD xZpHt4ntahTrgtNjTnsZsFUnZ7Bfk0NQvDa3FobtcQ8rN03bBMqKLQg4IYJNkcdY61yK JDPQ== X-Gm-Message-State: AOAM531xer1RKC70vjYYkXnlB+w6q1ey7QFhXsBPsyktcT6+mQj1Zzid yGAUSxfsut9+EO+ea6L9wv4ppY2jXp8JwereGD6rZ6qyY4jxNNl1qyA5oCvBO65iovD+goF94+t 8fuqbKC2cYcPod2A= X-Received: by 2002:a37:9c96:0:b0:67d:7293:7374 with SMTP id f144-20020a379c96000000b0067d72937374mr15915032qke.365.1647383064582; Tue, 15 Mar 2022 15:24:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6QlTBsCkQ8YitOq/h47m5yPLGUaZSAtQYVtVe2bfHmARKdcQozcfjZ99mRCgDr9R9gRwm1Q== X-Received: by 2002:a37:9c96:0:b0:67d:7293:7374 with SMTP id f144-20020a379c96000000b0067d72937374mr15915024qke.365.1647383064331; Tue, 15 Mar 2022 15:24:24 -0700 (PDT) Original-Received: from crash (c-24-60-138-149.hsd1.ma.comcast.net. [24.60.138.149]) by smtp.gmail.com with ESMTPSA id v12-20020a05622a130c00b002e1b3ccd9adsm168663qtk.79.2022.03.15.15.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 15:24:23 -0700 (PDT) In-Reply-To: (GNU bug Tracking System's message of "Tue, 15 Mar 2022 21:13:01 +0000") Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=raeburn@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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:228424 Archived-At: Aha, debugging printfs to the rescue. :-) I made a little tweak to rcirc-print, and added some logging advice to rcirc-markup-fill and rcirc-fill-paragraph, then just sat back and waited for some #emacs traffic; this is the one that triggered: (save-restriction (narrow-to-region (point) (point)) (insert (propertize (rcirc-format-response-string process sen= der response nil text) 'rcirc-msgid (rcirc-get-tag "msgid")) =09=09 (propertize "\n" 'hard t)) ;; squeeze spaces out of text before rcirc-text ;; ADDED MESSAGE CALL: =09 (message "rcirc-print(process=3D%S sender=3D%S response=3D%S targe= t=3D%S text=3D%S activity=3D%S)\n\tfilling region: buffer=3D%S region=3D%S = flag=3D%S" =09=09 process sender response target text activity =09=09 (current-buffer) =09=09 (buffer-substring (point-min) (point-max)) =09=09 rcirc-fill-flag) (fill-region (point-min) (point-max)) rcirc-print(process=3D# sender=3D#("userxy" 0 6 (f= ont-lock-face (rcirc-other-nick))) response=3D"PRIVMSG" target=3D"#emacs" t= ext=3D"a bunch of text here" activity=3Dt) =09filling region: buffer=3D# region=3D#(" a bunch of text here " 0 1 (rcirc-msgid nil) 1 7 (font-lock-face (rcirc-other-nick) rcirc-msgid = nil) 7 9 (rcirc-msgid nil) 9 96 (rcirc-text "a bunch of text here" rcirc-ms= gid nil) 96 97 (hard t)) flag=3Dnil (For privacy, I=E2=80=99ve replaced the sender name with a same-length dumm= y, and replaced the message text, though mine is shorter so the text properties probably don=E2=80=99t work out.) The old version in 27.1 did: =09 ;; squeeze spaces out of text before rcirc-text =09 (fill-region fill-start =09=09=09 (1- (or (next-single-property-change fill-start =09=09=09=09=09=09=09 'rcirc-text) =09=09=09=09 rcirc-prompt-end-marker))) where fill-start is set to (marker-position rcirc-prompt-start-marker) evaluated before inserting the new text. The new version seems to be filling the entire narrowed region containing the just-inserted text. As an experiment, I=E2=80=99m trying (fill-region (point-min) =09=09=09 (1- (or (next-single-property-change (point-min) =09=09=09=09=09=09=09=09'rcirc-text) =09=09=09=09 (point-max)))) and it seems to do what I want so far, both for NAMES messages and user messages. The property change is also looked up by the goto-char immediately following the fill-region, so perhaps they could be reversed and the new position used as a boundary. Though, it seems to be filling the part of the rcirc-response-formats formatted string that comes before the message text, and it=E2=80=99s not c= lear to me that unconditionally filling that is the right thing, if rcirc-fill-flag is nil. *shrug* I=E2=80=99m not a terribly experienced IRC = user, maybe it is generally desired. Ken P.S. The indentation of the =E2=80=9Cwhen=E2=80=9D blocks following the got= o-char could use cleaning up.