From 1d8a5140e3ce03d9fa6b9c63a6621ab3ab64eb4c Mon Sep 17 00:00:00 2001 From: defanor Date: Tue, 7 Nov 2017 21:37:54 +0300 Subject: Let Emacs to render subscripts, superscripts, strikethrough That is, add `Styled` constructors for those. --- pancake.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pancake.el') 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) -- cgit v1.2.3