[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 4f8ea50604 18/50: Backport commit d21412df0 from Em
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 4f8ea50604 18/50: Backport commit d21412df0 from Emacs |
Date: |
Tue, 4 Oct 2022 21:57:59 -0400 (EDT) |
branch: externals/org
commit 4f8ea506049938bd4fed49e27596f0a5fcf41372
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Kyle Meyer <kyle@kyleam.com>
Backport commit d21412df0 from Emacs
* lisp/ox.el (org-export-resolve-id-link): Pre-cache all the ids in
the parse tree for faster lookup.
org-export-resolve-id-link: Pre-cache all the ids in the parse tree
d21412df06b99b551e67d39c097d95e8a284de73
Ihor Radchenko
Thu Jun 16 10:52:54 2022 +0300
[ km: This ported commit comes from main's 84c89ea7c. I'm applying it
here too for bookkeeping/traceability purposes. ]
---
lisp/ox.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/lisp/ox.el b/lisp/ox.el
index 471ea14b32..0b4ae1dc09 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4395,15 +4395,27 @@ tree or a file name. Assume LINK type is either \"id\"
or
\"custom-id\". Throw an error if no match is found."
(let ((id (org-element-property :path link)))
;; First check if id is within the current parse tree.
- (or (org-element-map (plist-get info :parse-tree) 'headline
- (lambda (headline)
- (when (or (equal (org-element-property :ID headline) id)
- (equal (org-element-property :CUSTOM_ID headline) id))
- headline))
- info 'first-match)
- ;; Otherwise, look for external files.
- (cdr (assoc id (plist-get info :id-alist)))
- (signal 'org-link-broken (list id)))))
+ (or (let ((local-ids (or (plist-get info :id-local-cache)
+ (let ((table (make-hash-table :test #'equal)))
+ (org-element-map
+ (plist-get info :parse-tree)
+ 'headline
+ (lambda (headline)
+ (let ((id (org-element-property :ID
headline))
+ (custom-id (org-element-property
:CUSTOM_ID headline)))
+ (when id
+ (unless (gethash id table)
+ (puthash id headline table)))
+ (when custom-id
+ (unless (gethash custom-id table)
+ (puthash custom-id headline table)))))
+ info)
+ (plist-put info :id-local-cache table)
+ table))))
+ (gethash id local-ids))
+ ;; Otherwise, look for external files.
+ (cdr (assoc id (plist-get info :id-alist)))
+ (signal 'org-link-broken (list id)))))
(defun org-export-resolve-radio-link (link info)
"Return radio-target object referenced as LINK destination.
- [elpa] externals/org 07c5d066aa 17/50: Backport commit 3236dedc2 from Emacs, (continued)
- [elpa] externals/org 07c5d066aa 17/50: Backport commit 3236dedc2 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 9b62bcc9c6 39/50: Backport commit 8dacd8cd9 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 0e0fe76ae4 45/50: ox-icalendar: Fix time zone construct from recently ported commit, ELPA Syncer, 2022/10/04
- [elpa] externals/org 07b6a0e044 48/50: compat: Use org- wrapper for string-equal-ignore-case compatibility, ELPA Syncer, 2022/10/04
- [elpa] externals/org 1adbaca75a 26/50: Backport commit 563bf2fae from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org aeb934b598 41/50: Merge branch 'km/from-emacs-28', ELPA Syncer, 2022/10/04
- [elpa] externals/org abc34b458f 43/50: org-mouse: Make recently ported change compatible with Emacs < 29, ELPA Syncer, 2022/10/04
- [elpa] externals/org 1f8cc85542 50/50: org-agenda: Replace 29.1 version keywords with package-version, ELPA Syncer, 2022/10/04
- [elpa] externals/org 42c418693f 42/50: Merge branch 'km/from-emacs-master', ELPA Syncer, 2022/10/04
- [elpa] externals/org 8ac9203d5c 20/50: Backport commit 979308b4c from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 4f8ea50604 18/50: Backport commit d21412df0 from Emacs,
ELPA Syncer <=
- [elpa] externals/org e614a763ca 27/50: Backport commit 70341cab3 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 19c3969e75 29/50: Backport commit 2682ea1b3 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 25e638f726 34/50: Backport commit 1137219c9 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 9c2bc2877f 37/50: Backport commit 06d716147 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org c2c8e66e5d 38/50: Backport commit b7e867b84 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 6dd736ab35 44/50: ol-eshell: Make recently ported change compatible with Emacs < 29, ELPA Syncer, 2022/10/04