aboutsummaryrefslogtreecommitdiff
path: root/modules/custom-buffer-file.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/custom-buffer-file.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/custom-buffer-file.el')
-rw-r--r--modules/custom-buffer-file.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/custom-buffer-file.el b/modules/custom-buffer-file.el
index 92e73c3d..f99a0ee4 100644
--- a/modules/custom-buffer-file.el
+++ b/modules/custom-buffer-file.el
@@ -32,6 +32,7 @@
;; mm-decode for email viewing (mm-handle-type is a macro, needs early require)
(require 'mm-decode)
+(require 'external-open) ;; for cj/xdg-open, cj/open-this-file-with
;; cj/kill-buffer-and-window defined in undead-buffers.el
(declare-function cj/kill-buffer-and-window "undead-buffers")
@@ -446,7 +447,9 @@ Signals an error if:
"S" #'write-file ;; save as
"g" #'revert-buffer
"w" #'cj/view-buffer-in-eww
- "e" #'cj/view-email-in-buffer)
+ "e" #'cj/view-email-in-buffer
+ "o" #'cj/xdg-open
+ "O" #'cj/open-this-file-with)
(when (boundp 'cj/custom-keymap)
(keymap-set cj/custom-keymap "b" cj/buffer-and-file-map))
@@ -473,7 +476,9 @@ Signals an error if:
"C-; b S" "save as"
"C-; b g" "revert buffer"
"C-; b w" "view in EWW"
- "C-; b e" "view email"))
+ "C-; b e" "view email"
+ "C-; b o" "open with default app"
+ "C-; b O" "open with program..."))
(provide 'custom-buffer-file)