emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Lawrence Mitchell <wence@gmx.li>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH v2] ox: Cache locations of fuzzy links
Date: Thu, 02 May 2013 14:35:50 +0200	[thread overview]
Message-ID: <8738u5imop.fsf@gmail.com> (raw)
In-Reply-To: <874nelycry.fsf_-_@gmx.li> (Lawrence Mitchell's message of "Thu, 02 May 2013 10:03:13 +0100")

Hello,

Lawrence Mitchell <wence@gmx.li> 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

  reply	other threads:[~2013-05-02 12:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 19:28 Exporting large documents Achim Gratz
2013-04-27 19:35 ` Carsten Dominik
2013-04-29 16:04   ` Lawrence Mitchell
2013-04-29 18:44     ` Achim Gratz
2013-05-01 12:18       ` [PATCH] ox: Cache locations of fuzzy links Lawrence Mitchell
2013-05-01 21:46         ` Nicolas Goaziou
2013-05-02  9:03           ` [PATCH v2] " Lawrence Mitchell
2013-05-02 12:35             ` Nicolas Goaziou [this message]
2013-05-02 12:53               ` Nicolas Goaziou
2013-05-03  8:43     ` Exporting large documents Carsten Dominik
2013-05-03 11:12       ` Lawrence Mitchell
     [not found]         ` <877gjfgnl9.fsf@gmail.com>
     [not found]           ` <0F877AB5-D488-4223-B0E7-F11B4B973614@gmail.com>
     [not found]             ` <87ip2xfd0x.fsf@gmail.com>
2013-05-06 11:07               ` Lawrence Mitchell
2013-05-06 16:15                 ` Lawrence Mitchell
2013-05-07 10:26                   ` Bastien
2013-05-06 18:41                 ` Achim Gratz
2013-05-06 19:17                   ` Nicolas Goaziou
2013-05-06 19:32                     ` Achim Gratz
2013-05-07 14:29                       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8738u5imop.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wence@gmx.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).