diff --git a/eaf.el b/eaf.el index fed45993c..aaf5469f1 100644 --- a/eaf.el +++ b/eaf.el @@ -539,12 +539,18 @@ Turning on this option can quickly rebuild the buffer very conveniently, avoidin Only turn off this option when you want investigate the cause of the crash." :type 'boolean) -(defcustom eaf-dired-advisor-enable t +(defcustom eaf-dired-advisor-enable nil "Toggle to enable/disable the EAF advisor in dired. When enabled, EAF will use eaf-file-manager to open file from dired." :type 'boolean) +(defcustom eaf-find-file-advisor-enable nil + "Toggle to enable/disable the EAF advisor for find-file. + +When enabled, EAF will use eaf-file-manager to open files." + :type 'boolean) + (defvar eaf--monitor-configuration-p t "When this variable is non-nil, `eaf-monitor-configuration-change' executes. This variable is used to open buffer in backend and avoid graphics blink. @@ -1979,8 +1985,9 @@ You can configure a blacklist using `eaf-find-file-ext-blacklist'" It currently identifies PDF, videos, images, and mindmap file extensions." (eaf--find-file orig-fn file nil args)) -(advice-add #'find-file :around #'eaf--find-file-advisor) -(advice-add #'org-open-file :around #'eaf--find-file-advisor) +(when eaf-find-file-advisor-enable + (advice-add #'find-file :around #'eaf--find-file-advisor) + (advice-add #'org-open-file :around #'eaf--find-file-advisor)) ;; Use `eaf-open' in `dired-find-file' and `dired-find-alternate-file' (defun eaf--dired-find-file-advisor (orig-fn)