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 IEACB9YPE2PibgEAbAwnHQ (envelope-from ) for ; Sat, 03 Sep 2022 10:27:02 +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 EBIYB9YPE2OSiwAA9RJhRA (envelope-from ) for ; Sat, 03 Sep 2022 10:27:02 +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 B0004272D0 for ; Sat, 3 Sep 2022 10:27:01 +0200 (CEST) Received: from localhost ([::1]:49396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUOUW-0002be-3I for larch@yhetil.org; Sat, 03 Sep 2022 04:27:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUOTK-0002aP-Kd for emacs-orgmode@gnu.org; Sat, 03 Sep 2022 04:25:47 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:54263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUOTI-0002UV-Q1 for emacs-orgmode@gnu.org; Sat, 03 Sep 2022 04:25:46 -0400 Received: by mail-pj1-x102d.google.com with SMTP id q3so3994863pjg.3 for ; Sat, 03 Sep 2022 01:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=JgIU/FVkB6j7Kw9+MVbJvVb2qTS7BjqwqAWH+hihntA=; b=iK9N3fjIa96bR7dB/0NdLCcMo2Ap+LA6yIFvb7bk+HktNNstUVPRecD6Vl3NbQiBSH uSCKZk3xnvqVfiyF8ZfZckih4F3hplxYVDBmMVchw5UH4MPBgK+nEZrTAiH1W+HEkT8D cE+Hznz+CnO1mlA3fx/dcW49T+WP2UsvRTy560uqxvPZfLWistgwQ2DyYfzuVT6gOyKh 4VcORc4ObqI2sfF2+JrtpSqgaQbAs+7xx2cerm4ufnyf03rP9AIFH49iL3k+W25Yoxtm ++wG0657ao8byZKtCH8GohZzOrhQt8XBV9AxrB/gEDLLDG/l1lNO/zvCHkUl4Ry+X04j R1rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=JgIU/FVkB6j7Kw9+MVbJvVb2qTS7BjqwqAWH+hihntA=; b=pKW858yIQg85qUMAUeJwdvull0UyF3VVvktiwSr5GUc8PB+uw+LK5PQL5GsQDPEzbV gCZOXKTlf7t55L69SRMsAi7MEwu3kKk3jyofPZQ5onWzuDqRBX6+2sp1kT/JcDvDam/W 2MskL6LKb8t6+EA0RexF7TsasUvA7Ig6GWIXILBGU17D//FfFiuhqF90gTcUvm4dhjzD S9vg1xlqGqcNbxJwTtQVqARczZomQ5SZd2VRmxjx6pn3QeOd8QnKlj9INOuzzmzP7SKs TsgND1vvcpb8AV8r9hhkXbUhXBPaUM6R/I9IMMLL4LtX43STocZ+thICzfYPn2+g8U4A yfiA== X-Gm-Message-State: ACgBeo1dXPBZ4vUvi6REMl8EM8yQORm5lkKXQO5g1XeK6HQPgjro1ObJ GgV5ku3qItC8nGZ1Cq7YkxI= X-Google-Smtp-Source: AA6agR4QWcNVadddZeaO/0gnkVyRUov7uCttPGgD/Pb18u2mnWhyDaPimHrbXHr8VSugb2dEQWJcYA== X-Received: by 2002:a17:902:d34d:b0:174:429d:7789 with SMTP id l13-20020a170902d34d00b00174429d7789mr36532031plk.144.1662193538856; Sat, 03 Sep 2022 01:25:38 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id q29-20020aa7961d000000b0053617cbe2d2sm3234782pfg.168.2022.09.03.01.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Sep 2022 01:25:38 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] org.el: Fix percent substitutions in `org-open-file' In-Reply-To: References: <874kih92nb.fsf@kyleam.com> <87mtw8fupl.fsf@kyleam.com> <87tu5qm11q.fsf@localhost> Date: Sat, 03 Sep 2022 16:26:37 +0800 Message-ID: <87o7vw983m.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, 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=1662193621; 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=JgIU/FVkB6j7Kw9+MVbJvVb2qTS7BjqwqAWH+hihntA=; b=XfPdRuMBETeuqhXURYhqVRyIX5+n87yGEVrA3I+isTh4VQLMfk9lh9Cs2bTj4V4CFY2Me8 jQOxdDeDWrc/L+rEHQFpx6GuuKmxoxaTxfXNQh+ZZrpto8yf7WCB9uBS5EOO2Rm31QkEMH qJ7wNyQo6sGTTrwKJXjaDFQe2cTmP7RvtC5vOsNKlIXCPN3sIxhoEcgc0gP1r1VPE6Z8E4 1pDEKWG/hYZ9V/tBE3cKgRjdZ+7bLA8kqypy3v4tNFYYODDh1IRAirsspM8FMcW0aPkfvy b8g8kCOBNVzhPa+a/EKwRTl6+pYI9S5RFPbrn1ZvUN+87GGbgGiPbTrkLEiiVQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662193621; a=rsa-sha256; cv=none; b=YXyll9ButNNMEpphxOojlaksLjtWIbns5GgeAcEZJNZGk0/hwpOugXU4CcjITI45UFS4mO a3cvKU/z8wY9+POl0FKJ9KynaoCBUgRYrZCGNRZolHP4pUOE6HQARfYrsCRtgRwBkqSgZz SenAfJbyIPpICEO6Wlbg8g7Utd3zVJQ5regUHz1whiTr/EMhVg6Oyq1qb2+fVAXkIwXeNj /i70Pp4AmHSy64rDHMXAZ5rTZFzGBT69mkmOdP7hu+p3JaeXw9URM56jZ4fwvVCsQgFhGP iM+POVROjXeTv3+eJvMOGzMpDNEcDT2gH18NFub14g4i6n6I5xLHMGvML3afRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iK9N3fjI; 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: -3.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iK9N3fjI; 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: B0004272D0 X-Spam-Score: -3.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: VQemGNO2y6xt Max Nikulin writes: >>> + (\"\\\\.pdf::\\\\(.+\\\\)\\\\\\='\" . \"okular file://%s\\\\\\\\#%1\") >>> + ;; No location within the file, optionally followed by \"::\", >>> + ;; e.g. . >>> + (\"\\\\.pdf\\\\(?:::\\\\)?\\\\\\='\" . \"okular %s\") >> >> This is a nice set of examples, but it probably does not belong to this >> docstring. I'd rather see this in `org-file-apps' docstring or even in >> the manual. > > I thought on this and I do not think it should be added to the manual. > Instead a set of hooks should be defined for popular PDF viewers: > evince, zathura, xpdf, firefox, chromium & Co, etc. Such hook injects a > number of supported `org-file-apps' records and users may add suitable > hook to e.g. (with-eval-after-load 'org (push ...)). It may be > implemented as a dedicated package org-pdf-viewers.el. The only problems > is that adding entries programmatically breaks easy customization > interface for `org-file-apps'. Currently there is the same issue with > `org-link-parameters' that is a defcustom variables with entries added > by various org extensions. We may alter the :type specifier in `org-file-apps' to something like :type `(repeat (choice ,org-file-apps-presets ...)) `org-file-apps-presets' will then contain :type specs for some common file types and the apps. The variable can be easily populated by third-party packages as well. > I added the example with hope to better explain the purpose of this > function. I do not think that it is needed in the `org--open-file-format-command' docstring. If you wish, it would be better to add examples of the arguments and return values of `org--open-file-format-command' instead of showing `org-file-apps' examples. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92