From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QDyBAuhKjmJ04wAAbAwnHQ (envelope-from ) for ; Wed, 25 May 2022 17:27:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GHpcAuhKjmJXawEAauVa8A (envelope-from ) for ; Wed, 25 May 2022 17:27:36 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AE3E7B136 for ; Wed, 25 May 2022 17:27:35 +0200 (CEST) Received: from localhost ([::1]:47252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntsv8-0001su-GA for larch@yhetil.org; Wed, 25 May 2022 11:27:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntsq6-0006So-QE for emacs-orgmode@gnu.org; Wed, 25 May 2022 11:22:24 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:38676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntsq4-0005KH-UT for emacs-orgmode@gnu.org; Wed, 25 May 2022 11:22:22 -0400 Received: by mail-lf1-x132.google.com with SMTP id c19so23462598lfv.5 for ; Wed, 25 May 2022 08:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2jz7/48+o3OLl9o83W9SyxGpSBTmoVczcI1svbi/Ey4=; b=NQGj1/bkmfd2w6Hpyx95ocdBktYVG8h0/0MVakUnZch/aKN2+9YLgXEbZQ3LLJqvXF KKL/PTdzIT4MeJANtQ6jTw3qaTncc3hnW3g+M3JFzxz8FxBP1ayE+qzxVtZGls6k/+Sq sMqpP5ubgfUOeUGKr1ZkmtvrZ1LaoM2i8BYUNtusnn5yaTXi4R+GSPd3UqUVSExJbeUm BtqdcRXm2PcRntnXm1fCspAyfhAsS4gNqr+Ol9JQOwc+qwqa7sohzB6plNH5ENL9E0bT yCXZCNtjVVd3otMh4qv/TeuhRGAwvuwTkeR25iO+Wp7txxArqFf4wz8RvMXYfTukc9OV vv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2jz7/48+o3OLl9o83W9SyxGpSBTmoVczcI1svbi/Ey4=; b=OdI/s/oPQY0Ye36SvD+OBAVtIdN0lwPUjRsP/hxE5uq11K+nkb6mLksDH/FjSXwvCk G9ieyxlapT9RElL80H81v75+ZtZrbB6sOlhpEpodP+QtyCVmGADA0dhWJ8axEc7uiTNM j3JH/BFUx4JVDZc97zm15Q7g5Z5e+StSmZoi7QY/lBP3EwlMWXAn/nMujEx8/UfoTOhC eE7xxVqgSdVJMeP+6/YzWhyYjf+UWnPdqbZXs/HFAIBG4qaag4GVKcglHqHdBfsBMElB aBFSm+JBKWtPCXjhNpLSZxoO4miAK7ZnhKBCny0iZNYOz2McKVUt5/LRc1YAIXigaCef kxQg== X-Gm-Message-State: AOAM5328UxD9ejlzG4aUwlzu8f6BYIoaAHA3kGFsq6qZd8V4J388Qvuw f0G+rk4S3bIh5gQAXTWAiOw= X-Google-Smtp-Source: ABdhPJz2re4UgE3DLTnYmwa+uDOS2dRKL2PDHUYcqusvagkBeEfxLxYIkEw2+EeeFhONUT2kyssCbw== X-Received: by 2002:a05:6512:260a:b0:43d:909a:50cf with SMTP id bt10-20020a056512260a00b0043d909a50cfmr23073830lfb.195.1653492138764; Wed, 25 May 2022 08:22:18 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id d4-20020a05651221c400b0047255d211c7sm3163993lft.246.2022.05.25.08.22.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 08:22:18 -0700 (PDT) Message-ID: <5fdf44d8-8d70-b882-d20d-c2c52b92ec53@gmail.com> Date: Wed, 25 May 2022 22:21:15 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Opening org-cite links with different application Content-Language: en-US To: Alessandro Bertulli Cc: emacs-orgmode@gnu.org References: <87czg1sny1.fsf@gmail.com> From: Max Nikulin In-Reply-To: <87czg1sny1.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=manikulin@gmail.com; helo=mail-lf1-x132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653492455; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2jz7/48+o3OLl9o83W9SyxGpSBTmoVczcI1svbi/Ey4=; b=P+ZbiQBOh5jypOhmqmcDIS1O6nyqxQ+vi5wKNns19gj6/5KTv0yNl2oedpSxdE7VlfgM7r n7OKCVLNoVARI4Hoj3TW9lOjjB2Tbf9H9xZbMCDdFMQApxOP+q7mGJ17B+ov5gEZYoHMeP Y+ZYc5eGhuFNhzgehGloRWvIllR3tEVKt6vpn/Rr7nObWVkD0pVLVTylb3uLx1Ql8avCy6 HTL+usxjKu4QtfIDiiAK0PhKnwtPOs0X9aijHTjQyXu0X6RzMiPSJmrMuwG+eRUxBtx3uK YyND/I4s1f3ytuHuE0S7mf/9z2Espx5JygkFlw3ja2PECaaDv61u0cFxoIvteQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653492455; a=rsa-sha256; cv=none; b=o1bcHQnwEfBNkC2+uW2erZLwF9oVXzKSsgkh/Tq1igX3LcXozYVI/Wy3qtXT4nlqDseDoi 1+eamb8HQgM7D+sdczAO9E2ExhY54E0aLljVc4U3BpzFwDP4TUWyYhLqQAfBXLMqK/kNAB G5TG8raL5piyMJcAmHwZSN390Q5p4MImBOcPDz7qLJLKcS6E0o/Hesk/IpbVusc42gg5JN DeWUGvFf6LqqvMwUC2ES3LSU6x0kATW5sO1SrAAzcqsMVuBKFn/o5xm/VUHu4JRZ2gnD1a TAzjzKKEnNB2UrBD3KQjyTKEzzE6+WZV02Cu/mntWfIF0KFWrzcZm66ADKfWpQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="NQGj1/bk"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.36 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="NQGj1/bk"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AE3E7B136 X-Spam-Score: 5.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: UadeKyoNxIS0 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