From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71605: 30.0.50; [PATCH] Support variable-width text in 'visual-wrap-prefix-mode' Date: Mon, 17 Jun 2024 22:23:01 +0800 Message-ID: References: Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71605@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 17 16:24:34 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 1sJDHd-0004Pd-Rv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jun 2024 16:24:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJDHB-0004n4-Cn; Mon, 17 Jun 2024 10:24:05 -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 1sJDH9-0004m4-M7 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 10:24:04 -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 1sJDH8-0003vC-CT for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 10:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJDH8-0007U8-Bm for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 10:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2024 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71605 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71605-submit@debbugs.gnu.org id=B71605.171863418528700 (code B ref 71605); Mon, 17 Jun 2024 14:24:02 +0000 Original-Received: (at 71605) by debbugs.gnu.org; 17 Jun 2024 14:23:05 +0000 Original-Received: from localhost ([127.0.0.1]:34819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJDGD-0007Sq-8Q for submit@debbugs.gnu.org; Mon, 17 Jun 2024 10:23:05 -0400 Original-Received: from sonic305-21.consmr.mail.ne1.yahoo.com ([66.163.185.147]:42020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJDG9-0007S3-VA for 71605@debbugs.gnu.org; Mon, 17 Jun 2024 10:23:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1718634171; bh=+nlvkuKd23bBFYJ5AtUgpSjsEyFqX5taL9m7oNROqeI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=sTA2GnOBfamkE3T1a9ggSehQUlDyaiAUVz4C0dBO7njVFAu5Y+SIh/Nx9S7F9JMZ1fDnbmfTDW6HPsPXf23ld45iTW8DS1vaG+DfGUYj1nJnUiEGcAApwmCxWsI8zr2Gq3IzuGuZ5doR+753hDyZuTL8LFBXNztjkkTdmRDM8uijE/nTRzpGWaNOgybUmTgW+0n7DjmmYMRc9L/ASvUA2l/4fBL43EVJ7R1QH1/Fzskph1wCiELeFGhd9qEhHVJaszRqOCdtSY62AgAfja6eqviNcQAIaBT5kb27tJVg3crSdv4Jg866zYwsbHhqmDL0EK5smfadUwI4KXqxX+1YNg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1718634171; bh=j3fUQ7HztLrhKyP6UV+EsKNB25kWlftPgdstjIPraj0=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=mkgLLzo/VxZRVziqrkOfr4TUQmSsHzuovSP58DtaZQJSOX4v43MOa1A7Y07bdc4QJJSoEoGTp5DUucy7aPKNTb3vRYazoXLcy2ObWGVCNeisoAw512jg7501CgWD2h6PAm5e24EJAo4qhgIOJNGKf3ed6phd+mP/RTEe8O8V1su6OZTElmolg/gKvvrMyhDaq9WiYSCj9OebSaVb2+dHYRWwGp1ZBq0X/vJ84a2MS1PbySGHfF5n8CxWT5skdN+ZiobDrY3kvst1gj4Tf3zuqnubDDWEiamKsuD+6gKHa9p7rIHr85hz42mqrq+dTo7YYq8x2YP1WJSOXPj+m2rTBw== X-YMail-OSG: 0uNetCgVM1m0E8TxcT8ctM4BAW.A2Rn5IR6q7agRZpZYWdVHOkP59Jztx9vw1Ln urdv2g.PJuMKqdck_cRf93A5qjKAIdiR4NJ0K8tRnUxqUTYYM0ERe94uiYwGmB1wzc.4WVy8Wy_i 0u2GIU3RIqJ4YX67tfaQLi3f7kfB0rGJJfdIJWsA62uPAOE_VpPg.PWDzCOLvUAtN_zrZtrVGH3A YDaUlTWDvfC61T6PyD2mPntDewcxgdZmNVnlg5AT05Q543r1m2KaPNn.K0Cq2r36H_FSOxOIrtP3 6FDI8IxUCa4IP.kG5kUKCvX9aOBuwyVIrIyKuc_9RvOm487K6uG9eagaoBHARFwH9aUe_cJSNaS8 OuvpVyJlfx8YeGj50j1KiFYU1w4b1Y58mY6J5wmyc5QnZ9UAskZkQABXUaq_yxu6K2CgtmWdulBy W800VErlme_WRkIApePH5BU6euV2hS1CJH6t2L2vC25FY7l7MUbO8mF.sPEuvvMDUMITfdNJsGJi 38vY1HDXTpnQVzs_aUFcXc93Vxx_aiqgOLTsqp5b2LE.ybIENd.FAL5kKBySUzdmbUEbA_WJ0_NM K4IrwzFOsucWlA_IY9kRkz0A3WGABfjxQ6vPl3tjOEWva3Q5DAZxu6y.kTWolEHHpGb28CeX4BXl daN04RPvM9f2mkIjfrmMs187CmwowoiwjGmMksSvUiEEgqBmJwJuoXUucejRZp.hUox76.YezLas Cmj43pZXPmuD10JHCZcuhrHuW0FifwzuWqpIQcKPaumweYRB6i9qDfX_4f_SfLIuetVuvzlRAi9M gKQK1zEWWq9r9zHn9OKw16CSGWmJ0RUvx0xL4sfsh_ X-Sonic-MF: X-Sonic-ID: 01ece84a-6b95-4c3e-b73b-e9bf5d88d8c2 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Mon, 17 Jun 2024 14:22:51 +0000 Original-Received: by hermes--production-sg3-7b469d9f6-d5m7f (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 3face74ae25bb39a71530b1ae57ab5f4; Mon, 17 Jun 2024 14:22:49 +0000 (UTC) In-Reply-To: (Jim Porter's message of "Sun, 16 Jun 2024 19:56:44 -0700") X-Mailer: WebService/1.1.22407 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:287394 Archived-At: Jim Porter writes: > (Note: I plan to merge this only after we cut the Emacs 30 release > branch, since it seems a bit too substantial a change to sneak in > right near the end. However, I think the patch is mostly done aside > from one remaining issue, so any feedback is very welcome.) > > 'visual-wrap-prefix-mode' has one small issue: since the wrap prefix > is just a string, the wrapped text may not line up for variable-width > fonts. This is mainly in cases like so: > > * here is some text that > got visually wrapped > > If the "* " is variable-width, the second line will probably be > indented wrong by a few pixels. > > The attached patch adds a display spec in this case so that the text > lines up perfectly. There's currently one problem though: I'm not sure > how to regenerate the wrap prefix automatically if the face > changes. It's not hard to handle for 'text-scale-adjust', but I don't Actually, there's more than just this one problem. To start with, the existing format of the generated line prefix properties enables the extracted fill prefix to be displayed consistently on any frame, whatever the metrics of its default font/face. This I consider a far more critical capability than perfect alignment of wrapped text in the presence of a variable-pitch default font, as the latter is virtually unknown among programmers, and also unimplementable within reasonable standards of performance with pixelwise spacers. If this is to be installed, please condition it behind a user option and restore the existing logic that you have effaced as the default.