Created
December 3, 2014 22:20
-
-
Save oantolin/1846eef35ec49c359b69 to your computer and use it in GitHub Desktop.
Turn off openwith-mode for certain commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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