1

Description

Below I include

  • a minimal Emacs init file
  • a minimal org file

Attempting to export the org file to HTML (by using C-c C-e h h) results in the error Wrong type argument: processp, nil. A full debugger backtrace is included at the bottom.

This error can be made to disappear by removing any single one of the following three items:

  1. (use-package elpy)
  2. (use-package htmlize)
  3. The source block from the org file.

How can I resolve this problem?

Details

Configuration:

  • Emacs 25.1.1
  • Org mode 8.2.10
  • elpy 20180406.217
  • htmlize 20180328.2341
  • use-package 20180314.1143

$HOME/.emacs.d/init.el:

(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa"     . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("gnu"       . "http://elpa.gnu.org/packages/"))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))

(setq use-package-always-ensure t)
(put 'use-package 'lisp-indent-function 1)

(use-package org
  :config
  (require 'ox-html) ;; Hack around backends not appearing in export dispatcher
  (require 'ox-latex))

(use-package htmlize)

(use-package elpy)


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (elpy htmlize use-package))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

Org file

#+BEGIN_SRC shell
# comment
echo "string" > file
#+END_SRC

Debugger output

Debugger entered--Lisp error: (wrong-type-argument processp nil)
  process-command(nil)
  shell-mode()
  org-html-fontify-code("# comment\necho \"string\" > file\n" "shell")
  org-html-do-format-code("# comment\necho \"string\" > file\n" "shell" nil t nil)
  org-html-format-code((src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #2)) #0))) (:export-options nil :input-file "/home/jacek/DELETEME/emacs-htmlize-org-export-disaster/.emacs.d/testing.org" :input-buffer "testing.org" :html-extension "html" :html-link-org-as-html t :html-doctype "xhtml-strict" :html-container "div" :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :html-head-include-default-style t :html-head-include-scripts t :html-table-attributes (:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") :html-table-row-tags ("<tr>" . "</tr>") :html-xml-declaration (("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-inline-images t :infojs-opt nil :creator "<a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 25.1.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)" :with-latex t ...))
  org-html-src-block((src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #2)) #0))) nil (:export-options nil :input-file "/home/jacek/DELETEME/emacs-htmlize-org-export-disaster/.emacs.d/testing.org" :input-buffer "testing.org" :html-extension "html" :html-link-org-as-html t :html-doctype "xhtml-strict" :html-container "div" :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :html-head-include-default-style t :html-head-include-scripts t :html-table-attributes (:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") :html-table-row-tags ("<tr>" . "</tr>") :html-xml-declaration (("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-inline-images t :infojs-opt nil :creator "<a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 25.1.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)" :with-latex t ...))
  org-export-data((src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #2)) #0))) (:export-options nil :input-file "/home/jacek/DELETEME/emacs-htmlize-org-export-disaster/.emacs.d/testing.org" :input-buffer "testing.org" :html-extension "html" :html-link-org-as-html t :html-doctype "xhtml-strict" :html-container "div" :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :html-head-include-default-style t :html-head-include-scripts t :html-table-attributes (:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") :html-table-row-tags ("<tr>" . "</tr>") :html-xml-declaration (("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-inline-images t :infojs-opt nil :creator "<a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 25.1.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)" :with-latex t ...))
  #[(element) "\302    \"\207" [element info org-export-data] 3]((src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #2)) #0))))
  mapconcat(#[(element) "\302  \"\207" [element info org-export-data] 3] ((src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #3)) #1)))) "")
  org-export-data((section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #0)) (src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent #0))) (:export-options nil :input-file "/home/jacek/DELETEME/emacs-htmlize-org-export-disaster/.emacs.d/testing.org" :input-buffer "testing.org" :html-extension "html" :html-link-org-as-html t :html-doctype "xhtml-strict" :html-container "div" :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :html-head-include-default-style t :html-head-include-scripts t :html-table-attributes (:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") :html-table-row-tags ("<tr>" . "</tr>") :html-xml-declaration (("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-inline-images t :infojs-opt nil :creator "<a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 25.1.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)" :with-latex t ...))
  #[(element) "\302    \"\207" [element info org-export-data] 3]((section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #0)) (src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent #0))))
  mapconcat(#[(element) "\302  \"\207" [element info org-export-data] 3] ((section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent (org-data nil #1)) (src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent #1)))) "")
  org-export-data((org-data nil (section (:begin 1 :end 60 :contents-begin 1 :contents-end 60 :post-blank 0 :parent #0) (src-block (:language "shell" :switches nil :parameters nil :begin 1 :end 60 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "# comment\necho \"string\" > file\n" :post-blank 0 :post-affiliated 1 :parent #1)))) (:export-options nil :input-file "/home/jacek/DELETEME/emacs-htmlize-org-export-disaster/.emacs.d/testing.org" :input-buffer "testing.org" :html-extension "html" :html-link-org-as-html t :html-doctype "xhtml-strict" :html-container "div" :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :html-head-include-default-style t :html-head-include-scripts t :html-table-attributes (:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") :html-table-row-tags ("<tr>" . "</tr>") :html-xml-declaration (("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-inline-images t :infojs-opt nil :creator "<a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 25.1.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)" :with-latex t ...))
  org-export-as(html nil nil nil (:output-file "./testing.html"))
  org-export-to-file(html "./testing.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
1

There is no obvious link with elpy package in your settings. Two small modifications of your code seems to be needed:

  1. In your org file you need: #+BEGIN_SRC sh only.
  2. In your init file, you need to add: (require 'ob-sh) to org configuration.

Then the html file is generated without problems. I suggest also to upgrade to org 9.x

  • This seems to solve my problem. Thank you. As for org 9.x: That was the verison that was installed by the init.el I posted. How can I ensure that use-package installs org 9 automatically? The only method I am aware of at the moment is to upgrade it manually with via M-x list-packages. – jacg Apr 14 '18 at 15:59
  • So, if Org 9.x is installed correctly in your ELPA folder, then to be taken into account, in your configuration script, before :config add the line :load-path "ELPA/org-9x" and restart your emacs. Take care the 'ob-sh module was renamed 'ob-shell beginning with org-8.2. See also this site: blog.d46.us for an interesting configuration. – Ian Apr 15 '18 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.