- (eaf--find-file orig-fn file nil args))
- (advice-add #'find-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)
- "Advisor of `dired-find-file' and `dired-find-alternate-file' that opens EAF supported file using EAF.
- It currently identifies PDF, videos, images, and mindmap file extensions."
- (dolist (file (dired-get-marked-files))
- (eaf--find-file orig-fn file t)))
- (advice-add #'dired-find-file :around #'eaf--dired-find-file-advisor)
- (advice-add #'dired-find-alternate-file :around #'eaf--dired-find-file-advisor)
- (defun eaf--load-theme (&rest _ignores)
- (eaf-for-each-eaf-buffer
- (eaf-call-async "eval_function" eaf--buffer-id "update_theme" (key-description (this-command-keys-vector)))))
- (advice-add #'load-theme :after #'eaf--load-theme)
- (defun eaf-ocr-buffer ()
- (interactive)
- (eaf-call-async "ocr_buffer" eaf--buffer-id))