From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: commit 4e864643 breaks org-return Date: Sat, 24 Oct 2015 00:34:54 +0200 Message-ID: <87twphxlgx.fsf@nicolasgoaziou.fr> References: <20151022165708.GL12141@scotty.home> <20151023200734.GM12141@scotty.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpktb-0007i6-TW for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 18:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpkta-0002kK-Vg for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 18:33:11 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:40784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpkta-0002k1-PI for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 18:33:10 -0400 In-Reply-To: <20151023200734.GM12141@scotty.home> (Stefan-W. Hahn's message of "Fri, 23 Oct 2015 22:07:34 +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: "Stefan-W. Hahn" Cc: emacs-orgmode@gnu.org 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 (&optional 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