emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Arun Isaac <theroarofthedragon@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: org-publish-find-title called before cache initialization signals "no cache present" [8.3.1 (release_8.3.1-505-g6b2c38 @ /home/arunisaac/.emacs.d/org-mode/lisp/)]
Date: Sun, 06 Dec 2015 18:55:07 +0100	[thread overview]
Message-ID: <8737vfo41w.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87mvtsuace.fsf@gmail.com> (Arun Isaac's message of "Wed, 02 Dec 2015 21:11:21 +0530")

Hello,

Arun Isaac <theroarofthedragon@gmail.com> writes:

> If org-publish-find-title is called before org-publish-cache is
> initialized (by some routine calling org-publish-initialize-cache), a
> "no cache present" error is signalled.
>
> This happens because org-publish-find-title does not pass a PROJECT-NAME
> argument to org-publish-cache-get-file-property. Only if a PROJECT-NAME
> argument is passed to org-publish-cache-get-file-property does it
> initialize the cache.
>
> Can this be considered a bug? Is org-publish-cache-get-file-property
> supposed to automatically initialize the cache if it is not present? Or
> is the user supposed to initialize the cache manually if required?
>
> In my use case, my preparation-function calls
> org-publish-find-title. However org-publish-projects initializes the
> cache only after executing the preparation function. Hence I get a "no
> cache present" error.

IIUC, you are responsible for calling `org-publish-find-title', an
internal "ox-publish" function, before `org-publish-cache' is
initialized. In this case I tend to think that you are also responsible
for taking care of the cache.

> I could work around this problem by simply initializing the cache on my
> own. But, I'm wondering if this can be fixed at a more fundamental
> level.

You can suggest a patch, if you want to.

The problem is that functions calling
`org-publish-cache-get-file-property' do not usually know about the
current project name. Calling `org-publish-get-project-from-filename'
each time is a bit expensive, IMO.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-12-06 17:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 15:41 Bug: org-publish-find-title called before cache initialization signals "no cache present" [8.3.1 (release_8.3.1-505-g6b2c38 @ /home/arunisaac/.emacs.d/org-mode/lisp/)] Arun Isaac
2015-12-06 17:55 ` Nicolas Goaziou [this message]
2015-12-07 12:09   ` Arun Isaac

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=8737vfo41w.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=theroarofthedragon@gmail.com \
    /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).