From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.bugs Subject: bug#70637: :box vertical bar artifacts at 'display boundaries Date: Sat, 11 May 2024 13:16:54 -0400 Message-ID: <50FDEC29-AFDE-4BBB-A332-C2E346357E48@gmail.com> References: <646DB63C-1CD0-4BF4-8303-4A92B06D08DE@gmail.com> <867cggs8h9.fsf@gnu.org> <86y18wqpmk.fsf@gnu.org> <86o79sqj1r.fsf@gnu.org> <86r0eb77xq.fsf@gnu.org> <86cyps3ctb.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_6A897F67-9BA8-4CF3-BB35-A45070CF5730" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3280"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70637@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 11 19:19:29 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 1s5qNc-0000cn-JJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 May 2024 19:19:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5qNF-0000H6-0u; Sat, 11 May 2024 13:19: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 1s5qNC-0000G6-U1 for bug-gnu-emacs@gnu.org; Sat, 11 May 2024 13:19:02 -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 1s5qNC-0007Bk-Lu for bug-gnu-emacs@gnu.org; Sat, 11 May 2024 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5qNB-0003qm-QL for bug-gnu-emacs@gnu.org; Sat, 11 May 2024 13:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: JD Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 May 2024 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70637 X-GNU-PR-Package: emacs Original-Received: via spool by 70637-submit@debbugs.gnu.org id=B70637.171544789514792 (code B ref 70637); Sat, 11 May 2024 17:19:01 +0000 Original-Received: (at 70637) by debbugs.gnu.org; 11 May 2024 17:18:15 +0000 Original-Received: from localhost ([127.0.0.1]:49393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5qMQ-0003qW-UG for submit@debbugs.gnu.org; Sat, 11 May 2024 13:18:15 -0400 Original-Received: from mail-io1-f47.google.com ([209.85.166.47]:59851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5qMO-0003qQ-Um for 70637@debbugs.gnu.org; Sat, 11 May 2024 13:18:13 -0400 Original-Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7e1b2daaaf9so128877639f.3 for <70637@debbugs.gnu.org>; Sat, 11 May 2024 10:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715447827; x=1716052627; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=IYOsQUWIbOWyjCT3dP7cXxTHVnByKOdZ9bkhs3xchG4=; b=K/+Ss9URB7OqLUNapPkmKb/LpoXFwzv/bYjEbQLzc1/kC95Ujla0j5drUBMTl8ldFZ QPofQ2d+nfbZLMr/+dxva8cnyhQFkPQhMO/TNhU21IJi5K+JAnAjjt9NvnTrbdyYpcRQ B7P2uFLFXLw1T53S6l51c5FNbuF+bwWFUtjiyIW89AYoHwHcXw4Ij/9P2x6s83mikJKu hOP8mGDmBa+NPoV2NusvwsNAEFgoomHqPiEwJ/A8Hl60S3BA1VQLILhJJCMGNQYTExrf B2r1sssqIR+sGv25ga+/mI+XIwOe+XJ3lnvXB0+h+YewdkdaQ7b9FVjN6OdkuwwliBGw O4sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715447827; x=1716052627; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IYOsQUWIbOWyjCT3dP7cXxTHVnByKOdZ9bkhs3xchG4=; b=aonJTl0D3vWxJ2AqDqNzAJZAGhEtcA7nA16KQcEMemCKIn4hlrtL7UuS/zYRhy39Yh 4AuhA71vCfVAmMXUhCIQeH10Ifo+IdmpZvOVLkRG4SJxG6D0G84y7OH3IhMPXLIveC7A 266qDcrzgfJ0ffVArbUYl2Nnuvp+CC/FrdGdwCAS7t54npbh3lgSZmwwmAazGiacCwYC mmxoF0B8fCR4BlY6zd8v5824EcIKJ+SRnfjJ5XgNbrO4vLR88LTuZJ8lUJeBJv2lgb8i f9nv9qUbi4qkAlBXTMAEKbE6kUW8cVh8ppPOHJy4lUyTAOPLk1k8jaiJ5hYfBup+XJIQ v22w== X-Gm-Message-State: AOJu0Yw/z1OTatuAoEu7Ku7OLvSxeZRmDgaPzYGnO6wGdWRreZVirXZm pYoO+jcuVwnAlalJ0S4zihOdlKGBsI9T+ggFxheY4bI1Te70Tsgp X-Google-Smtp-Source: AGHT+IHw26EvnlZ9H2FPYUyORLfnMtKqYHFhwDmLdom8uJwaLGN8jQw5SsWzq7qhv/gYucY7zPrwPg== X-Received: by 2002:a5d:8c85:0:b0:7e1:8255:93c with SMTP id ca18e2360f4ac-7e1b519cca4mr813826839f.1.1715447827549; Sat, 11 May 2024 10:17:07 -0700 (PDT) Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4893714159csm1548496173.65.2024.05.11.10.17.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 May 2024 10:17:06 -0700 (PDT) In-Reply-To: <86cyps3ctb.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.500.171.1.1) 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:284877 Archived-At: --Apple-Mail=_6A897F67-9BA8-4CF3-BB35-A45070CF5730 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 11, 2024, at 5:41=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: JD Smith >> Date: Thu, 9 May 2024 09:31:28 -0400 >> Cc: 70637@debbugs.gnu.org >>=20 >> I presume this is a more general issue than just :box. One idea is = to add a warning to the Elisp section "Display >> Specs That Replace The Text", perhaps at the end: >>=20 >> Note: certain `face' attributes such as `:box' can lead to display = artifacts when applied to the replacing >> text in a `display' specification. These attributes may be = incorrectly merged with adjacent non-`display' >> `face' properties. This can be mitigated by applying the `face' = attributes directly to the text being >> replaced, rather than (or in addition to) the `display' replacement = text itself. >=20 > Actually, this is specific to :box, since only for that attribute we > need to determine the beginning and the end of the box. >=20 >> Maybe a bit too wordy. >=20 > Yes, I agree. If you can reword it to be specific to :box and to > include an example, I think it would be good. Feel free to edit: Note: Using `:box' attributes in replacing `display' text adjacent to = normal text with the same `:box' styling can lead to display artifacts. = These can be avoided by applying the `:box' attribute directly to the = text being replaced, rather than (or in addition to) the `display' = replacement text itself. ;; Causes :box artifacts from the cursor (progn (put-text-property 1 2 'display (propertize " [" 'face '(:box t))) (put-text-property 2 3 'face '(:box t)) (put-text-property 3 4 'display (propertize "] " 'face '(:box t)))) ;; No :box artifacts (progn (add-text-properties 1 2 '(face (:box t) display " [")) (put-text-property 2 3 'face '(:box t)) (add-text-properties 3 4 '(face (:box t) display "] "))) --Apple-Mail=_6A897F67-9BA8-4CF3-BB35-A45070CF5730 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On May 11, 2024, at 5:41=E2=80=AFAM, Eli Zaretskii = <eliz@gnu.org> wrote:

From: JD Smith <jdtsmith@gmail.com>
Date: Thu, 9 = May 2024 09:31:28 -0400
Cc: 70637@debbugs.gnu.org

I presume = this is a more general issue than just :box.  One idea is to add a = warning to the Elisp section "Display
Specs That Replace The Text", = perhaps at the end:

Note: certain `face' attributes such as = `:box' can lead to display artifacts when applied to the replacing
= text in a `display' specification.  These attributes may be = incorrectly merged with adjacent non-`display'
`face' properties. =  This can be mitigated by applying the `face' attributes directly = to the text being
replaced, rather than (or in addition to) the = `display' replacement text itself.

Actually, this is = specific to :box, since only for that attribute we
need to determine = the beginning and the end of the box.

Maybe a bit too wordy.

Yes, I agree. =  If you can reword it to be specific to :box and to
include an = example, I think it would be = good.

Feel free to = edit:

Note: Using `:box' attributes in = replacing `display' text adjacent to normal text with the same `:box' = styling can lead to display artifacts.  These can be avoided by = applying the `:box' attribute directly to the text being replaced, = rather than (or in addition to) the `display' replacement = text itself.

;; Causes :box artifacts = from the cursor
(progn
  (put-text-property 1 2 'display (propertize " =  [" 'face '(:box t)))
  (put-text-property 2 3 'face '(:box = t))
  (put-text-property 3 4 = 'display (propertize "]  " 'face '(:box = t))))

;; No :box = artifacts
(progn
  (add-text-properties 1 2 '(face (:box t) display = "  ["))
  (put-text-property 2 = 3 'face '(:box t))
  = (add-text-properties 3 4 '(face (:box t) display "] =  ")))

= --Apple-Mail=_6A897F67-9BA8-4CF3-BB35-A45070CF5730--