emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Show full outline path when insert link
@ 2020-03-24 13:43 Tung Clive
  2020-03-24 16:25 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Tung Clive @ 2020-03-24 13:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

When I am trying to store a link to an outline like this:
“
* Headline 1
** Headline 2
	Point here.
“
How can I automatically make it’s description to be “Headline 1/Headline 2” instead of just “Headline 2”?

Best,
Clive

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

* Re: Show full outline path when insert link
  2020-03-24 13:43 Show full outline path when insert link Tung Clive
@ 2020-03-24 16:25 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2020-03-24 16:25 UTC (permalink / raw)
  To: Tung Clive, emacs-orgmode

Something like

(defun org-id-link-desk (link desk)
  "Description function for id: link."
  (let ((id (cadr (split-string link ":"))))
    (org-with-point-at (org-id-find id 'marker)
      (s-join "/" (org-get-outline-path 'with-self)))))

(org-link-set-parameters "id"
                         :desk #'org-id-link-desk)

Best,
Ihor


Tung Clive <clivetung@gmail.com> writes:

> Hi all,
>
> When I am trying to store a link to an outline like this:
> “
> * Headline 1
> ** Headline 2
> 	Point here.
> “
> How can I automatically make it’s description to be “Headline 1/Headline 2” instead of just “Headline 2”?
>
> Best,
> Clive

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg

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

end of thread, other threads:[~2020-03-24 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 13:43 Show full outline path when insert link Tung Clive
2020-03-24 16:25 ` 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).