0

M-x org-groff-export-to-groff works fine (exports .groff file for the org-file)

However, when I try to compile pdf from org-file with (M-x org-groff-export-to-pdf) following error show:

Saving file /home/garid/test.groff...
Wrote /home/garid/test.groff
Processing Groff file test.groff ...
shell-quote-argument: Wrong type argument: arrayp, nil

Could you explain what go wrong?

FYI, I added following configurations to my init.el for ox-groff.

(use-package org-contrib)
(require 'ox-groff)

enter image description here

2
  • 1
    ox-groff is buggy (that's why it's in the unsupported org-contrib package). Unfortunately, since there is no maintainer, there is no place to send a bug report. You will either have to fix it yourself (please submit any fixes you make by sending them to the Org mode mailing list: that way they will be available for everybody else), or ask at the Org mode mailing list, bearing in mind that it IS unsupported, so you may not get any response, or just use it to generate the groff file and then compile that by hand (I did the latter and it seems to work in a simple case).
    – NickD
    Nov 22, 2022 at 17:16
  • 1
    BTW, the buggy function seems to be org-groff-compile. It uses a variable out-dir which is set to nil and then used in a call to shell-quote-argument; but shell-quote-argument cannot deal with a nil argument.
    – NickD
    Nov 22, 2022 at 17:25

1 Answer 1

1

I got it working with one change to the ox-groff.el file. Change line 1897 from this:

     ...
     (out-dir (file-name-directory file))
     ...

to this:

     ...
     (out-dir (file-name-directory full-name))
     ...

In fact, the master branch of the repo you were pointed to in your other question (https://git.sr.ht/~bzg/org-contrib) already contains this fix, in contrast to the 0.4 version of org-contrib that you get from the ELPA (nongnu) repository. So to that extent, my comment above was too pessimistic: things do get fixed (but it is still unsupported).

5
  • Thank you for your great response. Even after changing to file to full-name, I got same output
    – Garid
    Nov 23, 2022 at 4:55
  • Did you reload the file after changing it? Or restart emacs? One way to check is to say C-h f org-groff-compile and then click on the link at the end of the first line, which will take you to the source code of the function; then scroll down and check that the line has indeed been changed. Once you are inside the function, you can do C-M-x to redefine the function, incorporating the change (assuming that it is present).
    – NickD
    Nov 23, 2022 at 10:23
  • Yes I have have done C-M-x at the org-groff-compile function, close and re-open emacs. The result is same
    – Garid
    Nov 24, 2022 at 3:34
  • 1
    Ah, Sorry, an update: when I start emacs --daemon I haven't noticed following lines: Source file ‘/home/garid/.config/emacs/elpa/org-contrib-0.4/ox-groff.el’ newer than byte-compiled file; using older file So emacs seems using the unchanged version of ox-groff
    – Garid
    Nov 24, 2022 at 5:12
  • 1
    an Update; finally done it. According to this question. With this line (setq load-prefer-newer t) added, my emacs uses newly changed ox-groff-compile, and it produces PDF as expected. Thank you
    – Garid
    Nov 24, 2022 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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