Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Turn off openwith-mode for certain commands
(defun turn-off-openwith-mode (orig-fun &rest args)
"Ensure openwtih-mode is off when running dired-mark-files-containing-regexp"
(let ((openwith-mode-on? openwith-mode))
(when openwith-mode-on? (openwith-mode -1))
(apply orig-fun args)
(when openwith-mode-on? (openwith-mode 1))))
(dolist (cmd '(dired-mark-files-containing-regexp message-send-and-exit))
(advice-add cmd :around #'turn-off-openwith-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment