emacs-orgmode
[Top][All Lists]
Advanced

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

[POLL] Change calling convention for when `org-link-file-path-type' is s


From: Ihor Radchenko
Subject: [POLL] Change calling convention for when `org-link-file-path-type' is set to custom function (was: Enhancement Proposal for 'org-link-file-path-type' Behavior)
Date: Tue, 16 Jan 2024 16:06:08 +0000

西 顾 <z.ref@outlook.com> writes:

> I'd like to suggest a small enhancement to the
> 'org-link-file-path-type' option. When set to 'function', it currently
> passes an absolute path to the user's custom function. This limits
> flexibility as the original path input is not available to the
> function.
>
> For better customization, I propose passing the raw path to the
> function. Users needing an absolute path could use 'expand-file-name'
> within their function.

Thanks for the suggestion!

This makes sense - the current approach with passing absolute path is
indeed limiting the information passed to the custom function.

The docstring is also quite ambiguous about what is passed as an
argument:

    org-link-file-path-type is a customizable variable defined in ol.el.
    <...>
    Alternatively, users may supply a custom function that takes the
    full filename as an argument and returns the path.

"full filename" may or may not mean "absolute filename".

However, changing the absolute path to "as is" path will technically be
breaking.

I cannot find any actual uses of custom function value for
`org-link-file-path-type' in the wild, so I am leaning towards going
ahead with this (minor) breaking change.

Yet, I am starting a poll to give users who may be affected a chance to
chime in.

-- 
Ihor Radchenko // yantar92,
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>



reply via email to

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