diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-25 12:07:12 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-25 12:07:12 -0600 |
| commit | c88429fc0f57e6729b58b28093b54c5e817a943c (patch) | |
| tree | 2efce6566f95b3b5529de621ce4c31d814525a01 /modules/system-utils.el | |
| parent | f5b744f9e15d1f07f41201a56b0376784744d8df (diff) | |
| download | dotemacs-c88429fc0f57e6729b58b28093b54c5e817a943c.tar.gz dotemacs-c88429fc0f57e6729b58b28093b54c5e817a943c.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.el | 6 |
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 |
