From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#71605: 30.0.50; [PATCH] Support variable-width text in 'visual-wrap-prefix-mode' Date: Sun, 4 Aug 2024 12:24:38 -0700 Message-ID: <0809f4ea-c113-2f5c-929d-9c241aafa040@gmail.com> References: <868qz3ssu0.fsf@gnu.org> <201c2285-012f-fa29-03b5-78a2e26aa134@gmail.com> <86plsfqvme.fsf@gnu.org> <66e7c49d-adb6-186f-18f1-33eee9f668ad@gmail.com> <86h6dqqy63.fsf@gnu.org> <86iky5p34b.fsf@gnu.org> <8269125b-7e9c-ffde-be9e-4a07c42ce6a5@gmail.com> <86o77wnrb7.fsf@gnu.org> <060e1362-a206-4c88-b49f-60e4f5da7238@gmail.com> <86a5jgndev.fsf@gnu.org> <86plsbmqqn.fsf@gnu.org> <94aeb67a-8aa3-998f-720e-fbdc42c6b0ab@gmail.com> <81d8d283-6f7e-0d09-7ae3-fb99def408d9@gmail.com> <86zfpvv0zf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28661"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71605-done@debbugs.gnu.org, luangruo@yahoo.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 04 21:27:01 2024 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 1sagsf-0007Kf-1Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Aug 2024 21:27:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sagsN-0002MI-EU; Sun, 04 Aug 2024 15:26:43 -0400 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 1sagsL-0002LW-O8 for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 15:26:42 -0400 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 1sagsL-0005j8-6L for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 15:26:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=potSCVzd4ROZ/XR5PZEiAWXs/0YqtQxvp7FGHp6CCq4=; b=t6yjiPxa3agdwfi/8S4GB4cPGJGN3cKOnEJZR2oxueRhh5gf+aLNICvWBwk2qWzM7QzuY9Qp5yXikNZq7lm+hTKV130TOB27OgqO4Gz6rj8hY7k6xFM/RsfDOJL2LlZkzhvcGbzRsYaOf2IYXyt3OL/zTHCJNo4Mc4cMysEtlQoZWcH8UBGX1VAZYxMRaCqhdRlhrQ0vAZ/siu8JmrsifOgz4K1Rt/hl0Dw8e25YJXaIFo9NqSKhDb29K+sRCaQekAsEqq8KDM+o3JB+mpP2VzFtnBRtjLULr/Z3x3EiDwc/4LC/+GE3Mo2wPItgF8DlsH8KuOVDeEJN4uV3tznNIg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sagsg-0002D7-Bo for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 15:27:02 -0400 Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Aug 2024 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 71605 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 71605@debbugs.gnu.org, jporterbugs@gmail.com, jporterbugs@gmail.com Original-Received: via spool by 71605-done@debbugs.gnu.org id=D71605.17227995718321 (code D ref 71605); Sun, 04 Aug 2024 19:27:02 +0000 Original-Received: (at 71605-done) by debbugs.gnu.org; 4 Aug 2024 19:26:11 +0000 Original-Received: from localhost ([127.0.0.1]:57282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sagrr-0002A9-8g for submit@debbugs.gnu.org; Sun, 04 Aug 2024 15:26:11 -0400 Original-Received: from mail-pf1-f182.google.com ([209.85.210.182]:58460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sagrp-00029a-A3 for 71605-done@debbugs.gnu.org; Sun, 04 Aug 2024 15:26:09 -0400 Original-Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-70d333d5890so9083993b3a.0 for <71605-done@debbugs.gnu.org>; Sun, 04 Aug 2024 12:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722799480; x=1723404280; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=potSCVzd4ROZ/XR5PZEiAWXs/0YqtQxvp7FGHp6CCq4=; b=j9nSgN4+7MzWu3pUfPaRMzP9cUpOhtilt87+AWEyy3QIXIscit20QhJ5okBskr475K LqdOLHTNRXV3oo8aBlIIMcD3V+92iH2+wO3QquawFwmdKBnpWa7ilh6j/Hhm7rIc2HwQ 8bAqYbrOhgaNZMFvk0JNLeKTnlkThVpctms7x1o2BfQu6iNhM15N7YC0Mxl1Jad37mRi ZPIppYabv2K0fs9WgnJO0XwTdy0+eIa9prWKkYf9QIBpqddMc8Md3k//DlZmlMx+pQQs qTWKKA/tfV/+6CvjA9Ma7t3t+UkrUP9s5RyuejtMXOeSoAxGtQ0WNKw4rAWLk/BE8fl6 TnMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722799480; x=1723404280; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=potSCVzd4ROZ/XR5PZEiAWXs/0YqtQxvp7FGHp6CCq4=; b=PbAh826A58XqwHsRJcCcCDpM6tNWYZC/qtdVCrGdv2z7ShjBzstYRqDqzHUulIkV6l /zq1JxL1/cY6p3YPRvXTko6oaHC1clUeoC/pmtwK3yl51tw225Vf2doJ23CSznR5vXsT Wb4/Alu8CkfYHZxP5hl1AR42yRoTiLOJYg3IWdm8iH4eS9GIpO8SOmoMvVo8WmVXm+k6 hnot89xNj0Cf3aInfva5SoiQ99XykP/omuGGflunUuciQ+0+vWJFxW6hFuKDxzb/VjkG iOQBYBOBVsWSi8UaL/1m8wnT0CpprBjhYnTkPtMfxLV1RRe1uMewk7fMOJSOqPxLsXsD pgYw== X-Gm-Message-State: AOJu0YyyAHVKuV68YXNqFIS6MHBjMa7/8dL/3wyMjAR97IcdOY3bCd30 3mAgF9ADIGazgNi68fgcXMoyrOupZWPgqbXBjlnDlZTUl+Fj+rxR X-Google-Smtp-Source: AGHT+IG+I3VDFAVFXMjbkenxK6zpUfxCBJfhM5Eu1VB0ZVSDpvSZsdlHPXjdq1Ra0SqpTeVDoZ92Bw== X-Received: by 2002:a05:6a21:e8d:b0:1c4:d4b2:ffe5 with SMTP id adf61e73a8af0-1c699703522mr10755165637.54.1722799479604; Sun, 04 Aug 2024 12:24:39 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id 41be03b00d2f7-7b764fb4edfsm4214940a12.69.2024.08.04.12.24.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Aug 2024 12:24:39 -0700 (PDT) Content-Language: en-US In-Reply-To: <86zfpvv0zf.fsf@gnu.org> 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:289775 Archived-At: On 8/2/2024 12:27 AM, Eli Zaretskii wrote: > LGTM, thanks. Feel free to install on master. Thanks, merged to master as f70a6ea0ea8. Hopefully this patch maintains all the existing correct behaviors and fixes most of the issues with variable-pitch text. To summarize, this is how things *should* behave (anything else is probably a mistake; just let me know and I'll try to fix it): 1. With fixed-pitch fonts, everything should look the same as before. 2. With variable-pitch fonts in a terminal frame, everything should look the same as before, but... a. If you then open that buffer in a GUI frame, there's a small chance that the first line of a bulleted list will be too wide. This can happen if the prefix contains wider-than-average characters in the specified font. 3. With variable-pitch fonts in a GUI frame, wrapped lines in bulleted lists and the like should now lined up correctly in GUI , but... a. The first line might have a bit of extra space after the bullet. (The space occupied by "* " or what-have-you is rounded up to an integer number of canonical-width spaces.) b. If you then open that same buffer in a terminal frame, there's a small chance that the text after the bullet will have an extra space (same with the wrapped text). This can happen if the prefix contains wider-than-average characters in the specified font. c. If you change the font of the wrapped text to something with different metrics, there's a small chance that the first line of a bulleted list will be too wide. 2a and 3b would probably be fixable by using overlays restricted to a particular window. 3c would probably be fixable by calling 'jit-lock-refontify' at the appropriate time. While that's quite a few caveats with the current implementation, I think overall they should only come up in rare cases, and should never affect fixed-pitch text (which is the only thing 'visual-wrap-prefix-mode' could work correctly with before).