[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 147ca39750 3/7: org-in-commented-heading-p: Do not
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 147ca39750 3/7: org-in-commented-heading-p: Do not parse section unless already cached |
Date: |
Sun, 12 Jun 2022 05:57:46 -0400 (EDT) |
branch: externals/org
commit 147ca39750e089525bed8f624c01e3ddc08f593e
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-in-commented-heading-p: Do not parse section unless already cached
* lisp/org.el (org-in-commented-heading-p): When element at point is
not yet in cache, parse the parent headline instead of also parsing
section up to point.
---
lisp/org.el | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 94eafb393b..8e7aadde58 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19822,26 +19822,19 @@ unless optional argument NO-INHERITANCE is non-nil.
Optional argument ELEMENT contains element at point."
(save-match-data
- (let ((el (or element (org-element-at-point nil 'cached))))
- (if el
- (catch :found
- (setq el (org-element-lineage el '(headline inlinetask)
'include-self))
- (if no-inheritance
- (org-element-property :commentedp el)
- (while el
- (when (org-element-property :commentedp el)
- (throw :found t))
- (setq el (org-element-property :parent el)))))
- (cond
- ((org-before-first-heading-p) nil)
- ((let ((headline (nth 4 (org-heading-components))))
- (and headline
- (let ((case-fold-search nil))
- (string-match-p (concat "^" org-comment-string "\\(?:
\\|$\\)")
- headline)))))
- (no-inheritance nil)
- (t
- (save-excursion (and (org-up-heading-safe)
(org-in-commented-heading-p)))))))))
+ (let ((el (or element
+ (org-element-at-point nil 'cached)
+ (org-with-wide-buffer
+ (org-back-to-heading-or-point-min t)
+ (org-element-at-point)))))
+ (catch :found
+ (setq el (org-element-lineage el '(headline inlinetask) 'include-self))
+ (if no-inheritance
+ (org-element-property :commentedp el)
+ (while el
+ (when (org-element-property :commentedp el)
+ (throw :found t))
+ (setq el (org-element-property :parent el))))))))
(defun org-in-archived-heading-p (&optional no-inheritance element)
"Non-nil if point is under an archived heading.
- [elpa] externals/org updated (ed6f8dc67f -> f5c9ce8f06), ELPA Syncer, 2022/06/12
- [elpa] externals/org 147ca39750 3/7: org-in-commented-heading-p: Do not parse section unless already cached,
ELPA Syncer <=
- [elpa] externals/org 2f8e688516 2/7: org-back-to-heading-or-point-min: Rely less on cache, ELPA Syncer, 2022/06/12
- [elpa] externals/org 8a0b03fb3b 1/7: org-element-headline-parser: Fix headings like * COMMENTnospace, ELPA Syncer, 2022/06/12
- [elpa] externals/org f51c286716 4/7: org-export-get-footnote-definition: Pre-cache references in parse tree, ELPA Syncer, 2022/06/12
- [elpa] externals/org f5c9ce8f06 7/7: org-babel-exp-process-buffer: Disable edit control while processing, ELPA Syncer, 2022/06/12
- [elpa] externals/org 84c89ea7cb 6/7: org-export-resolve-id-link: Pre-cache all the ids in the parse tree, ELPA Syncer, 2022/06/12
- [elpa] externals/org 792cd4b0a6 5/7: org-export-resolve-fuzyy-link: Pre-cache all possible search cells, ELPA Syncer, 2022/06/12