emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] coderef does not provide file path for org-insert-link when not


From: Nicolas Goaziou
Subject: Re: [O] coderef does not provide file path for org-insert-link when not in original buffre
Date: Fri, 26 Oct 2018 18:08:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

stardiviner <address@hidden> writes:

> Thanks for this hint, I added a new entry in org-src--babel-info list to
> pass the original parent file path.

Thank you. Some comments follow.

> -  (language body arguments switches name start coderef)"
> +  (language body arguments switches name start coderef  parent-file-path)"

This is not needed. It would be better to create a new variable, e.g.
`org-src-source-file', get the file name at the beginning of the
function `org-src--edit-element', and set it from its INITIALIZE
argument.

> +                (insert (format coderef-format label))
> +                (setq link (format "file:%s::%s"
> +                                   (car (last org-src--babel-info))
> +                                   (concat "(" label ")")))

You can get the file name by reading `org-src-source-file' value.

Does that make sense?

Could you also provide some tests?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]