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 | c1c3f31b3fa01754fa8d90c34a70bf80e1102b95 (patch) | |
| tree | aa5bd062b34a361a6174b8dbf139c07832284bcc /modules/org-webclipper.el | |
| parent | c488a342596e51b4eb717678e9e764d569918725 (diff) | |
| download | dotemacs-c1c3f31b3fa01754fa8d90c34a70bf80e1102b95.tar.gz dotemacs-c1c3f31b3fa01754fa8d90c34a70bf80e1102b95.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-webclipper.el')
| -rw-r--r-- | modules/org-webclipper.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/org-webclipper.el b/modules/org-webclipper.el index 9c2f10617..99e837e63 100644 --- a/modules/org-webclipper.el +++ b/modules/org-webclipper.el @@ -168,6 +168,9 @@ It fetches the page content and converts it to Org format." ;; and fail with a `void-variable widget-field-keymap' error from ;; the customize machinery loading lazily. (require 'org-web-tools) + (unless (executable-find "pandoc") + (user-error + "pandoc not found on PATH; it is required to convert the clipped page to Org")) (setq org-web-tools-pandoc-sleep-time 0.5) (let ((url cj/--webclip-url) |
