From 927b50b7aec2da105bd5125dec272a89e38663c3 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 5 Oct 2020 23:18:01 -0400 Subject: Fold lisp/bandali-utils.el back into init.el --- lisp/bandali-dired.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/bandali-dired.el') diff --git a/lisp/bandali-dired.el b/lisp/bandali-dired.el index 4755a64..9ed1030 100644 --- a/lisp/bandali-dired.el +++ b/lisp/bandali-dired.el @@ -57,6 +57,15 @@ (set-window-configuration wnd)))) (error "no more than 2 files should be marked")))) + (defun b/dired-start-process (program &optional args) + "Open current file with a PROGRAM." + ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS + ;; can be nil, so remove it). + (declare-function dired-get-file-for-visit "dired") + (apply #'b/start-process + program + (remove nil (list args (dired-get-file-for-visit))))) + ;; local key bindings (define-key dired-mode-map (kbd "b") #'dired-up-directory) (define-key dired-mode-map (kbd "E") #'dired-ediff-files) -- cgit v1.2.3-83-g751a