getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
59 stars 95 forks source link

[orgmode] nikola fails to build with python source code blocks #252

Open flydecahedron opened 6 years ago

flydecahedron commented 6 years ago

Here is the error I get:

Scanning posts..........done!
.  render_posts:timeline_changes
.  render_posts:cache/posts/nikola-org-mode.html
Loading /home/eroc/nikola/blog/plugins/orgmode/conf.el (source)...
Wrong type argument: processp, nil
########################################
TaskError - taskid:render_posts:cache/posts/nikola-org-mode.html
PythonAction Error
Traceback (most recent call last):
  File "/home/eroc/nikola/blog/plugins/orgmode/orgmode.py", line 74, in compile
    subprocess.check_call(command)
  File "/usr/lib64/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['emacs', '--batch', '-l', '/home/eroc/nikola/blog/plugins/orgmode/init.el', '--eval', '(nikola-html-export "/home/eroc/nikola/blog/posts/nikola-org-mode.org" "/home/eroc/nikola/blog/cache/posts/nikola-org-mode.html")']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eroc/nikola/lib/python3.6/site-packages/doit/action.py", line 403, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/eroc/nikola/lib/python3.6/site-packages/nikola/post.py", line 579, in compile
    lang)
  File "/home/eroc/nikola/blog/plugins/orgmode/orgmode.py", line 94, in compile
    source, e.returncode))
Exception: Cannot compile posts/nikola-org-mode.org -- bad org-mode configuration (return code 255)

Now here is my .org file in question: https://pastebin.com/HwBy3PUy

Whenever I delete this code block it builds:

#+BEGIN_SRC python
# Add the orgmode compiler to your COMPILERS dict.
COMPILERS["orgmode"] = ('.org',)

# Add org files to your POSTS, PAGES
POSTS = POSTS + (("posts/*.org", "posts", "post.tmpl"),)
PAGES = PAGES + (("stories/*.org", "stories", "story.tmpl"),)
#+END_SRC

And, when I change the source code block type (like to c) it builds.

But, when I try to make a new blank post with only that code block, that new post builds! Some help would be most appreciated, especially since I'm trying to make a post about using this plugin! :) Edit: Fixed the formatting

nashamri commented 6 years ago

@flydecahedron What version of Emacs are you using when you got this error? I got this error with emacs 26, but it's gone with emacs 25.

zhuzixian commented 6 years ago

emacs 26 indeed have this problem.