emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] strike-through text in tables
@ 2020-03-10 22:56 Mark E. Shoulson
  2020-03-10 23:10 ` Bastien
  2020-05-22 15:50 ` Bastien
  0 siblings, 2 replies; 4+ messages in thread
From: Mark E. Shoulson @ 2020-03-10 22:56 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]

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

[-- Attachment #2: 0001-org-faces.el-Add-org-strike-through-face.patch --]
[-- Type: text/plain, Size: 1500 bytes --]

From 9a489ddf9d411bfc907a5b765d015e757b0b6903 Mon Sep 17 00:00:00 2001
From: "Mark E. Shoulson" <mark@kli.org>
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] strike-through text in tables
  2020-03-10 22:56 [PATCH] strike-through text in tables Mark E. Shoulson
@ 2020-03-10 23:10 ` Bastien
  2020-05-22 15:50 ` Bastien
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2020-03-10 23:10 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list

Hi Mark,

"Mark E. Shoulson" <mark@shoulson.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] strike-through text in tables
  2020-03-10 22:56 [PATCH] strike-through text in tables Mark E. Shoulson
  2020-03-10 23:10 ` Bastien
@ 2020-05-22 15:50 ` Bastien
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2020-05-22 15:50 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list

Hi Mark,

"Mark E. Shoulson" <mark@shoulson.com> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] strike-through text in tables
@ 2020-03-05 15:30 Mark E. Shoulson
  0 siblings, 0 replies; 4+ messages in thread
From: Mark E. Shoulson @ 2020-03-05 15:30 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/html, Size: 1817 bytes --]

[-- Attachment #2: 0001-org-faces.el-Add-org-strike-through-face.patch --]
[-- Type: text/x-patch, Size: 1500 bytes --]

From 9a489ddf9d411bfc907a5b765d015e757b0b6903 Mon Sep 17 00:00:00 2001
From: "Mark E. Shoulson" <mark@kli.org>
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-22 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 22:56 [PATCH] strike-through text in tables Mark E. Shoulson
2020-03-10 23:10 ` Bastien
2020-05-22 15:50 ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2020-03-05 15:30 Mark E. Shoulson

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).