[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH v2] ox: Cache locations of fuzzy links
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [PATCH v2] ox: Cache locations of fuzzy links |
Date: |
Thu, 02 May 2013 14:35:50 +0200 |
Hello,
Lawrence Mitchell <address@hidden> writes:
> * ox.el (org-export-resolve-fuzzy-link): Look for fuzzy link in a
> cache before trying to resolve it in the parse tree.
>
> When a document contains a large number of identical fuzzy links, it
> doesn't make sense to continually search for them. Instead, cache the
> locations in the position independent case.
> ---
> lisp/ox.el | 42 +++++++++++++++++++++++++++++-------------
> 1 file changed, 29 insertions(+), 13 deletions(-)
>
> Changes since v1:
>
> - Pull initialisation of link-cache into let
> - Don't use cons cells for keys, just use the path
> - lift found check to top-level let since it's now common
Thanks for the changes.
> I've made this change. Barring the eq test.
>
> Remember, paths are strings and two strings are only eq or eql if
> they are actually the same string (in memory). In particular:
>
> (let ((p "foo")) (eq (substring p 1) (substring p 1))) => nil
> (let ((p "foo")) (eql (substring p 1) (substring p 1))) => nil
> (let ((p "foo")) (equal (substring p 1) (substring p 1))) => t
>
> Hence, we must use equal or string-equal as a test in the hash
> table. But string-equal isn't a predefined test, hence equal.
Sorry for being dense, but why do you use _path_, which is a string and,
as you say, requires `equal' for equality, instead of the first argument
of the function, i.e. _link_, which only needs `eq'?
Regards,
--
Nicolas Goaziou