[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening org-cite links with different application

From: Max Nikulin
Subject: Re: Opening org-cite links with different application
Date: Wed, 25 May 2022 22:21:15 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 25/05/2022 21:10, Alessandro Bertulli wrote:

I'm not sure if it's the best way to do so, but it worked for me by
using a lambda:

(setq citar-file-open-function '(lambda (file)
          (async-shell-command (format-message "sioyek \"%s\"" file))))

First of all, it is unsafe. File names for papers downloaded from various sources may have enough fancy characters including double quotes, etc. having special meaning for shell.

Use at least `shell-quote-argument' instead of adding double quotes.

Depending on your OS I suggest to have a look at the implementation of `browse-url-xdg-open', `browse-url-default-macosx-browser', `browse-url-default-windows-browser' for an example how to start external viewer process.

On 25/05/2022 18:00, Bruce D'Arcus wrote:
You just need to set `citar-file-open-function` to your preferred
function; say xdg-open.

Is there a reason to avoid emacs global or even system global settings obtained through mailcap.el? While `mailcap-view-file' is quite new addition, the function was inspired by `org-open-file' and the latter queries mailcap settings.

Actually I suspect that there may be some problems especially with Emacs-27 (see "org--file-default-apps" thread), but the consequences is not clear for me yet.
mailcap-mime-data erased when parsing mime parts

reply via email to

[Prev in Thread] Current Thread [Next in Thread]