From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Bug on file publish Date: Mon, 27 Oct 2008 08:22:34 +0100 Message-ID: References: <98ECED6C-E9C1-48EA-B858-E580557834BF@uva.nl> <4904EAC1.40602@gmx.de> <4905036A.4000706@gmx.de> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: multipart/mixed; boundary="===============1285201329==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KuMR3-0002Qb-2F for emacs-orgmode@gnu.org; Mon, 27 Oct 2008 03:22:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KuMR1-0002No-0Y for emacs-orgmode@gnu.org; Mon, 27 Oct 2008 03:22:44 -0400 Received: from [199.232.76.173] (port=39820 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KuMR0-0002NW-PH for emacs-orgmode@gnu.org; Mon, 27 Oct 2008 03:22:42 -0400 Received: from mx20.gnu.org ([199.232.41.8]:12062) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KuMR0-0007Mr-76 for emacs-orgmode@gnu.org; Mon, 27 Oct 2008 03:22:42 -0400 Received: from ug-out-1314.google.com ([66.249.92.168]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KuMQy-00081p-VK for emacs-orgmode@gnu.org; Mon, 27 Oct 2008 03:22:41 -0400 Received: by ug-out-1314.google.com with SMTP id 36so187790uga.17 for ; Mon, 27 Oct 2008 00:22:38 -0700 (PDT) In-Reply-To: <4905036A.4000706@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 To: sebastian_rose@gmx.de Cc: org-mode --===============1285201329== Content-Type: multipart/alternative; boundary=Apple-Mail-1--175664789 --Apple-Mail-1--175664789 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Sebastian and Richard, I just pushed what I think fixes this bug, please verify. Thanks. - Carsten 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? > > > > 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 > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Apple-Mail-1--175664789 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Sebastian and = Richard,

I just pushed what I think fixes this bug, please = verify.

Thanks.

- Carsten

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") ;; =3D> 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)))
=             &n= bsp; (fnd (file-name-nondirectory f)))
=           (if (and = fd-p recurse
- =             &n= bsp;      (not (string-match "^\\.+$" = fnd))
+ =             &n= bsp;      (not (string-match "^\\.+" = fnd))
=             &n= bsp;      (if skip-dir (not (string-match = skip-dir fnd)) t))
=             &n= bsp; (org-publish-get-base-files-1 f recurse match skip-file = skip-dir)
=             (u= nless (or fd-p ;; this is a directory




_______________________________________________
Emacs-orgmode mailing = list
Remember: use `Reply All' = to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.= gnu.org/mailman/listinfo/emacs-orgmode

= --Apple-Mail-1--175664789-- --===============1285201329== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1285201329==--