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 cmctZmFjZXMuZWwgfCA0ICsrKysKIGxpc3Avb3JnLmVsICAgICAgIHwgMiArLQogMiBmaWxl cyBjaGFuZ2VkLCA1IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQg YS9saXNwL29yZy1mYWNlcy5lbCBiL2xpc3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