[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Adding text properties to all Org mode links
From: |
Suvayu Ali |
Subject: |
Re: [O] Adding text properties to all Org mode links |
Date: |
Sun, 14 Jul 2013 08:41:25 +0200 |
User-agent: |
Mutt/1.5.21 (2012-12-30) |
Hi Nick,
On Sat, Jul 13, 2013 at 11:01:08PM -0400, Nick Dokos wrote:
> Suvayu Ali <address@hidden> writes:
>
> > Hi,
> >
> > How do I add text properties to org elements? In my particular case, I
> > want to echo tooltips when I move my cursor over an org link (or other
> > org elements for that matter). To do this, I need to add the properties
> > point-left and point-entered to all org-links. How do I do that?
> >
> > Thanks for any ideas.
>
> Not sure if this is the best method:
>
> o go to (point-min)
> o loop
> (goto-char (cdr (org-element-link-successor (point-max))))
> (org-element-link-parser) and extract :begin and :end values from
> the returned list
>
> Untested (mostly) - termination, error handling (and who knows what
> else) left to the interested reader...
I was afraid of this. I think the safest way of not screwing up the
parsing and error handling would be to implement it as a patch to
org-activate-*-links in org.el.
I guess I should give some background info. Lately (>1yr), I have been
using Emacs exclusively from the terminal. In a gui, hovering the mouse
over a link shows you the target as a tooltip. If you turn tooltip mode
off, it is shown in the echo area; but this is only in a gui frame.
I think it is very important to show where a link goes in a document. I
consider it good a safety practise (e.g. web browsers). Hence my
attempt to implement this feature. :)
Cheers,
--
Suvayu
Open source is the future. It sets us free.