emacs-orgmode
[Top][All Lists]
Advanced

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

Re: insert automatically a reference to a section header and a link


From: Stefan Nobis
Subject: Re: insert automatically a reference to a section header and a link
Date: Wed, 17 Nov 2021 20:10:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)

Uwe Brauer <oub@mat.ucm.es> writes:

> Yes, but, what do you do, if you have a 10 header and each has 20
> subheaders.

I avoid writing such complex documents for the moment. :)

[Some custom functions]
> Thanks but this did not work! 

Sorry. The code is meant as an inspiration, not to be used out-of-the
box. I never tested the functions outside my highly adjusted default
configuration.

As I read in another post you seem to be a helm user. Therefore it
might be a better idea to use helm helper functions. I assume, helm
has also some function to jump around in Org files, with headings as
targets. If you find such a function, try to copy and adapt (as I did
with the similar `counsel-outline' function): I assume such a function
will use some helper function to collect the candidates for completion
and after the user selected a candidate there is code to jump to the
selected destination. Just try to change this part so that instead of
jumping, a link is inserted at the proper place (that's the part my
function `sn/org-insert-internal-link-action' is responsible for).

Maybe someone with more knowledge about helm might help you with a
complete solution.

-- 
Until the next mail...,
Stefan.



reply via email to

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