Ebib用系统默认app打开pdf文件

最近尝试使用Ebib,在此记录一些配置和问题。配置借鉴了duzaichuan的Ebib部分,稍作修改。附:Ebib手册摘要

设置使用系统默认应用软件打开pdf:

(setq ebib-file-associations '(("pdf" . embark-open-externally)) "use system's default application")

:exclamation:需要安装embark包,才可以使用embark-open-externally函数。若不想安装embark包,可以使用子龙山人写的consult-directory-externally函数。

另外,也可以使用command line来操作。Ebib手册中提及

If you need to pass further command-line options to the executable, you can do so, but you will need to include a directive %s in the string, which will be replaced with the full path to the file you are opening.

若使用MacOS的Preview App打开pdf, 则设置:

(setq ebib-file-associations '(("pdf" . "open -a Preview %s"))) 

其中,%s代表文件的完整路径,路径中可以包含空格。详情请阅作者回答

:exclamation:第一个方法运行无误。第二个方法,我在自己的emacs中没能成功打开,但是emacs的minibuffer显示执行中。原因待查。:thinking:

2 个赞