* BUG?: Link to inline-task not working
@ 2021-12-03 8:30 Michael Dauer
2021-12-03 10:51 ` Ihor Radchenko
0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-12-03 8:30 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
Is there a setting that excludes inline-tasks from internal links?
I actually want to link to inline-tasks. BUT:
emacs -Q
>>>
* h1
[[*t1][t1]]
* h2
*************** TODO t1
*************** END
(require 'org-inlinetask)
<<<
Before (require 'org-inlinetask) all is fine. But after executing (require
'org-inlinetask) the following happens:
1. With point on/in t1 (org-store-link) stores *h2.
2. The manually created link below h1 works in the buffer. But it is
exported as BROKEN LINK.
Org mode version 9.4.4 (release_9.4.4 @
c:/msys64/mingw64/share/emacs/27.2/lisp/org/)
Any ideas how to get fully working links to inline-tasks?
thx
[-- Attachment #2: Type: text/html, Size: 854 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG?: Link to inline-task not working
2021-12-03 8:30 BUG?: Link to inline-task not working Michael Dauer
@ 2021-12-03 10:51 ` Ihor Radchenko
2021-12-03 14:20 ` Michael Dauer
0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-03 10:51 UTC (permalink / raw)
To: Michael Dauer; +Cc: emacs-orgmode
Michael Dauer <mick.dauer@gmail.com> writes:
> Before (require 'org-inlinetask) all is fine. But after executing (require
> 'org-inlinetask) the following happens:
> 1. With point on/in t1 (org-store-link) stores *h2.
> 2. The manually created link below h1 works in the buffer. But it is
> exported as BROKEN LINK.
Confirmed.
> Any ideas how to get fully working links to inline-tasks?
I have the following in my config to mitigate this problem:
(defun org-inlinetask-store-link (oldfun &rest args)
"Store link to inlinetask at point."
(if (and (derived-mode-p 'org-mode)
(org-inlinetask-in-task-p))
(let ((org-inlinetask-min-level 1000))
(apply oldfun args))
(apply oldfun args)))
(advice-add 'org-store-link :around #'org-inlinetask-store-link)
Best,
Ihor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG?: Link to inline-task not working
2021-12-03 10:51 ` Ihor Radchenko
@ 2021-12-03 14:20 ` Michael Dauer
2021-12-04 3:19 ` Ihor Radchenko
0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-12-03 14:20 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]
Ihor, thank you for the quick workaround.
Unfortunately storing links is not much of an issue for me. The real issue
is how I can get the internal links working in the exported html.
I could not find the right places to deactivate and
re-activate inline-tasks during export.
I have a custom org-html-format-inlinetask-function. If I
deactivate inline-tasks outside this formatter is never called, otherwise
the links are not generated.
Where are the links/href are built? There should be the error that excludes
inline-tasks.
thx,
m
Am Fr., 3. Dez. 2021 um 11:50 Uhr schrieb Ihor Radchenko <yantar92@gmail.com
>:
> Michael Dauer <mick.dauer@gmail.com> writes:
>
> > Before (require 'org-inlinetask) all is fine. But after executing
> (require
> > 'org-inlinetask) the following happens:
> > 1. With point on/in t1 (org-store-link) stores *h2.
> > 2. The manually created link below h1 works in the buffer. But it is
> > exported as BROKEN LINK.
>
> Confirmed.
>
> > Any ideas how to get fully working links to inline-tasks?
>
> I have the following in my config to mitigate this problem:
>
> (defun org-inlinetask-store-link (oldfun &rest args)
> "Store link to inlinetask at point."
> (if (and (derived-mode-p 'org-mode)
> (org-inlinetask-in-task-p))
> (let ((org-inlinetask-min-level 1000))
> (apply oldfun args))
> (apply oldfun args)))
>
> (advice-add 'org-store-link :around #'org-inlinetask-store-link)
>
> Best,
> Ihor
>
[-- Attachment #2: Type: text/html, Size: 2094 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG?: Link to inline-task not working
2021-12-03 14:20 ` Michael Dauer
@ 2021-12-04 3:19 ` Ihor Radchenko
2021-12-06 13:14 ` Michael Dauer
0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-04 3:19 UTC (permalink / raw)
To: Michael Dauer; +Cc: emacs-orgmode
Michael Dauer <mick.dauer@gmail.com> writes:
> Where are the links/href are built? There should be the error that excludes
> inline-tasks.
A quick search through the code yields: org-export-resolve-id-link
It explicitly check headlines, but not inlinetasks.
The fix should not be too hard. Feel free to send a patch ;)
Best,
Ihor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG?: Link to inline-task not working
2021-12-04 3:19 ` Ihor Radchenko
@ 2021-12-06 13:14 ` Michael Dauer
2021-12-06 13:47 ` Ihor Radchenko
0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-12-06 13:14 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
>
> > Where are the links/href are built? There should be the error that
> excludes
> > inline-tasks.
>
> A quick search through the code yields: org-export-resolve-id-link
> It explicitly check headlines, but not inlinetasks.
>
Shouldn't be org-export-resolve-fuzzy-link the relevant function, at least
for my use case?
But there it looks like it is searching through all elements including
inlinetasks, which is in org-element-all-elements:
(append pseudo-types '(target) org-element-all-elements)
Am Sa., 4. Dez. 2021 um 04:18 Uhr schrieb Ihor Radchenko <yantar92@gmail.com
>:
> Michael Dauer <mick.dauer@gmail.com> writes:
>
> > Where are the links/href are built? There should be the error that
> excludes
> > inline-tasks.
>
> A quick search through the code yields: org-export-resolve-id-link
> It explicitly check headlines, but not inlinetasks.
> The fix should not be too hard. Feel free to send a patch ;)
>
> Best,
> Ihor
>
[-- Attachment #2: Type: text/html, Size: 1593 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG?: Link to inline-task not working
2021-12-06 13:14 ` Michael Dauer
@ 2021-12-06 13:47 ` Ihor Radchenko
0 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2021-12-06 13:47 UTC (permalink / raw)
To: Michael Dauer; +Cc: emacs-orgmode
Michael Dauer <mick.dauer@gmail.com> writes:
> Shouldn't be org-export-resolve-fuzzy-link the relevant function, at least
> for my use case?
>
> But there it looks like it is searching through all elements including
> inlinetasks, which is in org-element-all-elements:
> (append pseudo-types '(target) org-element-all-elements)
Maybe. Further it also calls org-export-search-cells, which does not
consider inlinetasks even if they are matched.
Best,
Ihor
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-12-06 14:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 8:30 BUG?: Link to inline-task not working Michael Dauer
2021-12-03 10:51 ` Ihor Radchenko
2021-12-03 14:20 ` Michael Dauer
2021-12-04 3:19 ` Ihor Radchenko
2021-12-06 13:14 ` Michael Dauer
2021-12-06 13:47 ` Ihor Radchenko
Code repositories for project(s) associated with this 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).