emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Internal links to lines in different org files
@ 2023-01-28 12:35 kevin lucas
  2023-01-28 15:25 ` Max Nikulin
  2023-02-01 14:56 ` Ihor Radchenko
  0 siblings, 2 replies; 5+ messages in thread
From: kevin lucas @ 2023-01-28 12:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

A neat little feature that as far as I can tell is only available in Doom
Emacs is the ability to link to specific labeled lines from different org
files. So for instance when I use org-roam I can in an org file with ID foo
label a block of code with #+name: my_code and then from a different org
file write a link like [[foo::my_code][Some code]] and have it refer back
to the exact line in the first file.

I have several questions:

1. Is this feature indeed specific to Doom Emacs? Looking at the code that
gets called it seems there were modifications in Doom to org-id that allow
appending a name to an org ID using double colons in this way. I’ve asked
in a number of other forums and no one has been able to replicate this
outside Doom.
2. If this behavior isn’t in org mode, could it be added?
3. Connected to this: if I export an org file containing an ordinary link
to another node to PDF, the PDF compiles and I get a dead link in the file.
If one tries to export org files with these double colon links there's an
error message `Unable to resolve ID "foo::myname"`. Is there a way to
generate the PDF just like in the first case?

Thanks,
Kevin

[-- Attachment #2: Type: text/html, Size: 1458 bytes --]

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

* Re: Internal links to lines in different org files
  2023-01-28 12:35 Internal links to lines in different org files kevin lucas
@ 2023-01-28 15:25 ` Max Nikulin
  2023-02-01 14:56 ` Ihor Radchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Max Nikulin @ 2023-01-28 15:25 UTC (permalink / raw)
  To: kevin lucas, emacs-orgmode

On 28/01/2023 19:35, kevin lucas wrote:
> from a different org file write a link like [[foo::my_code][Some code]] 
> and have it refer back to the exact line in the first file.

Usually links in org start with "type:" prefix. I can not say it for 
sure, but your link looks like a fuzzy link (search in the same file).

I recommend you to run

     M-x org-link RET

for a report on possible issues with your file.

> 2. If this behavior isn’t in org mode, could it be added?

First of all, have a look into (info "(org) Search Options") 
https://orgmode.org/manual/Search-Options.html
Notice "file:" type of the links.

> 3. Connected to this: if I export an org file containing an ordinary 
> link to another node to PDF, the PDF compiles and I get a dead link in 
> the file. If one tries to export org files with these double colon links 
> there's an error message `Unable to resolve ID "foo::myname"`. Is there 
> a way to generate the PDF just like in the first case?

Export may be affected by some bugs. Try to open PDF file in a browser 
to inspect what is the target of the exported link.




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

* Re: Internal links to lines in different org files
  2023-01-28 12:35 Internal links to lines in different org files kevin lucas
  2023-01-28 15:25 ` Max Nikulin
@ 2023-02-01 14:56 ` Ihor Radchenko
  2023-02-01 15:04   ` kevin lucas
  1 sibling, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-02-01 14:56 UTC (permalink / raw)
  To: kevin lucas; +Cc: emacs-orgmode

kevin lucas <lucaskevin296@gmail.com> writes:

> 1. Is this feature indeed specific to Doom Emacs?
> 2. If this behavior isn’t in org mode, could it be added?

No. It is built-in.

> 3. Connected to this: if I export an org file containing an ordinary link
> to another node to PDF, the PDF compiles and I get a dead link in the file.
> If one tries to export org files with these double colon links there's an
> error message `Unable to resolve ID "foo::myname"`. Is there a way to
> generate the PDF just like in the first case?

See org-export-with-broken-links

-- 
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: Internal links to lines in different org files
  2023-02-01 14:56 ` Ihor Radchenko
@ 2023-02-01 15:04   ` kevin lucas
  2023-02-01 15:14     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: kevin lucas @ 2023-02-01 15:04 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

Thanks for responding. I meant specifically the :: syntax with org IDs, and
not filenames. I did confirm that this feature is currently only in Doom
Emacs, see:
https://github.com/doomemacs/doomemacs/blob/master/modules/lang/org/config.el#L639-L659
Regarding org-export-with-broken-links, is there a way to export the text
of the link, and not kill all the text?

On Wed 1. Feb 2023 at 15:55, Ihor Radchenko <yantar92@posteo.net> wrote:

> kevin lucas <lucaskevin296@gmail.com> writes:
>
> > 1. Is this feature indeed specific to Doom Emacs?
> > 2. If this behavior isn’t in org mode, could it be added?
>
> No. It is built-in.
>
> > 3. Connected to this: if I export an org file containing an ordinary link
> > to another node to PDF, the PDF compiles and I get a dead link in the
> file.
> > If one tries to export org files with these double colon links there's an
> > error message `Unable to resolve ID "foo::myname"`. Is there a way to
> > generate the PDF just like in the first case?
>
> See org-export-with-broken-links
>
> --
> 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>
>

[-- Attachment #2: Type: text/html, Size: 2166 bytes --]

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

* Re: Internal links to lines in different org files
  2023-02-01 15:04   ` kevin lucas
@ 2023-02-01 15:14     ` Ihor Radchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2023-02-01 15:14 UTC (permalink / raw)
  To: kevin lucas; +Cc: emacs-orgmode

kevin lucas <lucaskevin296@gmail.com> writes:

> Thanks for responding. I meant specifically the :: syntax with org IDs, and
> not filenames. I did confirm that this feature is currently only in Doom
> Emacs, see:
> https://github.com/doomemacs/doomemacs/blob/master/modules/lang/org/config.el#L639-L659

I am really curious why Doom author never considered contributing to Org
core. This style with numerous advices is a recipe for eventual
disaster.

> Regarding org-export-with-broken-links, is there a way to export the text
> of the link, and not kill all the text?

Currently, no.

I guess one may add a new possible value to
`org-export-with-broken-links', making it a custom function.

Alternatively, you may override the link transcoder in a custom derived
export backend (see `org-export-define-derived-backend').

-- 
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-02-03 13:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-28 12:35 Internal links to lines in different org files kevin lucas
2023-01-28 15:25 ` Max Nikulin
2023-02-01 14:56 ` Ihor Radchenko
2023-02-01 15:04   ` kevin lucas
2023-02-01 15:14     ` 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).