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: Sebastian Rose
Subject: Re: [Orgmode] Bug on file publish
Date: Mon, 27 Oct 2008 00:55:22 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

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?



It might be better to look for locked project files, or those still
opened in emacs, and ask the user to save those files before publishing
them. Unsaved changes in a buffer are not published before saving them
anyway. So a warning would be usefull anyway. A user might be surprised
if unsaved changes are not published, as unsaved changes are exported.




Anyway - here's the little patch:


diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 2af71d3..46fd055 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -430,7 +430,7 @@ matching the regexp SKIP-DIR when recursiing through BASE-DIR."
          (let ((fd-p (car (file-attributes f)))
                (fnd (file-name-nondirectory f)))
            (if (and fd-p recurse
-                    (not (string-match "^\\.+$" fnd))
+                    (not (string-match "^\\.+" fnd))
                     (if skip-dir (not (string-match skip-dir fnd)) t))
(org-publish-get-base-files-1 f recurse match skip-file skip-dir)
              (unless (or fd-p ;; this is a directory






reply via email to

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