From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark E. Shoulson" Subject: [PATCH] strike-through text in tables Date: Thu, 5 Mar 2020 10:30:48 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------FD0D3859F0015FC67BB86CD2" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47394) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9sSY-0003MD-UD for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 10:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9sSX-0003QH-Ic for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 10:30:50 -0500 Received: from pi.meson.org ([96.56.207.26]:51154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j9sSX-0003P1-BP for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 10:30:49 -0500 Received: from nagas.meson.org (nagas [192.168.2.101]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by pi.meson.org (Postfix) with ESMTPS id 90BC22200FF for ; Thu, 5 Mar 2020 10:30:48 -0500 (EST) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: org-mode mailing list This is a multi-part message in MIME format. --------------FD0D3859F0015FC67BB86CD2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Make a org-mode table.=C2=A0 In one of the cells of the table, hav= e some text that is +struck out+.=C2=A0 Note that the struck-out text= is default text color (black, for me), and not org-table text color (blue, for me).=C2=A0 It's even worse if you're running org-variable-pitch-mode, because the text also won't be set in a fixed-pitch face, and so will screw up the alignment of table text.=C2=A0 I found out why.


When org-do-emphasis-faces constructs the new face that it applies to the text, it passes the lookup value from the org-emphasis-alist to font-lock-prepend-text-property, which makes a list, composing it with the existing face.=C2=A0 This would fail = for strike-though mode in a table, since the org-emphasis-alist lookup would return (:strike-through t), resulting in a face of (:strike-through t org-table), which is an invalid face, and then emacs has no choice but to render it unfaced.


Attaching a patch for the issue.=C2=A0 Rather than try to figure o= ut how to make org-do-emphasis-faces somehow smart enough to deal with this situation (I'm not sure it's possible, in general), I took the easy way out and defined an org-strike-through face which can be used in org-empasis-alist.


Humbly submitted for your approval...


~mark

--------------FD0D3859F0015FC67BB86CD2 Content-Type: text/x-patch; charset=UTF-8; name="0001-org-faces.el-Add-org-strike-through-face.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-org-faces.el-Add-org-strike-through-face.patch" >From 9a489ddf9d411bfc907a5b765d015e757b0b6903 Mon Sep 17 00:00:00 2001 From: "Mark E. Shoulson" Date: Thu, 5 Mar 2020 10:03:37 -0500 Subject: [PATCH] org-faces.el: Add org-strike-through face org-faces.el: Create org-strike-through face. org.el: Use org-strike-through-face in org-emphasis-alist. --- lisp/org-faces.el | 4 ++++ lisp/org.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/org-faces.el b/lisp/org-faces.el index d78b606ec..107ea9763 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -427,6 +427,10 @@ For source-blocks `org-src-block-faces' takes precedence." :group 'org-faces :version "22.1") +(defface org-strike-through '((t (:strike-through t))) + "Face for struck-through text." + :group 'org-faces) + (defface org-quote '((t (:inherit org-block))) "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks. Active when `org-fontify-quote-and-verse-blocks' is set." diff --git a/lisp/org.el b/lisp/org.el index 31133c554..8b27e4708 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3677,7 +3677,7 @@ You need to reload Org or to restart Emacs after setting this.") ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim) - ("+" (:strike-through t))) + ("+" org-strike-through)) "Alist of characters and faces to emphasize text. Text starting and ending with a special character will be emphasized, for example *bold*, _underlined_ and /italic/. This variable sets the -- 2.24.1 --------------FD0D3859F0015FC67BB86CD2-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark E. Shoulson" Subject: [PATCH] strike-through text in tables Date: Tue, 10 Mar 2020 18:56:47 -0400 Message-ID: <1f816f99-e3a2-f905-53c6-7d1c005ec1da@kli.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------322E3BAB0AED67DF71CADDC3" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58288) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBnnv-0004Wq-Fb for emacs-orgmode@gnu.org; Tue, 10 Mar 2020 18:56:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBnnu-0000NT-3m for emacs-orgmode@gnu.org; Tue, 10 Mar 2020 18:56:51 -0400 Received: from pi.meson.org ([96.56.207.26]:41810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jBnnt-0000Hm-Uu for emacs-orgmode@gnu.org; Tue, 10 Mar 2020 18:56:50 -0400 Received: from nagas.meson.org (nagas [192.168.2.101]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by pi.meson.org (Postfix) with ESMTPS id 62E172209AF for ; Tue, 10 Mar 2020 18:56:47 -0400 (EDT) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: org-mode mailing list This is a multi-part message in MIME format. --------------322E3BAB0AED67DF71CADDC3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I didn't see a response to this, and I hope it's just because I sent it wrongly or something. If not, is there something amiss with this? Make a org-mode table. In one of the cells of the table, have some text that is +struck out+. Note that the struck-out text is default text color (black, for me), and not org-table text color (blue, for me). It's even worse if you're running org-variable-pitch-mode, because the text also won't be set in a fixed-pitch face, and so will screw up the alignment of table text. I found out why. When org-do-emphasis-faces constructs the new face that it applies to the text, it passes the lookup value from the org-emphasis-alist to font-lock-prepend-text-property, which makes a list, composing it with the existing face. This would fail for strike-though mode in a table, since the org-emphasis-alist lookup would return (:strike-through t), resulting in a face of (:strike-through t org-table), which is an invalid face, and then emacs has no choice but to render it unfaced. Attaching a patch for the issue. Rather than try to figure out how to make org-do-emphasis-faces somehow smart enough to deal with this situation (I'm not sure it's possible, in general), I took the easy way out and defined an org-strike-through face which can be used in org-emphasis-alist. Humbly submitted for your approval... ~mark --------------322E3BAB0AED67DF71CADDC3 Content-Type: text/plain; charset=UTF-8; name="0001-org-faces.el-Add-org-strike-through-face.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-org-faces.el-Add-org-strike-through-face.patch" RnJvbSA5YTQ4OWRkZjlkNDExYmZjOTA3YTViNzY1ZDAxNWU3NTdiMGI2OTAzIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiAiTWFyayBFLiBTaG91bHNvbiIgPG1hcmtAa2xpLm9y Zz4KRGF0ZTogVGh1LCA1IE1hciAyMDIwIDEwOjAzOjM3IC0wNTAwClN1YmplY3Q6IFtQQVRD SF0gb3JnLWZhY2VzLmVsOiBBZGQgb3JnLXN0cmlrZS10aHJvdWdoIGZhY2UKCm9yZy1mYWNl cy5lbDogQ3JlYXRlIG9yZy1zdHJpa2UtdGhyb3VnaCBmYWNlLgpvcmcuZWw6IFVzZSBvcmct c3RyaWtlLXRocm91Z2gtZmFjZSBpbiBvcmctZW1waGFzaXMtYWxpc3QuCi0tLQogbGlzcC9v cmctZmFjZXMuZWwgfCA0ICsrKysKIGxpc3Avb3JnLmVsICAgICAgIHwgMiArLQogMiBmaWx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IG9yZy12ZXJiYXRp bSB2ZXJiYXRpbSkKICAgICAoIn4iIG9yZy1jb2RlIHZlcmJhdGltKQotICAgICgiKyIgKDpz dHJpa2UtdGhyb3VnaCB0KSkpCisgICAgKCIrIiBvcmctc3RyaWtlLXRocm91Z2gpKQogICAi QWxpc3Qgb2YgY2hhcmFjdGVycyBhbmQgZmFjZXMgdG8gZW1waGFzaXplIHRleHQuCiBUZXh0 IHN0YXJ0aW5nIGFuZCBlbmRpbmcgd2l0aCBhIHNwZWNpYWwgY2hhcmFjdGVyIHdpbGwgYmUg ZW1waGFzaXplZCwKIGZvciBleGFtcGxlICpib2xkKiwgX3VuZGVybGluZWRfIGFuZCAvaXRh bGljLy4gIFRoaXMgdmFyaWFibGUgc2V0cyB0aGUKLS0gCjIuMjQuMQoK --------------322E3BAB0AED67DF71CADDC3-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] strike-through text in tables Date: Wed, 11 Mar 2020 00:10:48 +0100 Message-ID: <87a74najrb.fsf@gnu.org> References: <1f816f99-e3a2-f905-53c6-7d1c005ec1da@kli.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37334) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBo1T-0003N2-IS for emacs-orgmode@gnu.org; Tue, 10 Mar 2020 19:10:52 -0400 In-Reply-To: <1f816f99-e3a2-f905-53c6-7d1c005ec1da@kli.org> (Mark E. Shoulson's message of "Tue, 10 Mar 2020 18:56:47 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: "Mark E. Shoulson" Cc: org-mode mailing list Hi Mark, "Mark E. Shoulson" writes: > I didn't see a response to this, and I hope it's just because I sent > it wrongly or something. If not, is there something amiss with this? I'm late in reading the mailing list for a week or so, but I'll handle this (and other issues before 9.4) over the week-end. Thanks for your patience, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2E62Hff0x16WBQAA0tVLHw (envelope-from ) for ; Fri, 22 May 2020 15:51:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uPNnGff0x17mKgAAbx9fmQ (envelope-from ) for ; Fri, 22 May 2020 15:51:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE4C5940428 for ; Fri, 22 May 2020 15:51:18 +0000 (UTC) Received: from localhost ([::1]:44010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc9x7-0005Mr-FZ for larch@yhetil.org; Fri, 22 May 2020 11:51:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc9wo-0005Ml-FA for emacs-orgmode@gnu.org; Fri, 22 May 2020 11:50:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50545) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc9wn-0000tx-SS; Fri, 22 May 2020 11:50:57 -0400 Received: from lns-bzn-32-82-254-31-120.adsl.proxad.net ([82.254.31.120]:35378 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jc9wn-0005DB-Cu; Fri, 22 May 2020 11:50:57 -0400 Received: by guerry (Postfix, from userid 1000) id 68D341A603E5; Fri, 22 May 2020 17:50:55 +0200 (CEST) From: Bastien To: "Mark E. Shoulson" Subject: Re: [PATCH] strike-through text in tables Organization: GNU References: <1f816f99-e3a2-f905-53c6-7d1c005ec1da@kli.org> Date: Fri, 22 May 2020 17:50:55 +0200 In-Reply-To: <1f816f99-e3a2-f905-53c6-7d1c005ec1da@kli.org> (Mark E. Shoulson's message of "Tue, 10 Mar 2020 18:56:47 -0400") Message-ID: <87ftbs7yu8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: org-mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: DQzE8jUGNGHS Hi Mark, "Mark E. Shoulson" writes: > I didn't see a response to this, and I hope it's just because I sent > it wrongly or something. If not, is there something amiss with this? > > Make a org-mode table. In one of the cells of the table, have some > text that is +struck out+. Note that the struck-out text is default > text color (black, for me), and not org-table text color (blue, for > me). I cannot reproduce this problem: all text in my table, striked-through or not, is blue. Do you have a way to reproduce your problem (ECM and versions)? Thanks, -- Bastien