emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FR] Add an option to use ID links during tangling
@ 2023-07-27 14:20 Evgenii Klimov
  2023-07-28  7:46 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Evgenii Klimov @ 2023-07-27 14:20 UTC (permalink / raw)
  To: Org-mode

Hi, I noticed that links created during tangling back to the original
Org file doesn't respect custom =org-id-link-to-org-use-id= option in
~org-babel-tangle--unbracketed-link~.

I see in the comment there the reason for that, but still would prefer
to use unique IDs in tangled files: the probability to overwrite wrong
source block under nonunique header overweights a side-effect of
creating new ID in Org file during tangling.

Can we do something with this?  Add another option or provide an even
eager value in =org-id-link-to-org-use-id=.


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

* Re: [FR] Add an option to use ID links during tangling
  2023-07-27 14:20 [FR] Add an option to use ID links during tangling Evgenii Klimov
@ 2023-07-28  7:46 ` Ihor Radchenko
  2023-07-28 10:13   ` Evgenii Klimov
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-07-28  7:46 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: Org-mode

Evgenii Klimov <eugene.dev@lipklim.org> writes:

> I see in the comment there the reason for that, but still would prefer
> to use unique IDs in tangled files: the probability to overwrite wrong
> source block under nonunique header overweights a side-effect of
> creating new ID in Org file during tangling.

Did you actually encounter such situation?
`org-babel-detangle' is far from ideal in general.
For example, detangling noweb references is pretty much guaranteed to
create mess.

> Can we do something with this?  Add another option or provide an even
> eager value in =org-id-link-to-org-use-id=.

I do not like the idea of creating side effects in the original Org
document during tangling.
We can, however, use (org-id-link-to-org-use-id 'use-existing) to use
the already present IDs.

Ideally, we should improve the detangling to understand the order of
blocks better instead of searching the containing heading independently.

-- 
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] 5+ messages in thread

* Re: [FR] Add an option to use ID links during tangling
  2023-07-28  7:46 ` Ihor Radchenko
@ 2023-07-28 10:13   ` Evgenii Klimov
  2023-07-28 10:35     ` Ihor Radchenko
  2023-08-08 12:58     ` Ihor Radchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Evgenii Klimov @ 2023-07-28 10:13 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode


Ihor Radchenko <yantar92@posteo.net> writes:

> Evgenii Klimov <eugene.dev@lipklim.org> writes:
>
>> I see in the comment there the reason for that, but still would prefer
>> to use unique IDs in tangled files: the probability to overwrite wrong
>> source block under nonunique header overweights a side-effect of
>> creating new ID in Org file during tangling.
>
> Did you actually encounter such situation?
> `org-babel-detangle' is far from ideal in general.
> For example, detangling noweb references is pretty much guaranteed to
> create mess.

Yes, I did.  I keep my whole emacs configuration in an Org file and
tangle it after adjustments at Emacs startup (~org-babel-load-file~).
Recently I decided to split the tangled file and learned about
detangling.

And I have a lot of similar headers since my Org file looks like this:

#+begin_example
* package 1
** basic
** custom functions
** custom bindings
* package 2
** basic
** custom functions
** custom bindings
#+end_example

>> Can we do something with this?  Add another option or provide an even
>> eager value in =org-id-link-to-org-use-id=.
>
> I do not like the idea of creating side effects in the original Org
> document during tangling.
> We can, however, use (org-id-link-to-org-use-id 'use-existing) to use
> the already present IDs.

Understandable, with (org-id-link-to-org-use-id 'use-existing) I would
at least be able to manually add them where needed.

> Ideally, we should improve the detangling to understand the order of
> blocks better instead of searching the containing heading independently.

Maybe recent feature suggestion [1] will be of use here.

[1] https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com


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

* Re: [FR] Add an option to use ID links during tangling
  2023-07-28 10:13   ` Evgenii Klimov
@ 2023-07-28 10:35     ` Ihor Radchenko
  2023-08-08 12:58     ` Ihor Radchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2023-07-28 10:35 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: Org-mode

Evgenii Klimov <eugene.dev@lipklim.org> writes:

>> Ideally, we should improve the detangling to understand the order of
>> blocks better instead of searching the containing heading independently.
>
> Maybe recent feature suggestion [1] will be of use here.
>
> [1] https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com

Detangling should work even when IDs are not used at all.
Using IDs will always be just a partial fix and leave edge cases.

The right thing to do would be something like
http://leoeditor.com/appendices.html#the-mulder-ream-update-algorithm
But we need someone™.

-- 
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] 5+ messages in thread

* Re: [FR] Add an option to use ID links during tangling
  2023-07-28 10:13   ` Evgenii Klimov
  2023-07-28 10:35     ` Ihor Radchenko
@ 2023-08-08 12:58     ` Ihor Radchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2023-08-08 12:58 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: Org-mode

Evgenii Klimov <eugene.dev@lipklim.org> writes:

>> I do not like the idea of creating side effects in the original Org
>> document during tangling.
>> We can, however, use (org-id-link-to-org-use-id 'use-existing) to use
>> the already present IDs.
>
> Understandable, with (org-id-link-to-org-use-id 'use-existing) I would
> at least be able to manually add them where needed.

Considering that users have an option to set org-id-link-to-org-use-id to
'create-if-interactive, I decided to remove the original change that
force-sets it to nil.

Handled.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a18ebc789

-- 
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] 5+ messages in thread

end of thread, other threads:[~2023-08-08 12:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 14:20 [FR] Add an option to use ID links during tangling Evgenii Klimov
2023-07-28  7:46 ` Ihor Radchenko
2023-07-28 10:13   ` Evgenii Klimov
2023-07-28 10:35     ` Ihor Radchenko
2023-08-08 12:58     ` 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).