diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-25 17:51:17 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-25 17:51:17 -0500 |
| commit | f867f50d1675d5f9a251f7b5a2633d2eac3f0de7 (patch) | |
| tree | f7ae2a1b5d76d3434dc7ad745306bd0c2b04896a /modules/org-export-config.el | |
| parent | da926d8d0af456512313b40d7625bb21ced63a8e (diff) | |
| download | dotemacs-f867f50d1675d5f9a251f7b5a2633d2eac3f0de7.tar.gz dotemacs-f867f50d1675d5f9a251f7b5a2633d2eac3f0de7.zip | |
fix(org): guard external-tool assumptions in export and publishing commands
Four export/publishing commands shelled out to external tools without checking they exist, so a missing tool surfaced as an opaque process error — or, for reveal.js, a silently broken presentation. I added a command-time guard to each that names the tool and what's needed:
- zathura, in the pandoc PDF export-and-open command
- the hugo binary and the platform file-manager opener, in hugo-config
- the local reveal.js checkout (run scripts/setup-reveal.sh), shared by the reveal export and preview commands
- pandoc, in the web-clip protocol handler
The checks run only when the command runs, so startup stays quiet. Each guard has a test asserting the user-error fires when the tool is absent, and the existing happy-path tests now stub the lookups so they exercise the real path rather than tripping the new guard.
Diffstat (limited to 'modules/org-export-config.el')
| -rw-r--r-- | modules/org-export-config.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/org-export-config.el b/modules/org-export-config.el index 493316f9..5a6f09fc 100644 --- a/modules/org-export-config.el +++ b/modules/org-export-config.el @@ -98,6 +98,8 @@ (defun my/org-pandoc-export-to-pdf-and-open () "Export to PDF via pandoc and open with Zathura." (interactive) + (unless (executable-find "zathura") + (user-error "Cannot open the exported PDF: zathura is not installed or not on PATH")) (let ((pdf-file (org-pandoc-export-to-latex-pdf))) (when pdf-file (start-process "zathura-pdf" nil "zathura" pdf-file) |
