From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Cc: Bastien <bzg@gnu.org>
Subject: Re: [PATCH] Remove unecesssary invocations of org-mode in ox-publish
Date: Wed, 30 Jul 2014 14:33:34 -0500 [thread overview]
Message-ID: <87bns663qp.fsf@fastmail.fm> (raw)
In-Reply-To: <87egx2ss5l.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 30 Jul 2014 18:55:18 +0200")
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Matt Lundin <mdl@imapmail.org> writes:
>
>> Clearly, this is still very inadequate, but it is an improvement. I
>> would love to use the built in site-map functions, but they are simply
>> to slow for any larger projects.
>>
>> Could we do something like this to speed it up?
>>
>> (with-temp-buffer
>> (insert-file-contents file)
>> (goto-char (point-min))
>> (when (re-search-forward "^#\\+TITLE:" nil t)
>> (org-element-at-point)))
>
> No, you also need to parse #+SETUPFILE: keywords. You could also get
> false positive within a verbatim block:
>
> #+begin_example
> #+title: something
> #+end_example
> However, it is possible to write a specialized function to extract
> only #+TITLE.
>
> Another option is to cache results. See `org-publish-cache-set' and
> `org-publish-cache-get'.
Thanks for the helpful information. I think the cache would be a nice
way to go, especially if it were combined a timestamp check. E.g., only
files that have been updated since the last publishing should be queried
for titles; otherwise, use the cached file.
I notice that org-publish-find-title does cache the title, but AFAICT
this is never used, since org-publish-format-file-entry calls
org-publish-find-title with the reset argument. Perhaps we could add a
variable to make this optional in org-publish-format-file-entry. E.g.,
--8<---------------cut here---------------start------------->8---
(defun org-publish-format-file-entry (fmt file project-plist)
(format-spec
fmt
`((?t . ,(org-publish-find-title file org-publish-find-title-use-cache))
[...]
--8<---------------cut here---------------end--------------->8---
A similar option could be added to the date function date function.
Would it be O.K. if I went ahead and implemented this?
Thanks,
Matt
next prev parent reply other threads:[~2014-07-30 19:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 5:10 [PATCH] Remove unecesssary invocations of org-mode in ox-publish Matt Lundin
2014-07-29 13:21 ` Bastien
2014-07-29 15:03 ` Matt Lundin
2014-07-29 15:10 ` Matt Lundin
2014-07-29 15:13 ` Bastien
2014-07-29 16:04 ` Matt Lundin
2014-07-29 21:33 ` Bastien
2014-07-29 15:12 ` Matt Lundin
2014-07-29 15:13 ` Bastien
2014-07-29 15:45 ` Matt Lundin
2014-07-29 18:55 ` Matt Lundin
2014-07-29 21:33 ` Bastien
2014-07-30 16:55 ` Nicolas Goaziou
2014-07-30 19:33 ` Matt Lundin [this message]
2014-07-30 20:59 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bns663qp.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.