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.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40247
mailcap-mime-data erased when parsing mime parts

Reply via email to