emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to get the link the point is on?


From: Jorge A. Alfaro-Murillo
Subject: Re: [O] How to get the link the point is on?
Date: Thu, 25 Sep 2014 17:49:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Marcin Borkowski writes:
Hi list, my question is as in subject. It is done by org-open-at-point (somehow), but the logic seems to be buried in that function. What I'd like to have is a function that would just extract the link portion (which is normally invisible) and displayed it in the echo area (something like hovering over a link in a web browser).

This returns the link at the line, it assumes one link per line:

#+BEGIN_SRC emacs-lisp
 (defun test ()
   (save-excursion
     (move-beginning-of-line 1)
(if (search-forward-regexp org-any-link-re (line-end-position) t)
         (let* ((complete-link (match-string 0))
                (last-place (string-match "\\]" complete-link)))
(substring-no-properties complete-link 2 last-place))))

#+END_SRC

Best,

--
Jorge.




reply via email to

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