summaryrefslogtreecommitdiff
path: root/modules/external-open.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/external-open.el')
-rw-r--r--modules/external-open.el23
1 files changed, 1 insertions, 22 deletions
diff --git a/modules/external-open.el b/modules/external-open.el
index c9b5f1f6..0d6ec520 100644
--- a/modules/external-open.el
+++ b/modules/external-open.el
@@ -23,6 +23,7 @@
(require 'host-environment) ;; environment information functions
(require 'system-lib) ;; for cj/file-from-context
+(require 'external-open-lib) ;; pure dispatch helpers
(require 'cl-lib)
;; Declare platform-specific functions
@@ -89,28 +90,6 @@
:type '(repeat (regexp :tag "File extension regexp"))
:group 'external-open)
-;; ----------------------- External-Open Command Resolution -------------------
-
-(defun cj/external-open-command ()
- "Return the OS-default \"open\" command for this host, or nil if unsupported.
-Returns one of \"xdg-open\" (Linux), \"open\" (macOS), \"start\" (Windows).
-Callers that require a command should error on nil with a contextual
-message so the user sees what feature is unavailable."
- (cond
- ((env-linux-p) "xdg-open")
- ((env-macos-p) "open")
- ((env-windows-p) "start")
- (t nil)))
-
-(defun cj/external-open-launcher-p (command)
- "Return non-nil when COMMAND is a desktop launcher.
-Launchers (xdg-open, open, start) need to be called with `call-process'
-and a zero BUFFER argument so they fully detach from Emacs. Other
-commands get `start-process-shell-command' so their output is visible."
- (and (stringp command)
- (member command '("xdg-open" "open" "start"))
- t))
-
(defun cj/xdg-open (&optional filename)
"Open FILENAME (or the file at point) with the OS default handler.
Logs output and exit code to buffer *external-open.log*."