From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Bug on file publish Date: Mon, 27 Oct 2008 00:55:22 +0100 Message-ID: <4905036A.4000706@gmx.de> References: <98ECED6C-E9C1-48EA-B858-E580557834BF@uva.nl> <4904EAC1.40602@gmx.de> Reply-To: sebastian_rose@gmx.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KuFRt-0002fU-Er for emacs-orgmode@gnu.org; Sun, 26 Oct 2008 19:55:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KuFRr-0002fI-TU for emacs-orgmode@gnu.org; Sun, 26 Oct 2008 19:55:09 -0400 Received: from [199.232.76.173] (port=55672 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KuFRr-0002fF-O6 for emacs-orgmode@gnu.org; Sun, 26 Oct 2008 19:55:07 -0400 Received: from mail.gmx.net ([213.165.64.20]:56517) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KuFRr-0002L1-3I for emacs-orgmode@gnu.org; Sun, 26 Oct 2008 19:55:07 -0400 In-Reply-To: <4904EAC1.40602@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: org-mode , Carsten Dominik 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