From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Subject: Re: How to get the link the point is on? Date: Thu, 25 Sep 2014 17:49:37 -0400 Message-ID: <87lhp7gyku.fsf@yale.edu> References: <8761gb8lq2.fsf@wmi.amu.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXGwE-0003vm-KQ for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 17:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXGw3-0004Ol-VA for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 17:50:58 -0400 Received: from plane.gmane.org ([80.91.229.3]:33043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXGw3-0004NJ-OZ for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 17:50:47 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XXGvw-0004cc-VK for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 23:50:40 +0200 Received: from nat-130-132-173-32.central.yale.edu ([130.132.173.32]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Sep 2014 23:50:40 +0200 Received: from jorge.alfaro-murillo by nat-130-132-173-32.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Sep 2014 23:50:40 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.