From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 6KyHC0ZTjmJVcwEAbAwnHQ (envelope-from ) for ; Wed, 25 May 2022 18:03:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wImHC0ZTjmIKhwAA9RJhRA (envelope-from ) for ; Wed, 25 May 2022 18:03:18 +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 ACABECD15 for ; Wed, 25 May 2022 18:03:17 +0200 (CEST) Received: from localhost ([::1]:59358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nttTf-0006jM-Vi for larch@yhetil.org; Wed, 25 May 2022 12:03:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nttRC-0005oG-2E for emacs-orgmode@gnu.org; Wed, 25 May 2022 12:00:45 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nttRA-0003sy-8E for emacs-orgmode@gnu.org; Wed, 25 May 2022 12:00:41 -0400 Received: by mail-wr1-x42f.google.com with SMTP id p10so12107578wrg.12 for ; Wed, 25 May 2022 09:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9PYTZ3w2EjbfUJiR6y7/WW7JNjbtLIL9kCXRPhUrsmc=; b=bGCt1VTRPxHLZ13wqzSQUX6C/qHmYF4lb+QKekYVHyErrgKpCWHD2gxDL8h1sHT9gy IrLFD3vYbfMbUfdMJVbaMif7YTnVTdREAMvj3bI0Q67Vgcbs4WJ6nijNr1KByAr4lO9G /DMebS3uPNMFvms+JhCjv444pdpSXzee5nPNl/4WnwaHyH6p/Lf+35FMJ43SuD8vKP7E 0DypyUfUDxcptrmamttj6oi7ooiXpfe3ed/cbC9s8F974VjZdrzaFPwPzsiHH56pwA36 V228cyR0mWO3RlBn5Zu6KuxzSGksbfwRH9iNvDXI9UDXABO6RFGkVTqbRRHoNIAZ6UZP GQaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9PYTZ3w2EjbfUJiR6y7/WW7JNjbtLIL9kCXRPhUrsmc=; b=eiDY1WZx5pGgWiLZHlsAJWmLoUXvPC72tiCF7Ejb3zwQEmz+aBoQPASu8Ns12B67ES djX2zmDxXiB4G1S5RU4XXkxS7Bepk0KvAc4UVc2ZzfjJVRtyQRLrlovrRWTD+bNc4+Il P3kAPv9ce0HJ7BPXLI3p7YyqWEQwc/tq3YnWbOop4KB08V0kh3VLFYgtbYxfjbLA+/C2 UWjFCxxvEM7Gbc+ppnePydJVSfT/mMpwhuM9LqSLjbMiRgzmKFL4bUo3VJEWSjCllZMz QMbdUkgIz2C2aBuRBNdCNjM7cX5gFjpzdc60JejfXR30zZO8nvY8SA8p/Ppqu2NUGwT6 0hUg== X-Gm-Message-State: AOAM533iKqYD2wetQXCn48nMio+KRjQm7s4ygwJPHciV/ZUNE+eoALNh MMB/c5mmKPTGewkPyMmHVE9QR4G0OP66ZL8/Jxo= X-Google-Smtp-Source: ABdhPJy3RiAUabgblJwyyIpCJVOtU0G9qRWCN68U46FO5ByJwjcd1iFNkHKjoTRDCCO2AHJwcx+bgvygb7+aJh+GWqc= X-Received: by 2002:a5d:5888:0:b0:20d:270f:6b61 with SMTP id n8-20020a5d5888000000b0020d270f6b61mr26928603wrf.211.1653494438135; Wed, 25 May 2022 09:00:38 -0700 (PDT) MIME-Version: 1.0 References: <87czg1sny1.fsf@gmail.com> <5fdf44d8-8d70-b882-d20d-c2c52b92ec53@gmail.com> In-Reply-To: <5fdf44d8-8d70-b882-d20d-c2c52b92ec53@gmail.com> From: "Bruce D'Arcus" Date: Wed, 25 May 2022 12:00:26 -0400 Message-ID: Subject: Re: Opening org-cite links with different application To: Max Nikulin Cc: Alessandro Bertulli , org-mode-email Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=bdarcus@gmail.com; helo=mail-wr1-x42f.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, 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=1653494597; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9PYTZ3w2EjbfUJiR6y7/WW7JNjbtLIL9kCXRPhUrsmc=; b=UoKTBR21jfVQxmfQeVHv3yxW+pBim0an/VA+lGbrNdabgekSThd0HxwN6gopwklyNpZ9qM mag9GL+qDehZwz4pWYlMUO+VbTB8K317nsS5IvSSp6G/flnGV6lCZ3LkUluppdMknHZmrx XQoSAhHn2PKkbQ/u4IT/hdzXOCdwaTJTbZfJAVTi5jGGzhBjyjwbRDAvJEPjSKcsnKXWXX XB2etiFeVw5XL5Aletl4uDXNJR4oyYxTlIND5NjH7h4jKQokILKXKJxtrlVVhf+Yiyavan NNyGzDt/5hWM9zHdaQ68PA74+DrDVvUENM7NXRT298OXcYyt307tHXsKhLsFmw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653494597; a=rsa-sha256; cv=none; b=DZnIO0iCY4lOwyoSw4w9b+gHOh2vw7R5FzMrTA16zC9CBrZ97HIeLM3XG9qHZy6TR+sBQK 0tcqbX0eLyWfI3h48MbDmFnh94FsGgBfZ9a3auCdGG5CPFog9pLxmAcuzD1w/emQhl96zG BfZYLExvrUbpmNhCznu+AL/cfLpIjIkeTSQjst1/lLmYIF9EVIyvLbR/J3zT+FBbyugOIv crByApOpUmPmLZUW76BS9SELW3Wn1X/DEFJvoJ8dVLRGNCzKN8UpDkXMoF6IdrlqBaBOeC pKGiqXplRv7m8zsf6H5M1HCLrGiySirZSBu+KqqDE2XjvRAYs/NHgIqM4g0iwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bGCt1VTR; dmarc=pass (policy=none) header.from=gmail.com; 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: -9.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bGCt1VTR; dmarc=pass (policy=none) header.from=gmail.com; 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: ACABECD15 X-Spam-Score: -9.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: MvLL4LY4nST9 On Wed, May 25, 2022 at 11:26 AM Max Nikulin wrote: > > 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. 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? > 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 >