From f755e54ee94df29e345e5ca5d53ce95b6f53a9a7 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 25 Feb 2026 12:07:12 -0600 Subject: 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. --- modules/system-utils.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/system-utils.el') 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 -- cgit v1.2.3