aboutsummaryrefslogtreecommitdiff
path: root/modules/external-open.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
commit4c06b26b6b4f399e3d45f00c281f24a33a15cc66 (patch)
treed36ec04c1c4774b3542decbb678e56eb2d3b4141 /modules/external-open.el
parent019057c7902ca0286b2ae9f0148f29bc53487dcd (diff)
downloaddotemacs-4c06b26b6b4f399e3d45f00c281f24a33a15cc66.tar.gz
dotemacs-4c06b26b6b4f399e3d45f00c281f24a33a15cc66.zip
fix(external-open): guard looping video open behind executable-find
The command fires via the find-file advice, so visiting a video without mpv on PATH threw an opaque call-process error mid-visit.
Diffstat (limited to 'modules/external-open.el')
-rw-r--r--modules/external-open.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/external-open.el b/modules/external-open.el
index 306db94f..f7f09816 100644
--- a/modules/external-open.el
+++ b/modules/external-open.el
@@ -197,6 +197,11 @@ blocks Emacs."
(if (env-windows-p)
(w32-shell-execute "open" cj/video-open-command
(mapconcat (lambda (a) (format "\"%s\"" a)) args " "))
+ ;; Guard like `cj/open-this-file-with': this fires via the find-file
+ ;; advice, so a missing player must fail with a clear message, not an
+ ;; opaque call-process error mid-visit.
+ (unless (executable-find cj/video-open-command)
+ (user-error "Program not found: %s" cj/video-open-command))
(apply #'call-process cj/video-open-command nil 0 nil args))))
;; -------------------- Open Files With Default File Handler -------------------