From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)] Date: Wed, 24 May 2017 13:56:04 +0000 Message-ID: References: <87wp98dqoq.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1cda68c8d59b0550457748" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDWlv-0004Jz-Oc for emacs-orgmode@gnu.org; Wed, 24 May 2017 09:56:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDWlu-0005dX-6q for emacs-orgmode@gnu.org; Wed, 24 May 2017 09:56:19 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDWlt-0005cw-Nu for emacs-orgmode@gnu.org; Wed, 24 May 2017 09:56:18 -0400 Received: by mail-lf0-x22c.google.com with SMTP id h4so68025865lfj.3 for ; Wed, 24 May 2017 06:56:17 -0700 (PDT) In-Reply-To: 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: Chunyang Xu , Nicolas Goaziou Cc: emacs-orgmode@gnu.org, =?UTF-8?B?5p6X6ZWH5Zu9?= --94eb2c1cda68c8d59b0550457748 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 24, 2017 at 9:50 AM Chunyang Xu wrote: > > Nicolas Goaziou writes: > > > Hello, > > > > =E6=9E=97=E9=95=87=E5=9B=BD writes: > > > >> When I insert a link to my note, such as=E2=80=9C=E8=BF=99=E6=98=AF=E4= =B8=80=E4=B8=AA[[link][=E9=93=BE=E6=8E=A5]]=E5=95=A6~=E2=80=9D=EF=BC=8C > >> the text after the link, "=E5=95=A6~", will be formatting as link styl= e. > > > > FWIW, I cannot reproduce it, i.e., only "=E9=93=BE=E6=8E=A5" appears wi= th a link face. > > I can reproduce if "link" is a real link and "description" doesn't > contain white space, for example, > > [[http://example.com/][Example]]blah > ^^^^ > Also under the org-link face > > It looks like `org-plain-link-re' doesn't think a link is end unless > a punctuation character is found: > > org-plain-link-re > (concat > "\\<" types-re ":" > "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] > \t\n]\\|/\\)\\)\\)") > ^^^^^^^^^^^^^^^^^ > > It is a reasonable assumption for English, but not for Chinese. > I actually stumbled across this few days back, and when using English language :) Here's a solution that might work for you too (and my notes on why I set this): ;; The default value of `org-highlight-links' contains `plain' too. ;; - "plain" links are links in normal text, no whitespace, like http://foo.com. ;; Here's why I remove "plain" from this list: ;; - If I have two bracketed links next to each-other in org-mode (like below), ;; [[http://google.com][1]],[[http://orgmode.org][2]] ;; - and, if `plain' is in the `org-highlight-links' list, ;; the "," in there will also be highlighted as a link. So it would look ;; as if the "1,2" string pointed to a single link! ;; But without `plain' as part of this list, the "1" and "2" strings wil= l ;; look like separate links (as should be the case), as the "," will not be ;; highlighted as a link. (setq org-highlight-links (delete 'plain org-highlight-links)) --=20 Kaushal Modi --94eb2c1cda68c8d59b0550457748 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, May 24= , 2017 at 9:50 AM Chunyang Xu <mai= l@xuchunyang.me> wrote:

Nicolas Goaziou writes:

> Hello,
>
> =E6=9E=97=E9=95=87=E5=9B=BD <mistkafka@gmail.com> writes:
>
>> When I insert a link to my note, such as=E2=80=9C=E8=BF=99=E6=98= =AF=E4=B8=80=E4=B8=AA[[link][=E9=93=BE=E6=8E=A5]]=E5=95=A6~=E2=80=9D=EF=BC= =8C
>> the text after the link, "=E5=95=A6~", will be formattin= g as link style.
>
> FWIW, I cannot reproduce it, i.e., only "=E9=93=BE=E6=8E=A5"= appears with a link face.

I can reproduce if "link" is a real link and "description&qu= ot; doesn't
contain white space, for example,

[[http://example.com/][Example]]blah
=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 =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 Also under the org-link face

It looks like `org-plain-link-re' doesn't think a link is end unles= s
a punctuation character is found:

org-plain-link-re
(concat
=C2=A0"\\<" types-re ":"
=C2=A0"\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \= t\n]\\|/\\)\\)\\)")
=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 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ^^^^^^^^^^^^^^^^^

It is a reasonable assumption for English, but not for Chinese.

I actually stumbled across this few days back, and= when using English language :)

Here's a solut= ion that might work for you too (and my notes on why I set this):

;; The default value of `org-highlight-links' contains = `plain' too.
--94eb2c1cda68c8d59b0550457748--