emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] org.el: Fix percent substitutions in `org-open-file'


From: Max Nikulin
Subject: Re: [PATCH v2] org.el: Fix percent substitutions in `org-open-file'
Date: Sun, 4 Sep 2022 19:16:47 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 03/09/2022 15:26, Ihor Radchenko wrote:
Max Nikulin writes:
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 mean another problem. A user adds (require 'some-package) that defines new link type. Later the user invokes easy customization interface to adjust a link unrelated to some-package. At this step links from some-package are added to user's init file. Ideally it should not happen and after removing of (require 'some-package) there should be no link types from the package in the init file at all, including customization section.

From my point of view entries added to `org-link-parameters', `org-file-apps', etc. by packages should not affect entries managed through customization.

       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.

I have removed most parts of the example. In addition I fixed some issues with references in the docstring (man mailcap is not recognized as a link for some reason yet). I changed the function to consider trailing backslash as a format error.

See the following message for my new idea concerning providing configuration for PDF viewers. Single elisp function should be more robust than 6 shell commands and it is better to add code than instructions.

Max Nikulin. Re: Org mode links: Open a PDF file at a given page and highlight a given string. Sat, 3 Sep 2022 20:00:47 +0700. https://list.orgmode.org/tevj61$17d8$1@ciao.gmane.io

Attachment: v2-0001-org.el-Fix-percent-substitutions-in-org-open-file.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]