branch: externals/org-modern commit 83a4b3bd3418df88479c53961dd6c15033d21af9 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Support different styling for footnote references and definitions (Fix #61) --- org-modern.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/org-modern.el b/org-modern.el index 1770720cdf..a91647aeae 100644 --- a/org-modern.el +++ b/org-modern.el @@ -174,9 +174,12 @@ used as replacement for \"#+keyword:\", with t the default key." :value-type (choice (string :tag "Replacement") (const :tag "Hide prefix" t))))) -(defcustom org-modern-footnote (cadr org-script-display) - "Prettify footnotes." - :type '(choice (const nil) sexp)) +(defcustom org-modern-footnote (cons (cadr org-script-display) + (cadr org-script-display)) + "Prettify footnotes. +The car corresponds to display specification for definitions, the cdr for +references." + :type '(choice (const nil) (cons sexp sexp))) (defcustom org-modern-internal-target '(" ↪ " t " ") "Prettify internal link targets, e.g., <<introduction>>." @@ -571,9 +574,12 @@ You can specify a font `:family'. The font families `Iosevka', `Hack' and `((,(concat "^\\*+.*?\\( \\)\\(:\\(?:" org-tag-re ":\\)+\\)[ \t]*$") (0 (org-modern--tag))))) (when org-modern-footnote - `(("\\(\\[fn:\\)[[:word:]-_]+\\]" - (0 '(face nil display ,org-modern-footnote)) - (1 '(face nil display ,(propertize "[" 'display org-modern-footnote)))))) + `(("^\\(\\[fn:\\)[[:word:]-_]+\\]" + (0 '(face nil display ,(car org-modern-footnote))) + (1 '(face nil display ,(propertize "[" 'display (car org-modern-footnote))))) + ("[^\n]\\(\\(\\[fn:\\)[[:word:]-_]+\\]\\)" + (1 '(face nil display ,(cdr org-modern-footnote))) + (2 '(face nil display ,(propertize "[" 'display (cdr org-modern-footnote))))))) (when org-modern-internal-target `(("\\(<<\\)\\([^<][^\n]*?\\)\\(>>\\)" (0 '(face org-modern-internal-target) t)