Re: [O] commit 4e864643 breaks org-return
Yes, absolutely, it's annnoying. This probably is the bug I reported a day ago. But in the past I observed this a bit differently: Your description is correct, but there is/was a workaround: If you go to x from the line below (i.e. press cursor left from the beginning of the next line) it does/did not trigger. Any fix should probably be tested against that trick too. Cheers, Simon On 10/24/15 06:48, Stefan-W. Hahn wrote: Mail von Nicolas Goaziou, Sat, 24 Oct 2015 at 00:34:54 +0200: Hello, commit 4e864643bdb6bba3e000ea51fb746a26e40b1f77 Author: Nicolas GoaziouDate: Sun Oct 18 09:36:15 2015 +0200 changes the behaviour of org-return when positioned right after a link with org-return-follows-link set to t. the following patch seems to repair the behaviour: But is the current behaviour broken in the first place? At least it is consistent with `org-open-at-point' (C-c C-o). Yes. Yes. Before commit 4e86464 the behaviour was: [[link][description]]x with cursor at x hitting I got a line opened with cursor positioned at the beginning of the new line (or indented). But you are right, org-open-at-point with cursor at position x jumps to the link. This behaviour is not changed with the commit but I think this is also not the right behaviour. If you go with the mouse over the x then you don't get any popup from the link. For this you have to go at least over the last character "]" of the link resp. the visual "n" of the description. Even if you describe-text-properties with cursor at x you don't get any hint of the link. You have to go over the "]" (resp. "n") to see the link hint. From my point of view the commit 4e86464 changes the behaviour of org-return in a manner of which I think is not natural. org-open-at-point is, in my opinion, wrong in the same way because description says: "... When point is on a link, follow it." And being with cursor at x is obviously not "on a link". Any opinions from you or other org'ers? With kind regards, Stefan
Re: [O] commit 4e864643 breaks org-return
Mail von Nicolas Goaziou, Sat, 24 Oct 2015 at 00:34:54 +0200: Hello, > >> commit 4e864643bdb6bba3e000ea51fb746a26e40b1f77 > >> Author: Nicolas Goaziou> >> Date: Sun Oct 18 09:36:15 2015 +0200 > >> > >> changes the behaviour of org-return when positioned right after a link with > >> org-return-follows-link set to t. > > > > the following patch seems to repair the behaviour: > > But is the current behaviour broken in the first place? At least it is > consistent with `org-open-at-point' (C-c C-o). Yes. Yes. Before commit 4e86464 the behaviour was: [[link][description]]x with cursor at x hitting I got a line opened with cursor positioned at the beginning of the new line (or indented). But you are right, org-open-at-point with cursor at position x jumps to the link. This behaviour is not changed with the commit but I think this is also not the right behaviour. If you go with the mouse over the x then you don't get any popup from the link. For this you have to go at least over the last character "]" of the link resp. the visual "n" of the description. Even if you describe-text-properties with cursor at x you don't get any hint of the link. You have to go over the "]" (resp. "n") to see the link hint. From my point of view the commit 4e86464 changes the behaviour of org-return in a manner of which I think is not natural. org-open-at-point is, in my opinion, wrong in the same way because description says: "... When point is on a link, follow it." And being with cursor at x is obviously not "on a link". Any opinions from you or other org'ers? With kind regards, Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.
Re: [O] commit 4e864643 breaks org-return
Mail von Stefan-W. Hahn, Thu, 22 Oct 2015 at 18:57:08 +0200: Hello, > commit 4e864643bdb6bba3e000ea51fb746a26e40b1f77 > Author: Nicolas Goaziou> Date: Sun Oct 18 09:36:15 2015 +0200 > > changes the behaviour of org-return when positioned right after a link with > org-return-follows-link set to t. the following patch seems to repair the behaviour: #+BEGIN_SRC elisp diff --git a/lisp/org.el b/lisp/org.el index a5183aa..3d527ac 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -21354,7 +21354,9 @@ (defun org-return ( indent) ((and org-return-follows-link (or (org-at-timestamp-p t) (org-at-date-range-p t) - (org-in-regexp org-any-link-re))) + (org-in-regexp org-any-link-re)) + (< (point) + (org-element-property :end context))) (call-interactively #'org-open-at-point)) ;; Insert newline in heading, but preserve tags. ((and (not (bolp)) #+END_SRC elisp With kind regards, Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.
Re: [O] commit 4e864643 breaks org-return
Hello, "Stefan-W. Hahn"writes: > Mail von Stefan-W. Hahn, Thu, 22 Oct 2015 at 18:57:08 +0200: > > Hello, > >> commit 4e864643bdb6bba3e000ea51fb746a26e40b1f77 >> Author: Nicolas Goaziou >> Date: Sun Oct 18 09:36:15 2015 +0200 >> >> changes the behaviour of org-return when positioned right after a link with >> org-return-follows-link set to t. > > the following patch seems to repair the behaviour: But is the current behaviour broken in the first place? At least it is consistent with `org-open-at-point' (C-c C-o). > > #+BEGIN_SRC elisp > diff --git a/lisp/org.el b/lisp/org.el > index a5183aa..3d527ac 100755 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -21354,7 +21354,9 @@ (defun org-return ( indent) > ((and org-return-follows-link >(or (org-at-timestamp-p t) >(org-at-date-range-p t) > - (org-in-regexp org-any-link-re))) > + (org-in-regexp org-any-link-re)) > + (< (point) > + (org-element-property :end context))) This wouldn't cut it because CONTEXT is wrong when, e.g., point is in a comment. I think you're after the VISUALLY argument from `org-in-regexp'. But then, it would require to turn `org-at-date-range-p' and `org-at-timestamp-p' into `org-in-regexp' calls. Regards, -- Nicolas Goaziou
[O] commit 4e864643 breaks org-return
Hello, commit 4e864643bdb6bba3e000ea51fb746a26e40b1f77 Author: Nicolas GoaziouDate: Sun Oct 18 09:36:15 2015 +0200 changes the behaviour of org-return when positioned right after a link with org-return-follows-link set to t. The test shows the scenario which now goes wrong: #+BEGIN_SRC elisp (should-not (org-test-with-temp-text "Link [[target]] <>" (let ((org-return-follows-link t) (org-link-search-must-match-exact-headline nil)) (org-return)) (org-looking-at-p "<>"))) #+END_SRC Behaviour before was to open a new line. Same for links in task headline or any other link. With kind regards, Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.