emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ISSUE] links navigation not consistent behavior
@ 2019-03-27 23:36 stardiviner
  2019-04-02 20:14 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: stardiviner @ 2019-03-27 23:36 UTC (permalink / raw)
  To: Org Mode


For example, I have following Org content:

#+begin_src org
,*** TODO Figwheel [0/1]

- [ ] https://www.youtube.com/watch?v=yUTxm29fjT4 :: I built a
  Figwheel-inspired, hot code reloading experience for Clojure, with an eye
  towards #datascience hacking.

,*** TODO Docker ClojureScript [0/3]

- [ ] https://www.youtube.com/watch?v=yUTxm29fjT4
#+end_src

When my point at beginning of buffer, then press {{{kbd(C-c C-x C-n)}}} , it does not
jump to first link, it jump to second link instead. But when I jump backwards
with {{{kbd(C-c C-x C-p)}}} works fine.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-03-27 23:36 [ISSUE] links navigation not consistent behavior stardiviner
@ 2019-04-02 20:14 ` Nicolas Goaziou
  2019-04-03 16:28   ` Nick Dokos
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-02 20:14 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

Hello,

stardiviner <numbchild@gmail.com> writes:

> For example, I have following Org content:
>
> #+begin_src org
> ,*** TODO Figwheel [0/1]
>
> - [ ] https://www.youtube.com/watch?v=yUTxm29fjT4 :: I built a
>   Figwheel-inspired, hot code reloading experience for Clojure, with an eye
>   towards #datascience hacking.
>
> ,*** TODO Docker ClojureScript [0/3]
>
> - [ ] https://www.youtube.com/watch?v=yUTxm29fjT4
> #+end_src
>
> When my point at beginning of buffer, then press {{{kbd(C-c C-x C-n)}}} , it does not
> jump to first link, it jump to second link instead. But when I jump backwards
> with {{{kbd(C-c C-x C-p)}}} works fine.

I rewrote this functions some weeks ago. Please try again on master.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-02 20:14 ` Nicolas Goaziou
@ 2019-04-03 16:28   ` Nick Dokos
  2019-04-04 13:54     ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2019-04-03 16:28 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> For example, I have following Org content:
>>
>> #+begin_src org ,*** TODO Figwheel [0/1]
>>
>> - [ ] https://www.youtube.com/watch?v=yUTxm29fjT4 :: I built a
>>   Figwheel-inspired, hot code reloading experience for Clojure,
>>   with an eye towards #datascience hacking.
>>
>> ,*** TODO Docker ClojureScript [0/3]
>>
>> - [ ] https://www.youtube.com/watch?v=yUTxm29fjT4 #+end_src
>>
>> When my point at beginning of buffer, then press {{{kbd(C-c C-x
>> C-n)}}} , it does not jump to first link, it jump to second link
>> instead. But when I jump backwards with {{{kbd(C-c C-x C-p)}}}
>> works fine.
>
> I rewrote this functions some weeks ago. Please try again on master.
>

I can reproduce the problem with very recent org. I did some debugging
and here are my notes:


,----
| I can reproduce this and traced it to this code:
| 
| ,----
| |     (catch :found
| |       (while (funcall search-fun org-link-any-re nil t)
| | 	(pcase (org-element-lineage (org-element-context) '(link) t) 	;;; <<<<< HERE
| | 	  (`nil nil) (link
| | 	   (goto-char (org-element-property :begin link)) (when
| | 	   (org-invisible-p) (org-show-context)) (throw :found t))))
| `----
| 
| which is a rewrite of org-next-link in commit 4ff8947ea8.
| 
| There is some asymmetry in how forward and backward searches behave:
| 
|  - in the forward case, the search ends up at the end of the first
|    link where `org-element-lineage' returns nil, so the loop repeats;
|    we then end up at the end of the second link where
|    `org-element-lineage' returns the link, we go to the beginning of
|    the link and return.
| 
|  - in the backward case, we end up at the beginning of each link in
|    turn, in which case `org-element-lineage' returns a link, so both
|    links are found.
| 
| So it may be that `org-element-context' should return a structure with
| the link included when called at the end of the first link or it may
| be that the search should back up one char in the forward case, before
| calling org-context.
`----

This may be wrong but I did not have time to continue with it: I hope it's
useful.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-03 16:28   ` Nick Dokos
@ 2019-04-04 13:54     ` Nicolas Goaziou
  2019-04-08  0:32       ` stardiviner
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-04 13:54 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> | I can reproduce this and traced it to this code:
> | 
> | ,----
> | |     (catch :found
> | |       (while (funcall search-fun org-link-any-re nil t)
> | | 	(pcase (org-element-lineage (org-element-context) '(link) t) 	;;; <<<<< HERE
> | | 	  (`nil nil) (link
> | | 	   (goto-char (org-element-property :begin link)) (when
> | | 	   (org-invisible-p) (org-show-context)) (throw :found t))))
> | `----
> | 
> | which is a rewrite of org-next-link in commit 4ff8947ea8.
> | 
> | There is some asymmetry in how forward and backward searches behave:
> | 
> |  - in the forward case, the search ends up at the end of the first
> |    link where `org-element-lineage' returns nil, so the loop repeats;
> |    we then end up at the end of the second link where
> |    `org-element-lineage' returns the link, we go to the beginning of
> |    the link and return.
> | 
> |  - in the backward case, we end up at the beginning of each link in
> |    turn, in which case `org-element-lineage' returns a link, so both
> |    links are found.
> | 
> | So it may be that `org-element-context' should return a structure with
> | the link included when called at the end of the first link or it may
> | be that the search should back up one char in the forward case, before
> | calling org-context.
> `----
>
> This may be wrong but I did not have time to continue with it: I hope it's
> useful.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-04 13:54     ` Nicolas Goaziou
@ 2019-04-08  0:32       ` stardiviner
  2019-04-08  9:26         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: stardiviner @ 2019-04-08  0:32 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Nick Dokos


I'm using the latest commit of master branch of Org. Still have link navigation problem.

It used can treat http:// like url as link too. Now it is ignored. Is it on designed or an issue?

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-08  0:32       ` stardiviner
@ 2019-04-08  9:26         ` Nicolas Goaziou
  2019-04-09 22:48           ` stardiviner
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-08  9:26 UTC (permalink / raw)
  To: stardiviner; +Cc: Nick Dokos, emacs-orgmode

Hello,

stardiviner <numbchild@gmail.com> writes:

> I'm using the latest commit of master branch of Org. Still have link navigation problem.
>
> It used can treat http:// like url as link too. Now it is ignored. Is
> it on designed or an issue?

I don't understand your report. Please describe it with an example.
Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-08  9:26         ` Nicolas Goaziou
@ 2019-04-09 22:48           ` stardiviner
  2019-04-10 13:34             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: stardiviner @ 2019-04-09 22:48 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nick Dokos, emacs-orgmode


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> I'm using the latest commit of master branch of Org. Still have link navigation problem.
>>
>> It used can treat http:// like url as link too. Now it is ignored. Is
>> it on designed or an issue?
>
> I don't understand your report. Please describe it with an example.
> Thank you.
>
> Regards,


#+begin_src org


https://www.bing.com

,* link in properties drawer
  :PROPERTIES:
  :URL:      http://www.google.com
  :END:

https://www.bing.com
  
,* http(s) url in content of headline
  
https://www.baidu.com
#+end_src

In upper example, when I link jumping from first link to next, it will skip the
url in properties drawer.

When I try to jump backwards, some times reports "no further link found", like
when I'm on the last link.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-09 22:48           ` stardiviner
@ 2019-04-10 13:34             ` Nicolas Goaziou
  2019-04-11 23:10               ` stardiviner
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-10 13:34 UTC (permalink / raw)
  To: stardiviner; +Cc: Nick Dokos, emacs-orgmode

Hello,

stardiviner <numbchild@gmail.com> writes:
> #+begin_src org
> https://www.bing.com
>
> ,* link in properties drawer
>   :PROPERTIES:
>   :URL:      http://www.google.com
>   :END:
>
> https://www.bing.com
>   
> ,* http(s) url in content of headline
>   
> https://www.baidu.com
> #+end_src

> In upper example, when I link jumping from first link to next, it will skip the
> url in properties drawer.

This is expected. 

The value in a properties drawer cannot be a link, even though
`org-open-at-point' would normally open it, as is done for comments. 

In addition to no being syntactically a valid link, I think it is
undesirable for an interactive command to display hidden internal data.

If you want to reach it, just write a function calling

   (re-search-forward org-any-link-re nil t)

> When I try to jump backwards, some times reports "no further link found", like
> when I'm on the last link.

I think I fixed this.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] links navigation not consistent behavior
  2019-04-10 13:34             ` Nicolas Goaziou
@ 2019-04-11 23:10               ` stardiviner
  0 siblings, 0 replies; 9+ messages in thread
From: stardiviner @ 2019-04-11 23:10 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nick Dokos, emacs-orgmode


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> stardiviner <numbchild@gmail.com> writes:
>> #+begin_src org
>> https://www.bing.com
>>
>> ,* link in properties drawer
>>   :PROPERTIES:
>>   :URL:      http://www.google.com
>>   :END:
>>
>> https://www.bing.com
>>   
>> ,* http(s) url in content of headline
>>   
>> https://www.baidu.com
>> #+end_src
>
>> In upper example, when I link jumping from first link to next, it will skip the
>> url in properties drawer.
>
> This is expected. 
>
> The value in a properties drawer cannot be a link, even though
> `org-open-at-point' would normally open it, as is done for comments. 

I see.

>
> In addition to no being syntactically a valid link, I think it is
> undesirable for an interactive command to display hidden internal data.
>
> If you want to reach it, just write a function calling
>
>    (re-search-forward org-any-link-re nil t)

Thanks for this advice.

>
>> When I try to jump backwards, some times reports "no further link found", like
>> when I'm on the last link.
>
> I think I fixed this.

Thanks again for your work. :)

>
> Thank you.
>
> Regards,

Have a nice day, Nicolas.


-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-11 23:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 23:36 [ISSUE] links navigation not consistent behavior stardiviner
2019-04-02 20:14 ` Nicolas Goaziou
2019-04-03 16:28   ` Nick Dokos
2019-04-04 13:54     ` Nicolas Goaziou
2019-04-08  0:32       ` stardiviner
2019-04-08  9:26         ` Nicolas Goaziou
2019-04-09 22:48           ` stardiviner
2019-04-10 13:34             ` Nicolas Goaziou
2019-04-11 23:10               ` stardiviner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).