From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#37858: 27.0.50; Ensure a minimum width for `space` display prop Date: Tue, 22 Oct 2019 10:03:46 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="233571"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37858@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 22 10:12:45 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMpHZ-000yeL-AI for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Oct 2019 10:12:45 +0200 Original-Received: from localhost ([::1]:51402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMpHX-0004IY-MH for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Oct 2019 04:12:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43319) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMp99-0002ix-7h for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 04:04:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMp98-0001T1-5W for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 04:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMp97-0001Sq-VQ for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 04:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMp97-0007bj-Pk for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 04:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Oct 2019 08:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37858 X-GNU-PR-Package: emacs Original-Received: via spool by 37858-submit@debbugs.gnu.org id=B37858.157173143629232 (code B ref 37858); Tue, 22 Oct 2019 08:04:01 +0000 Original-Received: (at 37858) by debbugs.gnu.org; 22 Oct 2019 08:03:56 +0000 Original-Received: from localhost ([127.0.0.1]:58199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMp92-0007bQ-Hl for submit@debbugs.gnu.org; Tue, 22 Oct 2019 04:03:56 -0400 Original-Received: from mail-wm1-f47.google.com ([209.85.128.47]:55208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMp90-0007bB-FU for 37858@debbugs.gnu.org; Tue, 22 Oct 2019 04:03:54 -0400 Original-Received: by mail-wm1-f47.google.com with SMTP id p7so16055528wmp.4 for <37858@debbugs.gnu.org>; Tue, 22 Oct 2019 01:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=w5rWEuC5SQ/xd0BUyhvPJrUYt/wugWYCX7fi8DEdPgU=; b=q9JKxS9BXGWSckPVDdcEaN+Mw8yOVJkF7aQfiGMEi9pAyC5Soqin2Ot8yU7lX5+Ak9 ketUNoZbIKJp5/sJDhAEx5M3jVxq35Igk2WvFg/R95GhF8HSfT3/tErx0oP8QgeFshki KcHtAi8cqZ8nEZD6tVMYfUlKElWq+sfd5/BkYBdbFvp/WU9wi4ewAMG5WTDe5txPoIw2 CecTwEPJtGz5HG7nOPGAJecJKtwcS5FBbq6u9joZlHxGOu3kxzeB9RJRQgHBt/YOVlgX R9HP8F3W75Hf+0oRUeeE+4ALo06ohgQ4NuS2ArOECIZxaRuDvnyiT7G8nAruw73B1duo 4f3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=w5rWEuC5SQ/xd0BUyhvPJrUYt/wugWYCX7fi8DEdPgU=; b=KotO0nBCJ8U1/vqyilQzx+B3J6fqZneyHSTnf5qWd384nQX/O2I6oBQr6p4bRWE3vk X/biBJe1oKCDsqUUfCvcKr32cNUtNEe8ZfWsETHDjqtE3JhdRLNhV0cRxoBkB16poOQR i/Rp0zlBknPFCU3YMMUr+VgWLWXUlj/smvrf8U8CuQGcVzbPgRdKnwmeiptcNZOAQRln 5PrwxixxikI92nU4h4jOnjmtEc+TLqilngcuH3f4gR1CvdxrPX/Dq4xMwcC9UFPKrSV5 rX7saIXVR9dx/BAeCieiht10gE5r/ncYi5S+GjnRVcpsesoIGOYPNiABNAwH2ThAHVHp qPNQ== X-Gm-Message-State: APjAAAXD7GIPk9tDfLly4LmePVWn35tzJyz07dZyKbqgb6NxC1qfvWgc 2mlPZxFCZVh6pbPteHlQ9eaU3jZL X-Google-Smtp-Source: APXvYqyALAj2DSY5y3ixDopOgNRx2rDbTsDT862ABFW+4x627Lh2dg0qVkOKTW/7K7jtcuo273W13A== X-Received: by 2002:a1c:a70e:: with SMTP id q14mr1601436wme.86.1571731428220; Tue, 22 Oct 2019 01:03:48 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id t10sm21213321wrw.23.2019.10.22.01.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 01:03:47 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Stefan Monnier's message of "Mon, 21 Oct 2019 16:03:58 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169971 Archived-At: >>>>> On Mon, 21 Oct 2019 16:03:58 -0400, Stefan Monnier said: Stefan> Package: Emacs Stefan> Version: 27.0.50 Stefan> For text displayed in columns, alignment is generally obtained = with Stefan> a `display` text-property of the form Stefan> (space :align-to FOO) Stefan> This works great when the previous text ends before FOO, but wh= en we Stefan> mis-calculate (or didn't calculate at all) and the previous tex= t already Stefan> extends further than the desired alignment of the following tex= t, such Stefan> space is reduced down to 0 pixels which is often not what we wa= nt. Stefan> Sometimes one can workaround this by placing 2 spaces in the bu= ffer: one Stefan> with the :align-to and another fixed size space. But it can be Stefan> cumbersome to do that and it leads to undesirable artifacts (e.= g. the Stefan> cursor can be placed between the two space). Stefan> So, I'd like to extend our `space` specifications so as to be a= ble to Stefan> specify a minimum width. I came up with the patch below which = lets you Stefan> write: Stefan> (space :align-to FOO :min-width BAR) Stefan> which seems to work fine, but while trying to update the Elisp = doc for Stefan> it I realized that maybe a better option is to extend the accep= table Stefan> forms for FOO so it can be of the form: Stefan> (space :align-to (max FOO (+ BAR current-x))) Hmm, I think I probably prefer the former. Perhaps when you've documented the semantics of your :min-relative-width addition I=CA=BCll be able to judge better :-) Robert