[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 30a6126 2/2: oc: Fix `org-cite-fontify-defa
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 30a6126 2/2: oc: Fix `org-cite-fontify-default' docstring and simplify code |
Date: |
Wed, 24 Nov 2021 16:57:23 -0500 (EST) |
branch: externals-release/org
commit 30a6126bb9a68afe4007fed5fa0a34ea8adedf40
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>
oc: Fix `org-cite-fontify-default' docstring and simplify code
* lisp/oc.el (org-cite-fontify-default): We don't need to assume
activate processor may be used on a citation reference: that will not
happen.
---
lisp/oc.el | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/lisp/oc.el b/lisp/oc.el
index a8cd6c3..427c087 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1141,17 +1141,14 @@ and must return either a string, an object, or a
secondary string."
;;; Internal interface with fontification (activate capability)
-(defun org-cite-fontify-default (datum)
- "Fontify DATUM with `org-cite' and `org-cite-key' face.
-DATUM is a citation object, or a citation reference. In any case, apply
-`org-cite' face on the whole citation, and `org-cite-key' face on each key."
- (let* ((cite (if (eq 'citation-reference (org-element-type datum))
- (org-element-property :parent datum)
- datum))
- (beg (org-element-property :begin cite))
- (end (org-with-point-at (org-element-property :end cite)
- (skip-chars-backward " \t")
- (point))))
+(defun org-cite-fontify-default (cite)
+ "Fontify CITE with `org-cite' and `org-cite-key' faces.
+CITE is a citation object. The function applies `org-cite' face
+on the whole citation, and `org-cite-key' face on each key."
+ (let ((beg (org-element-property :begin cite))
+ (end (org-with-point-at (org-element-property :end cite)
+ (skip-chars-backward " \t")
+ (point))))
(add-text-properties beg end '(font-lock-multiline t))
(add-face-text-property beg end 'org-cite)
(dolist (reference (org-cite-get-references cite))