From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Remove unecesssary invocations of org-mode in ox-publish Date: Wed, 30 Jul 2014 18:55:18 +0200 Message-ID: <87egx2ss5l.fsf@nicolasgoaziou.fr> References: <87mwbsn40z.fsf@fastmail.fm> <871tt4fggm.fsf@bzg.ath.cx> <87zjfsnsyf.fsf@fastmail.fm> <87fvhk9p0m.fsf@bzg.ath.cx> <87k36wnp7x.fsf@fastmail.fm> <877g2wyoyo.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCX9Z-0006tt-Nq for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 12:55:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCX9R-0003pU-LO for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 12:55:01 -0400 In-Reply-To: <877g2wyoyo.fsf@fastmail.fm> (Matt Lundin's message of "Tue, 29 Jul 2014 13:55:27 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Lundin Cc: Bastien , Org Mode Hello, Matt Lundin 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'. Regards, -- Nicolas Goaziou