aboutsummaryrefslogtreecommitdiff
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
commitfbc78f28266300e160d05f91e9a6ceb31f4fa2c4 (patch)
treeeefd7e735c09f0329ebad3caedd3a06616dc1a4c /modules/system-utils.el
parentbe478c35411c9a4a8c7f4a94747c617be5269af8 (diff)
downloaddotemacs-fbc78f28266300e160d05f91e9a6ceb31f4fa2c4.tar.gz
dotemacs-fbc78f28266300e160d05f91e9a6ceb31f4fa2c4.zip
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