summaryrefslogtreecommitdiff
path: root/modules/system-utils.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-25 12:07:12 -0600
committerCraig Jennings <c@cjennings.net>2026-02-25 12:07:12 -0600
commitf755e54ee94df29e345e5ca5d53ce95b6f53a9a7 (patch)
treeb10bfe801e0a21bf76792897cf1474a60887f180 /modules/system-utils.el
parent6ec4857d0c4c1f43b42bb83c355e150f1aabd4d8 (diff)
feat(buffer): add open-with-default-app and open-with-program keybindings
Wire cj/xdg-open (C-; b o) and cj/open-this-file-with (C-; b O) into the buffer keymap. Fix xdg-open fallback to try buffer-file-name before dired context. Remove old C-c x o binding from external-open.
Diffstat (limited to 'modules/system-utils.el')
-rw-r--r--modules/system-utils.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/system-utils.el b/modules/system-utils.el
index 1bd7f015..29076f6d 100644
--- a/modules/system-utils.el
+++ b/modules/system-utils.el
@@ -106,7 +106,11 @@ Signals an error if the host is unsupported."
"Open FILENAME (or the file at point) with the OS default handler.
Logs output and exit code to buffer *external-open.log*."
(interactive)
- (let* ((file (expand-file-name (or filename (dired-file-name-at-point))))
+ (let* ((file (expand-file-name
+ (or filename
+ buffer-file-name
+ (and (derived-mode-p 'dired-mode) (dired-file-name-at-point))
+ (user-error "No file associated with this buffer"))))
(cmd (cj/identify-external-open-command))
(logbuf (get-buffer-create "*external-open.log*")))
(with-current-buffer logbuf