emacs dired和openwith

I R*_*Rom 6 emacs elisp dired

我想在从dired模式打开图像文件时配置emacs以使用外部应用程序.

另一方面,我也想在emacs缓冲区中使用内联图像.

要在外部应用程序中打开文件,我使用openwith.elhttp://www.emacswiki.org/emacs/OpenWith

openwith minor模式的问题在于它是全局的,并且当它由dired-mode-hook启用时

(add-hook 'dired-mode-hook
          (lambda ()
            (setq truncate-lines t)
            (openwith-mode t)
            ))
Run Code Online (Sandbox Code Playgroud)

它遍布各处,emacs缓冲区中的所有内嵌图像都在外部应用程序中打开.

我试图改变

:global t 
Run Code Online (Sandbox Code Playgroud)

:global nil 
Run Code Online (Sandbox Code Playgroud)

openwith.el中,但它以某种方式完全禁用了openwith模式.

所以,我的问题是:如何告诉emacs只使用带有dired缓冲区的openwith minor模式而不是其他地方?

谢谢.

vpi*_*833 0

一种方法是将 emacsclient 设置为您在openwith-associationsopenwith.el 中喜欢的文件类型的首选程序,然后开始使用 emacsclient。

您可以每次都启动新的 emacs 会话,但这听起来比之前的建议更难看。