From 4c06b26b6b4f399e3d45f00c281f24a33a15cc66 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 20 Jul 2026 23:31:58 -0500 Subject: 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. --- modules/external-open.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') 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 ------------------- -- cgit v1.2.3