On 25/05/2022 23:00, Bruce D'Arcus wrote:
On Wed, May 25, 2022 at 11:26 AM Max Nikulin wrote:
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.
No reason, other than that nobody suggested it.
It could be, however, that when using citar, some users may have more
specialized needs. For example, maybe Alessandro wants to use Sioyek
when reading PDFs of scholarly articles and such, but the standard
system PDF viewer otherwise.
But I suppose these aren't mutually exclusive; citar could always,
notwithstanding the bug you note below, fallback to making use of
mailcap?
Disclaimer: I am not a citar user, so be skeptic concerning my
suggestions. I suppose `mailcap-view-file' (when available) and
`org-open-file' are at least reasonable defaults when a user has
expressed their wishes by configuring citar.
It would be great to open the cited document at the particular page
(e.g. from the locator), but there are a lot of complications on this
way. The file may contain only a range of pages, every PDF viewer has
its own way to specify a page or a string to search for. `org-file-apps'
might be tuned for such purpose (modulo a bug in handling of additional
arguments).
I have had a quick glance into the code I have an additional question
why `browse-url' is not used for `citar-file-open-external'.
On 25/05/2022 23:24, Alessandro Bertulli wrote:
I can't use browse-url-xdg-open because the PDF viewer I want to use
it's not the system default one: when opening PDFs from Org-cite I
expect to open academic documents, so I use Sioyek for them.
I mean
(call-process "xdg-open" nil 0 nil url)
with "sioyek" instead of "xdg-open" if you do not like to set the
application as the default handler for PDF files. It will allow to avoid
additional settings for shell buffers. Of course, you will loose ability
to check command output for errors, it is shoot and forget method
suitable for most of viewers however.