From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Re: org-element-context doesn't parse consistently link with spaces Date: Wed, 05 Mar 2014 22:37:01 +0900 Message-ID: <87r46gahs2.fsf@tanger.home> References: <87wqgabb08.fsf@tanger.home> <87ha7clqz3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLC0Z-0005at-RW for emacs-orgmode@gnu.org; Wed, 05 Mar 2014 08:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLC0Q-0004BO-Tz for emacs-orgmode@gnu.org; Wed, 05 Mar 2014 08:37:15 -0500 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]:62549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLC0Q-0004BJ-My for emacs-orgmode@gnu.org; Wed, 05 Mar 2014 08:37:06 -0500 Received: by mail-pa0-f46.google.com with SMTP id kp14so1103498pab.33 for ; Wed, 05 Mar 2014 05:37:05 -0800 (PST) In-Reply-To: <87ha7clqz3.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 05 Mar 2014 14:22:56 +0100") 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Daimrod writes: > >> I think that there is a bug in `org-element-context' because it doesn't >> seem to parse link with spaces consistently. >> >> For example: >> >> #+BEGIN_EXAMPLE >> v >> [[file:test 1 2 3]] >> ^ >> #+END_EXAMPLE >> >> If the cursor is before the '1', then `org-element-context' will return: >> >> #+BEGIN_EXAMPLE >> (link (:type "file" :path "test" :raw-link "file:test" :application nil :search-option nil :begin 26 ...)) >> #+END_EXAMPLE >> >> if the cursor is one or after the '1', then `org-element-context' will return: >> >> #+BEGIN_EXAMPLE >> (link (:type "file" :path "test%201%202%203" :raw-link "file:test%201%202%203" :application nil :search-option nil :begin 1 ...)) >> #+END_EXAMPLE > > I cannot reproduce it. What Org version do you use? Did you try to > disable `org-element-use-cache'? Sorry, it happens with: #+BEGIN_EXAMPLE [[file:test%201%202%203][file:test 1 2 3]] #+END_EXAMPLE I use org-mode version release_8.0.2-101-gce5988 (I follow the git upstream) and I tried it with `org-element-use-cache' set to nil. It doesn't happen with: #+BEGIN_EXAMPLE [[file:test 1 2 3]] #+END_EXAMPLE but as soon as the cursor leaves the link, org-mode rewrite the link to: #+BEGIN_EXAMPLE [[file:test%201%202%203][file:test 1 2 3]] #+END_EXAMPLE Best, -- Daimrod/Greg