emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 38842b2 1/2: Refactor org-set-font-lock-defaults to


From: ELPA Syncer
Subject: [elpa] externals/org 38842b2 1/2: Refactor org-set-font-lock-defaults to improve code readability
Date: Mon, 26 Apr 2021 03:57:10 -0400 (EDT)

branch: externals/org
commit 38842b2ffa024666113d536871c01d7e2232b511
Author: Nicholas Savage <nick@nicksavage.ca>
Commit: Bastien Guerry <bzg@gnu.org>

    Refactor org-set-font-lock-defaults to improve code readability
    
    * org.el (org-set-font-lock-defaults): Reduce number of local
    variables to improve code readability.
---
 lisp/org.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index c273810..3f9c9a2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5617,9 +5617,7 @@ needs to be inserted at a specific position in the 
font-lock sequence.")
 
 (defun org-set-font-lock-defaults ()
   "Set font lock defaults for the current buffer."
-  (let* ((em org-fontify-emphasized-text)
-        (lk org-highlight-links)
-        (org-font-lock-extra-keywords
+  (let ((org-font-lock-extra-keywords
          (list
           ;; Call the hook
           '(org-font-lock-hook)
@@ -5646,10 +5644,10 @@ needs to be inserted at a specific position in the 
font-lock sequence.")
           '(org-fontify-drawers)
           ;; Link related fontification.
           '(org-activate-links)
-          (when (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
-          (when (memq 'radio lk) '(org-activate-target-links (1 'org-link t)))
-          (when (memq 'date lk) '(org-activate-dates (0 'org-date t)))
-          (when (memq 'footnote lk) '(org-activate-footnote-links))
+          (when (memq 'tag org-highlight-links) '(org-activate-tags (1 
'org-tag prepend)))
+          (when (memq 'radio org-highlight-links) '(org-activate-target-links 
(1 'org-link t)))
+          (when (memq 'date org-highlight-links) '(org-activate-dates (0 
'org-date t)))
+          (when (memq 'footnote org-highlight-links) 
'(org-activate-footnote-links))
            ;; Targets.
            (list org-radio-target-regexp '(0 'org-target t))
           (list org-target-regexp '(0 'org-target t))
@@ -5693,7 +5691,7 @@ needs to be inserted at a specific position in the 
font-lock sequence.")
           (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
           (list (concat "\\<" org-clock-string) '(0 'org-special-keyword t))
           ;; Emphasis
-          (when em '(org-do-emphasis-faces))
+          (when org-fontify-emphasized-text '(org-do-emphasis-faces))
           ;; Checkboxes
           '("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ 
\t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
             1 'org-checkbox prepend)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]