Re: Display in minibuffer link under point

2020-05-16 Thread Garjola Dindi
On Mon 11-May-2020 at 17:53:06 +02, John Kitchin
 wrote: 
> org-ref doesn't do anything fancy here, it just runs an idle timer:
>
> https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L597
>
> that runs a function defined at
> https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L3633
>
> that function is kind of long because it computes the message, and only
> in specific contexts.
>

Hi,

This is what I did:

(when (not (or (looking-at " ") ;looking at a space
 (looking-at "^$")  ;looking at a blank line
 (looking-at "]")   ;looking at a bracket at the end
;looking at the end of the line.
 (looking-at "$")))

(save-restriction
  (widen)
  (when (eq major-mode 'org-mode)
(let* ((object (org-element-context))
   (type (org-element-property :type object))
   (link-content (org-element-property :path object)))
  (save-excursion
(message "%s:%s" type link-content))


It seems to do what I want.

Thank you very much for your help.

Garjola


> Garjola Dindi  writes:
>
>> Hi,
>>
>> Thanks both of you for your answers.
>>
>> What would be the way to automatically trigger =display-local-help= when the 
>> point is on the link? Org-ref does that beautifully ;)
>>
>> Thanks again.
>>
>> Garjola
>>
>> On Fri 08-May-2020 at 22:48:37 +02, John Kitchin  
>> wrote:
>>> It looks like that variable is obsolete now since Emacs 24.1, and 
>>> (tooltip-mode -1) is probably the way to get the same thing now.
>>>
>>> John
>>>
>>> ---
>>> Professor John Kitchin
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>>
>>> On Fri, May 8, 2020 at 1:18 PM briangpowell .  
>>> wrote:
>>>
>>>  I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio 
>>> desktop:
>>>
>>>  (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>>>
>>>  Of course I had to do some programming to do that but the above should get 
>>> you started
>>>
>>>  And we can leave that programming as an exercise for the class--right Dr. 
>>> Kitchin?
>>>
>>>  ;-)
>>>
>>>  On Fri, May 8, 2020 at 9:19 AM John Kitchin  
>>> wrote:
>>>
>>>  M-x display-local-help might do it.
>>>
>>>  John
>>>
>>>  ---
>>>  Professor John Kitchin
>>>  Doherty Hall A207F
>>>  Department of Chemical Engineering
>>>  Carnegie Mellon University
>>>  Pittsburgh, PA 15213
>>>  412-268-7803
>>>  @johnkitchin
>>>  http://kitchingroup.cheme.cmu.edu
>>>
>>>  On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>>>
>>>  Hi,
>>>
>>>  Is there a way to display in the minibuffer the URL of the link under
>>>  the point in the same way as when the mouse pointer is over the link?
>>>
>>>  Thanks!
>>>
>>>  Garjola
>>>  --
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
-- 




Re: Display in minibuffer link under point

2020-05-11 Thread John Kitchin
org-ref doesn't do anything fancy here, it just runs an idle timer:

https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L597

that runs a function defined at
https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L3633

that function is kind of long because it computes the message, and only
in specific contexts.

Garjola Dindi  writes:

> Hi,
>
> Thanks both of you for your answers.
>
> What would be the way to automatically trigger =display-local-help= when the 
> point is on the link? Org-ref does that beautifully ;)
>
> Thanks again.
>
> Garjola
>
> On Fri 08-May-2020 at 22:48:37 +02, John Kitchin  
> wrote:
>> It looks like that variable is obsolete now since Emacs 24.1, and 
>> (tooltip-mode -1) is probably the way to get the same thing now.
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>> On Fri, May 8, 2020 at 1:18 PM briangpowell .  
>> wrote:
>>
>>  I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio 
>> desktop:
>>
>>  (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>>
>>  Of course I had to do some programming to do that but the above should get 
>> you started
>>
>>  And we can leave that programming as an exercise for the class--right Dr. 
>> Kitchin?
>>
>>  ;-)
>>
>>  On Fri, May 8, 2020 at 9:19 AM John Kitchin  wrote:
>>
>>  M-x display-local-help might do it.
>>
>>  John
>>
>>  ---
>>  Professor John Kitchin
>>  Doherty Hall A207F
>>  Department of Chemical Engineering
>>  Carnegie Mellon University
>>  Pittsburgh, PA 15213
>>  412-268-7803
>>  @johnkitchin
>>  http://kitchingroup.cheme.cmu.edu
>>
>>  On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>>
>>  Hi,
>>
>>  Is there a way to display in the minibuffer the URL of the link under
>>  the point in the same way as when the mouse pointer is over the link?
>>
>>  Thanks!
>>
>>  Garjola
>>  --


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: Display in minibuffer link under point

2020-05-10 Thread Garjola Dindi
Hi,

Thanks both of you for your answers. 

What would be the way to automatically trigger =display-local-help= when the 
point is on the link? Org-ref does that beautifully ;)

Thanks again.

Garjola

On Fri 08-May-2020 at 22:48:37 +02, John Kitchin  
wrote: 
> It looks like that variable is obsolete now since Emacs 24.1, and 
> (tooltip-mode -1) is probably the way to get the same thing now. 
>
> John
>
> ---
> Professor John Kitchin 
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
> On Fri, May 8, 2020 at 1:18 PM briangpowell .  
> wrote:
>
>  I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio 
> desktop:
>
>  (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>
>  Of course I had to do some programming to do that but the above should get 
> you started
>
>  And we can leave that programming as an exercise for the class--right Dr. 
> Kitchin?
>
>  ;-)
>
>  On Fri, May 8, 2020 at 9:19 AM John Kitchin  wrote:
>
>  M-x display-local-help might do it.
>
>  John
>
>  ---
>  Professor John Kitchin 
>  Doherty Hall A207F
>  Department of Chemical Engineering
>  Carnegie Mellon University
>  Pittsburgh, PA 15213
>  412-268-7803
>  @johnkitchin
>  http://kitchingroup.cheme.cmu.edu
>
>  On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>
>  Hi,
>
>  Is there a way to display in the minibuffer the URL of the link under
>  the point in the same way as when the mouse pointer is over the link?
>
>  Thanks!
>
>  Garjola
>  -- 
-- 




Re: Display in minibuffer link under point

2020-05-08 Thread John Kitchin
It looks like that variable is obsolete now since Emacs 24.1, and
(tooltip-mode -1) is probably the way to get the same thing now.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Fri, May 8, 2020 at 1:18 PM briangpowell . 
wrote:

> I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio
> desktop:
>
> (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>
> Of course I had to do some programming to do that but the above should get
> you started
>
> And we can leave that programming as an exercise for the class--right Dr.
> Kitchin?
>
> ;-)
>
>
>
>
>
>
>
>
> On Fri, May 8, 2020 at 9:19 AM John Kitchin 
> wrote:
>
>> M-x display-local-help might do it.
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>>
>> On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>>
>>> Hi,
>>>
>>> Is there a way to display in the minibuffer the URL of the link under
>>> the point in the same way as when the mouse pointer is over the link?
>>>
>>> Thanks!
>>>
>>> Garjola
>>> --
>>>
>>>
>>>


Re: Display in minibuffer link under point

2020-05-08 Thread briangpowell .
I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio
desktop:

(setq tooltip-use-echo-area (not tooltip-use-echo-area))

Of course I had to do some programming to do that but the above should get
you started

And we can leave that programming as an exercise for the class--right Dr.
Kitchin?

;-)








On Fri, May 8, 2020 at 9:19 AM John Kitchin  wrote:

> M-x display-local-help might do it.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>
>> Hi,
>>
>> Is there a way to display in the minibuffer the URL of the link under
>> the point in the same way as when the mouse pointer is over the link?
>>
>> Thanks!
>>
>> Garjola
>> --
>>
>>
>>


Re: Display in minibuffer link under point

2020-05-08 Thread John Kitchin
M-x display-local-help might do it.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:

> Hi,
>
> Is there a way to display in the minibuffer the URL of the link under
> the point in the same way as when the mouse pointer is over the link?
>
> Thanks!
>
> Garjola
> --
>
>
>


Display in minibuffer link under point

2020-05-08 Thread Garjola Dindi
Hi,

Is there a way to display in the minibuffer the URL of the link under
the point in the same way as when the mouse pointer is over the link?

Thanks!

Garjola
--