summaryrefslogtreecommitdiff
path: root/pancake.el
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-07 21:37:54 +0300
committerdefanor <defanor@uberspace.net>2017-11-07 22:17:34 +0300
commit1d8a5140e3ce03d9fa6b9c63a6621ab3ab64eb4c (patch)
treecd3f131567cc0ac9c86b752f22f25e3cd319ce45 /pancake.el
parent5301bb027cf56a0e1148808f11510e7fcc298b86 (diff)
Let Emacs to render subscripts, superscripts, strikethrough
That is, add `Styled` constructors for those.
Diffstat (limited to 'pancake.el')
-rw-r--r--pancake.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/pancake.el b/pancake.el
index 2e72969..83e74e5 100644
--- a/pancake.el
+++ b/pancake.el
@@ -93,6 +93,11 @@
"Foreground face for white color."
:group 'pancake)
+(defface pancake-strike-through
+ '((t :strike-through t))
+ "A strike-through face."
+ :group 'pancake)
+
(defcustom pancake-command '("pancake" "--embedded")
"A command that runs pancake, along with its arguments"
:group 'pancake)
@@ -178,9 +183,19 @@
(pancake-print-line rest)
(add-face-text-property
start (point) (pancake-translate-color color 'foreground) t))
+ (`(style strikethrough . ,rest)
+ (pancake-print-line rest)
+ (add-face-text-property start (point) 'pancake-strike-through t))
(`(style ,face . ,rest)
(pancake-print-line rest)
(add-face-text-property start (point) face t))
+ (`(subscript . ,rest)
+ (pancake-print-line rest)
+ (add-text-properties start (point) '(display (height 0.75))))
+ (`(superscript . ,rest)
+ (pancake-print-line rest)
+ (add-text-properties start (point) '(display ((raise 0.25)
+ (height 0.75)))))
(`(denotation (math . ,formula) . ,rest)
(pancake-print-line rest))
(`(denotation (link . ,uri) . ,rest)