emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Bug on file publish


From: Carsten Dominik
Subject: Re: [Orgmode] Bug on file publish
Date: Mon, 27 Oct 2008 06:24:13 +0100

Hi Sebastian,

thanks for all this analysis.

On Oct 27, 2008, at 12:55 AM, Sebastian Rose wrote:

Hi,


I tried to use (file-locked-p f) in org-publish-base-files-1,
but I couldn't get it to work.

(file-locked-p "~/notes/index.org") ;; => t if "~/notes/.#index.org" exists.

.#index.org is only there, if I change the file without saving it. It's
removed, if I save the buffer.




A working quick fix:

Instead of
    (not (string-match "^\\.+$" fnd))
use
    (not (string-match "^\\.+" fnd))

in org-publish-base-files-1

Drawbacks:
- we can't export hidden files anymore.
 Or is that a feature?


Very good question. I don't think it would be good to exclude them always, at least as "attachments" they would make sense, for example for defining certain permissions in html directories which are, if I remember correctly, stored in dotfiles.

I see two solutions:

- exclude files starting with ".#"
- do more explicit checking by resolving the link and looking at the file pointed to.

The first one looks simple and perfectly effective to me. Also it seems to me that, since these links seem to pop up as an indication that the file is being modified, they should *never* be published! So we should exclude these for sure.

However, dead soft links could be a problem in general. So we could also check for
(file-exists-p (file-truename file))

Should I add both?

- Carsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]