hyperbole-users
[Top][All Lists]
Advanced

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

Re: [Hyperbole-users] kill-ring-org-link-to-lisp


From: Robert Weiner
Subject: Re: [Hyperbole-users] kill-ring-org-link-to-lisp
Date: Tue, 27 Aug 2019 18:48:38 -0400

So is the Org heading not unique?  Because Hyperbole already handles Org links 
that refer to Org headings.  The test version of Hyperbole you are using can 
follow any Org link in an Org buffer, so you could just insert any link you 
want and then activate with the Action Key, you don’t need to wrap it in elisp.

-- Bob

> On Aug 27, 2019, at 12:56 PM, Jean Louis <bugs@gnu.support> wrote:
> 
> I use:  Editor:      GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, X 
> toolkit, Xaw3d scroll bars)
> 
>        Hyperbole:   7.0.3
>        Sys Type:    x86_64-pc-linux-gnu
>        OS Type:     gnu/linux
>        Window Sys:  x
> 
> Let me share the new function, that becomes very handy to quickly
> provide the backlink for Hyperbola or other hyperlinking purposes.
> 
> I am using Org in such way that ID property is generated automatically
> on each file saving, like this:
> 
> ** Diagram of the Organizing Board
>   :PROPERTIES:
>   :ID:       174c7647-22ad-4096-9f66-fe24b6878bda
>   :CREATED:  [2018-10-06 Sat 09:56]
>   :END:
> 
> So each heading has its unique ID (mostly unique, if I don't copy and
> not verify what I did...).
> 
> Then this function is fecthing the link to the Org heading as Emacs
> Lisp function.
> 
> (defun kill-ring-org-link-to-lisp ()
>  "Places the Org link by using heading and ID property into the kill-ring"
>  (interactive)
>  (when (eq major-mode 'org-mode)
>    (let* ((heading (org-get-heading))
>       (id (org-id-get))
>       (lisp (format "(org-open-link-from-string \"[[id:%s][%s]]\")" id 
> heading)))
>      (kill-new lisp))))
> 
> It would give following result:
> 
> (org-open-link-from-string 
> "[[id:174c7647-22ad-4096-9f66-fe24b6878bda][Diagram of the Organizing 
> Board]]")
> 
> Now this function can be used within the Hyperbole `eval-lisp'
> explicit button to quickly jump to the Org heading.
> 
> Jean
> 



reply via email to

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