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

2014-09-27 Thread Sebastien Vauban
Marcin Borkowski wrote:
 On 2014-09-25, at 23:50, Thorsten Jolitz wrote:
 Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 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).

 I skimmed through org.el, and either I couldn't find a function which
 does it, or this email is a feature request;).

 you know about 

 ,[ C-h f org-toggle-link-display RET ]
 | org-toggle-link-display is an interactive compiled Lisp function in
 | `org.el'.
 | 
 | It is bound to menu-bar Org Hyperlinks Descriptive Links,
 | menu-bar Org Hyperlinks Literal Links.
 | 
 | (org-toggle-link-display)
 | 
 | Toggle the literal or descriptive display of links.
 `

 Yes, I do, but this is not what I'm looking for.  I want to see the
 `descriptive' links, only to be able (sometimes) to look up the actual
 target of the link.  (And I don't like the idea of moving the point to
 the end, pressing backspace to delete the rightmost bracket, and then
 pressing C-\ to undo it...)

When I want to see *all* the contents in my Org file (that is LOGBOOK
entries, URL in links, etc.), I use M-x visible-mode.

Best regards,
  Seb

-- 
Sebastien Vauban




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

2014-09-26 Thread Subhan Michael Tindall

[SNIP]
 -Original Message-
 From: emacs-orgmode-bounces+subhant=familycareinc@gnu.org
 [mailto:emacs-orgmode-bounces+subhant=familycareinc@gnu.org] On
 Behalf Of Marcin Borkowski
 Sent: Thursday, September 25, 2014 3:45 PM
 To: emacs-orgmode@gnu.org
 Subject: Re: [O] How to get the link the point is on?
[SNIP]
  you know about
 
  ,[ C-h f org-toggle-link-display RET ]
  | org-toggle-link-display is an interactive compiled Lisp function in
  | `org.el'.
  |
  | It is bound to menu-bar Org Hyperlinks Descriptive Links,
  | menu-bar Org Hyperlinks Literal Links.
  |
  | (org-toggle-link-display)
  |
  | Toggle the literal or descriptive display of links.
  `
 
  ?
 
 Yes, I do, but this is not what I'm looking for.  I want to see the 
 `descriptive'
 links, only to be able (sometimes) to look up the actual target of the link.
 (And I don't like the idea of moving the point to the end, pressing
 backspace to delete the rightmost bracket, and then pressing C-\ to undo
 it...)
[] 

I accomplish this by using C-c C-l  RET RET (which is bound to org-insert-link 
and resides in org.el)
Technically it pops up the long link and description for editing in the message 
buffer, but they default to current values so effectively provide an easy 
display.  Works from anywhere in the highlighted link.
If nothing else it should point you at some modifiable code you can use for 
display.

Subhan


 
 Best,
 
 --
 Marcin Borkowski
 http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
 Adam Mickiewicz University


This message is intended for the sole use of the individual and entity to which 
it is addressed and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If you are not the intended 
addressee, nor authorized to receive for the intended addressee, you are hereby 
notified that you may not use, copy, disclose or distribute to anyone the 
message or any information contained in the message. If you have received this 
message in error, please immediately advise the sender by reply email and 
delete the message.  Thank you.




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

2014-09-25 Thread Rasmus
Marcin Borkowski mb...@wmi.amu.edu.pl 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).

 I skimmed through org.el, and either I couldn't find a function which
 does it, or this email is a feature request;).

If point is on a link you can

   (org-element-property :raw-link (org-element-context))

Hope it helps,
Rasmus

-- 
May the Force be with you




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

2014-09-25 Thread Kyle Meyer
Marcin Borkowski mb...@wmi.amu.edu.pl wrote:
[...]
 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).

There may be a better way, but I think below does what you want.

#+begin_src elisp
  (defun org-display-link ()
(interactive)
(message %s (org-element-property :raw-link (org-element-context
#+end_src

--
Kyle



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

2014-09-25 Thread Jorge A. Alfaro-Murillo
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.




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

2014-09-25 Thread Thorsten Jolitz
Marcin Borkowski mb...@wmi.amu.edu.pl 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).

 I skimmed through org.el, and either I couldn't find a function which
 does it, or this email is a feature request;).

you know about 

,[ C-h f org-toggle-link-display RET ]
| org-toggle-link-display is an interactive compiled Lisp function in
| `org.el'.
| 
| It is bound to menu-bar Org Hyperlinks Descriptive Links,
| menu-bar Org Hyperlinks Literal Links.
| 
| (org-toggle-link-display)
| 
| Toggle the literal or descriptive display of links.
`

?

-- 
cheers,
Thorsten




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

2014-09-25 Thread Marcin Borkowski

On 2014-09-25, at 23:50, Thorsten Jolitz wrote:

 Marcin Borkowski mb...@wmi.amu.edu.pl 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).

 I skimmed through org.el, and either I couldn't find a function which
 does it, or this email is a feature request;).

 you know about 

 ,[ C-h f org-toggle-link-display RET ]
 | org-toggle-link-display is an interactive compiled Lisp function in
 | `org.el'.
 | 
 | It is bound to menu-bar Org Hyperlinks Descriptive Links,
 | menu-bar Org Hyperlinks Literal Links.
 | 
 | (org-toggle-link-display)
 | 
 | Toggle the literal or descriptive display of links.
 `

 ?

Yes, I do, but this is not what I'm looking for.  I want to see the
`descriptive' links, only to be able (sometimes) to look up the actual
target of the link.  (And I don't like the idea of moving the point to
the end, pressing backspace to delete the rightmost bracket, and then
pressing C-\ to undo it...)

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



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

2014-09-25 Thread Jorge A. Alfaro-Murillo
Rasmus writes: 

If point is on a link you can 

   (org-element-property :raw-link (org-element-context)) 


That's way easier =)

--
Jorge.