[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 07c5d066aa 17/50: Backport commit 3236dedc2 from Em
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 07c5d066aa 17/50: Backport commit 3236dedc2 from Emacs |
Date: |
Tue, 4 Oct 2022 21:57:59 -0400 (EDT) |
branch: externals/org
commit 07c5d066aa98e8febb1afa6d7dc233d3f2111e87
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Kyle Meyer <kyle@kyleam.com>
Backport commit 3236dedc2 from Emacs
* lisp/ox.el (org-export-resolve-fuzzy-link): Before matching LINK,
pre-process and cache all the non-nil search cells in the parse tree.
When matching, use the pre-processed info. Fix the :test function for
the cache hash table.
org-export-resolve-fuzyy-link: Pre-cache all possible search cells
3236dedc2de5975afde877f7460bd012da89a98d
Ihor Radchenko
Thu Jun 16 10:52:36 2022 +0300
[ km: This ported commit comes from main's 792cd4b0a. I'm applying it
here too for bookkeeping/traceability purposes. ]
---
lisp/ox.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/lisp/ox.el b/lisp/ox.el
index 807b585aea..471ea14b32 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4348,17 +4348,27 @@ significant."
(let* ((search-cells (org-export-string-to-search-cell
(org-element-property :path link)))
(link-cache (or (plist-get info :resolve-fuzzy-link-cache)
- (let ((table (make-hash-table :test #'eq)))
+ (let ((table (make-hash-table :test #'equal)))
+ ;; Cache all the element search cells.
+ (org-element-map (plist-get info :parse-tree)
+ (append pseudo-types '(target)
org-element-all-elements)
+ (lambda (datum)
+ (dolist (cell (org-export-search-cells datum))
+ (if (gethash cell table)
+ (push datum (gethash cell table))
+ (puthash cell (list datum) table)))))
(plist-put info :resolve-fuzzy-link-cache table)
table)))
(cached (gethash search-cells link-cache 'not-found)))
(if (not (eq cached 'not-found)) cached
(let ((matches
- (org-element-map (plist-get info :parse-tree)
- (append pseudo-types '(target) org-element-all-elements)
- (lambda (datum)
- (and (org-export-match-search-cell-p datum search-cells)
- datum)))))
+ (let (result)
+ (dolist (search-cell search-cells)
+ (setq result
+ (nconc
+ result
+ (gethash search-cell link-cache))))
+ (delq nil result))))
(unless matches
(signal 'org-link-broken (list (org-element-property :path link))))
(puthash
- [elpa] externals/org 75d63533d3 47/50: compat: Move string-equal-ignore-case to correct section, (continued)
- [elpa] externals/org 75d63533d3 47/50: compat: Move string-equal-ignore-case to correct section, ELPA Syncer, 2022/10/04
- [elpa] externals/org 95a4c59bfe 49/50: compat: Add compatibility wrapper for format-prompt, ELPA Syncer, 2022/10/04
- [elpa] externals/org 4ae72c6174 19/50: Backport commit 0f7ceb480 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 0da6c49f75 21/50: Backport commit 4f37a3b29 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 07ca33e603 25/50: Backport commit 2a05479c2 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org e7059f7dbe 28/50: Backport commit 22a5f0223 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org e9df837d8a 30/50: Backport commit 0a6e2b3bf from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 883f87c3e7 32/50: Backport commit 4d64c39fa from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 2ac8c44f04 33/50: Backport commit b335e1a04 from Emacs, ELPA Syncer, 2022/10/04
- [elpa] externals/org 631d4eb6af 40/50: org-macs: Move org-current-text-indentation to silence byte-compiler, ELPA Syncer, 2022/10/04
- [elpa] externals/org 07c5d066aa 17/50: Backport commit 3236dedc2 from Emacs,
ELPA Syncer <=
- [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, 2022/10/04