emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Ihor Radchenko
Subject: Re: [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: Wed, 17 Jan 2024 13:17:56 +0000

"Christopher M. Miles" <numbchild@gmail.com> writes:

> I have one situation need this feature.
> 
> Assume a file structure like bellowing:
>
> #+begin_example
> `- folder-1
>   `- file-1.org
>   `- folder-1.2
>     ` file-1.2.1.org
> #+end_example
>
> When I try to add link of "file-1.org" in "file-1.2.1.org", based on my
> custom option `org-link-file-path-type' value `adaptive'. The link will
> become a full-path link. But I want link to be relative to current Org
> file path. The file link path should be [[file:../file-1.org]] instead
> of [[file:folder-1/file-1.org]]. I hope I can use a custom function in
> conditions to decide the file path.

I think that you do not need to wait for this feature in order to get
what you need. Just examine default-directory in your custom function to
determine whether to return relative or absolute path.

-- 
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]