From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs Subject: bug#40856: Feature request: support arbitrary propertized strings in wrap-prefix specifications Date: Sat, 25 Apr 2020 17:24:19 -0400 Message-ID: <30e6aa63-d0f9-d548-3fb9-959f16571b3d@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="48586"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 To: 40856@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 25 23:25:25 2020 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 1jSSIf-000CYt-KB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 23:25:25 +0200 Original-Received: from localhost ([::1]:47926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSSIe-0006i6-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 17:25:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSSII-0006h9-RT for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:25:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSSII-0004ro-Bk for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSSIH-0004r9-Uj for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSSIH-0007lG-QJ for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2020 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40856 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.158784988129802 (code B ref -1); Sat, 25 Apr 2020 21:25:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Apr 2020 21:24:41 +0000 Original-Received: from localhost ([127.0.0.1]:60506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSSHw-0007kc-SB for submit@debbugs.gnu.org; Sat, 25 Apr 2020 17:24:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSSHh-0007kF-IG for submit@debbugs.gnu.org; Sat, 25 Apr 2020 17:24:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52948) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSSHg-0006Gg-RB for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:24:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSSHg-0004GZ-0G for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:24:24 -0400 Original-Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]:46046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSSHf-0004GP-Ia for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 17:24:23 -0400 Original-Received: by mail-qv1-xf31.google.com with SMTP id p13so6528850qvt.12 for ; Sat, 25 Apr 2020 14:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=ZGQi2En9z9T1Q7b7v6cSUg9ae7sBBV1tMPVCr+OsQrU=; b=s1BTTFfSVCmYUxrcqyKn4wHlS13fQqocNaNulGP1sDwX1T3HiJ/kqj+UcK+40q5+ak d1FhYJuYO0StJkrAPyKsYusk7GzvnUHJpVY0n5uzCq724pjG882wMygVFnhJeIQde5uq MC90Lm0mo6Ktx86sN1VnJhsigUz13KTsncNfcLoPJsEu6kC8NeMvinVcKdpDzjYW1qzX z5bwOHAW5zDMHHfDTTs8xUXW1HhdVInQwEdALFPBNNl73BwC0GhTmQGdUGbkK4h7ra5H uAkddjZvBWCicewGdroPOx88E/UmbtFaYYVJPFppV1IaUQbQgn7RZeVcqxPQtwNXrrED XxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=ZGQi2En9z9T1Q7b7v6cSUg9ae7sBBV1tMPVCr+OsQrU=; b=boZHstrXxYpemVnWn9Fk4rFzX1H9fqQDOMrZCKmBmWVpBcKYjJ2ayoQ7MtIGoH1xvs tjNP66wmJanDRI1xx/KSORgYKTygIgwkk+ZNWbIEo818G8wzLVt70BTxUY8OB9k34M7J Dy2Hy82Yd7JcjBW60L5Dpy0rrQWchCdiBm4n/drAuM2yuF+yW6q8lur+GTGXd4p5vUmx x/n7IyWvcZHqClt+74ceXk1AZGJS4YcjJwYEKo1AzCgY13bdbz8fakL5eOxG3Z9xewoh l/mnHkmJbS9gPx4LoA69n3QW/bNCcXqUtQPvq9DGACMc49mMQTpDYhHFtkKsblDGM1kX pUOQ== X-Gm-Message-State: AGi0PuZkDT+XFroo4hFY8JV9u18x5FgIdQ5oKAexanGRk9r+BEw7vVW4 feDNRqkDVcTa9K4mfUAQ8WPHm/cHaMY= X-Google-Smtp-Source: APiQypL1SWB7d3xANA9NaoEs68HM5Skt7dsDkBG75majRS1RTtr7ixdQoriGB6fcwV9toqLYmbK8Ag== X-Received: by 2002:a0c:e549:: with SMTP id n9mr15803208qvm.214.1587849862272; Sat, 25 Apr 2020 14:24:22 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:54d6:bfeb:aa49:9d3b? ([2601:184:4180:66e7:54d6:bfeb:aa49:9d3b]) by smtp.googlemail.com with ESMTPSA id 63sm6432185qkl.64.2020.04.25.14.24.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Apr 2020 14:24:21 -0700 (PDT) Content-Language: en-GB Received-SPF: pass client-ip=2607:f8b0:4864:20::f31; envelope-from=cpitclaudel@gmail.com; helo=mail-qv1-xf31.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 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:179038 Archived-At: Hi all, The wrap-prefix property is very convenient, but it's hard to use for alignment when the width of the item to align to is not easy to compute. For example, to get the following effect, it's easy to use 'wrap-prefix " " - Test wrapped wrapped But take a more complex case, like this: xyz ⟝ abc wrapped wrapped Depending on the font in use, the ⟝ character may be more or less wide. So, the wrap prefix can't just be " " here; it needs to be calculated using `window-text-pixel-size`, which is costly if it needs to be repeated for many lines. Additionally, this calculation becomes obsolete and needs to be redone as soon as the user changes the font size. Or consider the first example again, but this time with non-monospace text: - Test wrapped wrapped Depending on the width of "-" and of the space in the current font, the with of the wrapping prefix should be different. Specified spaces can already measure the width of an image and many other elements. Could they be extended to measure an arbitrary string? Concretely, one would use (:space :width "- ") in the first case and (:space :width "⟝ ") in the second case, and get perfect alignment. This is similar to what LaTeX calls "phantoms": spaces whose width is exactly that of their argument text. Clément.