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--