emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Question about relative paths generated by Org
@ 2024-08-08 12:18 Wiktor Kwapisiewicz
  2024-08-10 17:03 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Wiktor Kwapisiewicz @ 2024-08-08 12:18 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm using Org-mode's clock feature and it's really great!

One thing bothers me: the links generated by the ":link t" option on the 
clocktable [0] are absolute [1] and it causes problems when using the 
same file on two different machines:

#+BEGIN: clocktable :scope file :maxlevel 3 :link t
#+CAPTION: Clock summary at [2024-08-08 Thu 11:02]
| Headline     | Time   |      |
|--------------+--------+------|
| *Total time* | *4:32* |      |
|--------------+--------+------|
| 
[[file:/home/runner/work/org-test/org-test/README.org::Project][Project]] 
      | 4:32   |      |
| \_  [[file:/home/runner/work/org-test/org-test/README.org::Task 
1][Task 1]]   |        | 3:30 |
| \_  [[file:/home/runner/work/org-test/org-test/README.org::Task 
3][Task 3]]   |        | 1:02 |
#+END:

I've tried adjusting that with `(setq org-link-file-path-type 
'relative)` but it doesn't seem to have any effect on the automatically 
generated clocktable (I ran emacs -nw README.org so the PWD should be 
correct).

Is there anything I could try to make the links relative so that they 
look like this: [[file:README.org::Task 3][Task 3]] ?

I've made a repository for reproducing this case: 
https://github.com/wiktor-k/org-test and I'm using emacs 29.4 and org 
9.6.15.

Thank you for your time and help!

Kind regards,
Wiktor

[0]: https://github.com/wiktor-k/org-test/blob/main/README.org?plain=1#L39

[1]: https://github.com/wiktor-k/org-test/blob/main/README.org?plain=1#L46


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about relative paths generated by Org
  2024-08-08 12:18 Question about relative paths generated by Org Wiktor Kwapisiewicz
@ 2024-08-10 17:03 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-08-10 17:03 UTC (permalink / raw)
  To: Wiktor Kwapisiewicz; +Cc: emacs-orgmode

Wiktor Kwapisiewicz <wiktor@metacode.biz> writes:

> One thing bothers me: the links generated by the ":link t" option on the 
> clocktable [0] are absolute [1] and it causes problems when using the 
> same file on two different machines:
> ...
> I've tried adjusting that with `(setq org-link-file-path-type 
> 'relative)` but it doesn't seem to have any effect on the automatically 
> generated clocktable (I ran emacs -nw README.org so the PWD should be 
> correct).
>
> Is there anything I could try to make the links relative so that they 
> look like this: [[file:README.org::Task 3][Task 3]] ?

Absolute file path is currently hard-coded in
`org-clock-get-table-data'. I agree that it would make sense to respect
`org-link-file-path-type'.

Someone has to factor out link path format from `org-insert-link' and
re-use it.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-10 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 12:18 Question about relative paths generated by Org Wiktor Kwapisiewicz
2024-08-10 17:03 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).