emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* possible Bug: non-interactive publishing (emacs 22.1)
@ 2010-06-09 13:21 orgmode
  2010-06-09 21:22 ` Sebastian Rose
  0 siblings, 1 reply; 4+ messages in thread
From: orgmode @ 2010-06-09 13:21 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: orgmode


Hi Carsten,

when using org to publish non-interactively under 22.3.1 I get  
sometimes an error, depending on which publishing function I call.   
This does not happen during interactive calling of the publishing  
function (i.e. M-x org-publish ).

no error:
emacs -q -batch -l ../org-init.el --eval='(org-publish-all)'

with error:
emacs -q -batch -l ../org-init.el --eval='(org-publish "h-rd.org" t)'

(obviously the project h-rd.org exists, and is published without error  
and all components from org-publish-all)
error message:

Starting emacs
Loading subst-ksc...
Loading subst-gb2312...
Loading subst-big5...
Loading subst-jis...
Debugger entered--Lisp error: (wrong-type-argument listp "h-rd.org")
   cdr("h-rd.org")
   (plist-get (cdr p) :components)
   (setq components (plist-get (cdr p) :components))
   (if (setq components (plist-get ... :components)) (setq rest  
(append ... rest)                                                       
          ) (push p rtn))
   (while (setq p (pop rest)) (if (setq components ...) (setq rest  
...) (push p r                                                          
       tn)))
   (let ((rest projects-alist) rtn p components) (while (setq p ...)  
(if ... ...                                                             
     ...)) (nreverse (org-publish-delete-dups ...)))
   org-publish-expand-projects(("h-rd.org"))
   (mapc (lambda (project) (let* ... ... ... ... ... ...))  
(org-publish-expand-pr                                                  
               ojects projects))
   org-publish-projects(("h-rd.org"))
   (let* ((org-publish-use-timestamps-flag ...)) (org-publish-projects  
(list proj                                                              
   ect)))
   (save-window-excursion (let* (...) (org-publish-projects ...)))
   org-publish("h-rd.org" t)
   eval((org-publish "h-rd.org" t))
   command-line-1(("-l" "../org-init.el" "--eval=(org-publish  
\"h-rd.org\" t)"))
   command-line()
   normal-top-level()

emacs finished


greetings.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible Bug: non-interactive publishing (emacs 22.1)
  2010-06-09 13:21 possible Bug: non-interactive publishing (emacs 22.1) orgmode
@ 2010-06-09 21:22 ` Sebastian Rose
  2010-06-09 21:33   ` [Patch] " Sebastian Rose
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Rose @ 2010-06-09 21:22 UTC (permalink / raw)
  To: orgmode@h-rd.org; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

"orgmode@h-rd.org" <orgmode@h-rd.org> writes:
> Hi Carsten,
>
> when using org to publish non-interactively under 22.3.1 I get  sometimes an
> error, depending on which publishing function I call.   This does not happen
> during interactive calling of the publishing  function (i.e. M-x org-publish ).
>
> no error:
> emacs -q -batch -l ../org-init.el --eval='(org-publish-all)'
>
> with error:
> emacs -q -batch -l ../org-init.el --eval='(org-publish "h-rd.org" t)'
>
> (obviously the project h-rd.org exists, and is published without error  and all
> components from org-publish-all)
> error message:
>
> Starting emacs
> Loading subst-ksc...
> Loading subst-gb2312...
> Loading subst-big5...
> Loading subst-jis...
> Debugger entered--Lisp error: (wrong-type-argument listp "h-rd.org")
>   cdr("h-rd.org")
>   (plist-get (cdr p) :components)
>   (setq components (plist-get (cdr p) :components))
>   (if (setq components (plist-get ... :components)) (setq rest  (append
> ... rest)                                                              ) (push p
> rtn))
>   (while (setq p (pop rest)) (if (setq components ...) (setq rest  ...) (push p
> r                                                              tn)))
>   (let ((rest projects-alist) rtn p components) (while (setq p ...)  (if ... ...
> ...)) (nreverse (org-publish-delete-dups ...)))
>   org-publish-expand-projects(("h-rd.org"))
>   (mapc (lambda (project) (let* ... ... ... ... ... ...))
> (org-publish-expand-pr
> ojects projects))
>   org-publish-projects(("h-rd.org"))
>   (let* ((org-publish-use-timestamps-flag ...)) (org-publish-projects  (list
> proj                                                              ect)))
>   (save-window-excursion (let* (...) (org-publish-projects ...)))
>   org-publish("h-rd.org" t)
>   eval((org-publish "h-rd.org" t))
>   command-line-1(("-l" "../org-init.el" "--eval=(org-publish  \"h-rd.org\" t)"))
>   command-line()
>   normal-top-level()
>
> emacs finished
>
>
> greetings.




And here is a fix for publishing in batch-mode. Please test. It works
here, but I use emacs 24 only currently...



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-publish-batch-mode.patch --]
[-- Type: text/x-diff, Size: 668 bytes --]

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index fc18a9a..3f24863 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -756,7 +756,12 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
   (save-window-excursion
     (let* ((org-publish-use-timestamps-flag
 	    (if force nil org-publish-use-timestamps-flag)))
-      (org-publish-projects (list project)))))
+      (org-publish-projects
+       (if (stringp project)
+	   ;; If this function is called in batch mode,
+	   ;; project is still a string here.
+	   (list (assoc project org-publish-project-alist))
+	   (list project))))))
 
 ;;;###autoload
 (defun org-publish-all (&optional force)

[-- Attachment #3: Type: text/plain, Size: 34 bytes --]




Best wishes


    Sebastian




[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] possible Bug: non-interactive publishing (emacs 22.1)
  2010-06-09 21:22 ` Sebastian Rose
@ 2010-06-09 21:33   ` Sebastian Rose
  2010-06-10  9:51     ` [Solved] " orgmode
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Rose @ 2010-06-09 21:33 UTC (permalink / raw)
  To: orgmode@h-rd.org; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]



Sorry for the reply to my own mail.
But as Carsten is on vacation, I thought it might make sense to add the
`[Patch]' to the subject.


This patch fixes batch-mode publishing. Tested in emacs24 like this:

   sh$   emacs -q -batch --eval='(org-publish "PROJECT_NAME" t)'




[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-publish-batch-mode.patch --]
[-- Type: text/x-diff, Size: 668 bytes --]

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index fc18a9a..3f24863 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -756,7 +756,12 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
   (save-window-excursion
     (let* ((org-publish-use-timestamps-flag
 	    (if force nil org-publish-use-timestamps-flag)))
-      (org-publish-projects (list project)))))
+      (org-publish-projects
+       (if (stringp project)
+	   ;; If this function is called in batch mode,
+	   ;; project is still a string here.
+	   (list (assoc project org-publish-project-alist))
+	   (list project))))))
 
 ;;;###autoload
 (defun org-publish-all (&optional force)

[-- Attachment #3: Type: text/plain, Size: 25 bytes --]




Regards

   Sebastian

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Solved] [Patch] possible Bug: non-interactive publishing (emacs 22.1)
  2010-06-09 21:33   ` [Patch] " Sebastian Rose
@ 2010-06-10  9:51     ` orgmode
  0 siblings, 0 replies; 4+ messages in thread
From: orgmode @ 2010-06-10  9:51 UTC (permalink / raw)
  To: emacs-orgmode

Quoting Sebastian Rose <sebastian_rose@gmx.de>:

>
>
> Sorry for the reply to my own mail.
> But as Carsten is on vacation, I thought it might make sense to add the
> `[Patch]' to the subject.
>
>
> This patch fixes batch-mode publishing. Tested in emacs24 like this:
>
>    sh$   emacs -q -batch --eval='(org-publish "PROJECT_NAME" t)'
>
>
>
>
Hi Sebastian,

thanks, the patch works great (emacs 22)!!!
That was fast.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-10  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 13:21 possible Bug: non-interactive publishing (emacs 22.1) orgmode
2010-06-09 21:22 ` Sebastian Rose
2010-06-09 21:33   ` [Patch] " Sebastian Rose
2010-06-10  9:51     ` [Solved] " orgmode

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).