diff options
Diffstat (limited to '.config/emacs/modules/bd--files.el')
-rw-r--r-- | .config/emacs/modules/bd--files.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/.config/emacs/modules/bd--files.el b/.config/emacs/modules/bd--files.el index b8a5f4a..6ea121b 100644 --- a/.config/emacs/modules/bd--files.el +++ b/.config/emacs/modules/bd--files.el @@ -3,14 +3,15 @@ ;;; Code: +(require 'recentf) (defmacro bd/defun-find-file-wrapper (name types open-f) `(defun ,name (f &rest args) "Wrapper around F (find-file), passing ARGS." (if (string-match (regexp-opt ,types) (or (file-name-extension (car args)) "")) - (progn - (,(eval open-f) (car args)) - (recentf-add-file (car args)) - nil) + (progn + (,(eval open-f) (car args)) + (recentf-add-file (car args)) + nil) (apply f args)))) ;;;; dired @@ -39,8 +40,8 @@ (start-process (concat "zathura (" (file-name-base file) ")") nil "zathura" (expand-file-name file))) (bd/defun-find-file-wrapper bd/pdf-find-file-wrapper - '("epub" "pdf") - #'bd/zathura) + '("epub" "pdf") + #'bd/zathura) (advice-add 'find-file :around #'bd/pdf-find-file-wrapper) ;; video @@ -50,8 +51,8 @@ (bd/defun-find-file-wrapper bd/video-find-file-wrapper - '("mkv" "mov" "mp4" "webm" "m4v" "wav" "mp3" "opus" "ogv" "flac") - #'bd/mpv) + '("mkv" "mov" "mp4" "webm" "m4v" "wav" "mp3" "opus" "ogv" "flac") + #'bd/mpv) (advice-add 'find-file :around 'bd/video-find-file-wrapper) ;; image @@ -59,8 +60,8 @@ "Open FILE with nsxiv" (start-process (concat "nsxiv (" (file-name-base file) ")") nil "nsxiv" (expand-file-name file))) (bd/defun-find-file-wrapper bd/image-find-file-wrapper - '("jpg" "jpeg" "png" "webp" "bmp" "ico" "gif" "JPG" "PNG") - #'bd/nsxiv) + '("jpg" "jpeg" "png" "webp" "bmp" "ico" "gif" "JPG" "PNG") + #'bd/nsxiv) (advice-add 'find-file :around 'bd/image-find-file-wrapper) |