From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Org-mode link returned path is truncated when contains space Date: Wed, 31 May 2017 16:31:23 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1148ee68a2272f0550cdc030" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFz2s-0002Gk-8h for emacs-orgmode@gnu.org; Wed, 31 May 2017 04:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFz2r-0006KI-3E for emacs-orgmode@gnu.org; Wed, 31 May 2017 04:31:58 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:38218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFz2q-0006JS-Ru for emacs-orgmode@gnu.org; Wed, 31 May 2017 04:31:57 -0400 Received: by mail-wm0-x233.google.com with SMTP id e127so10161121wmg.1 for ; Wed, 31 May 2017 01:31:55 -0700 (PDT) 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" To: Org-mode --001a1148ee68a2272f0550cdc030 Content-Type: text/plain; charset="UTF-8" I have a link in org-moe file like this: #+BEGIN_SRC org [[file:Data/images/logos/Full color Git logo for light backgrounds.png]] #+END_SRC *The file did exist.* I have elisp code like this to fontify link when the file does not exist: #+BEGIN_SRC emacs-lisp (org-link-set-parameters "file" ;; TODO: fix path contains space case. :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning))) #+END_SRC But it is fontied as red. I tried to debug info by print of ~path~ in upper `org-link-set-parameters` lambda function. It return for path: #+BEGIN_EXAMPLE "Data/images/logos/Full" #+END_EXAMPLE [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --001a1148ee68a2272f0550cdc030 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= I have a link in org-moe file like = this:

=C2=A0#+BEGIN_SRC org
=C2=A0[[file:Data/images= /logos/Full color Git logo for light backgrounds.png]]
=C2=A0#+END_SR= C

=C2=A0*The file did exist.*

=C2=A0I hav= e elisp code like this to fontify link when the file does not exist:=
=
=C2=A0#+BEGIN_SRC emacs-lisp
=C2=A0(org-link-set-parameter= s
=C2=A0 "file"
=C2=A0 ;; TODO: fix path contains spa= ce case.
=C2=A0 :face (lambda (path) (if (file-exists-p path) 'or= g-link 'org-warning)))
=C2=A0#+END_SRC

=C2=A0But= it is fontied as red. I tried to debug info by print of ~path~ in upper `o= rg-link-set-parameters` lambda function.

=C2=A0It return = for path:

=C2=A0#+BEGIN_EXAMPLE
=C2=A0"Data/ima= ges/logos/Full"
=C2=A0#+END_EXAMPLE

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key= ID: 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B= 9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
--001a1148ee68a2272f0550cdc030--