emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tumashu  <tumashu@163.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Let radio target works well with Chinese
Date: Thu, 28 Feb 2019 18:39:54 +0800 (CST)	[thread overview]
Message-ID: <158fd2f6.1110a.16933b06f3d.Coremail.tumashu@163.com> (raw)
In-Reply-To: <87a7ikf3s3.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]











在 2019-02-25 20:31:24,"Nicolas Goaziou" <mail@nicolasgoaziou.fr> 写道:
>Hello,
>
>"Feng Shu" <tumashu@163.com> writes:
>
>> * lisp/org.el (org-update-radio-target-regexp): Let radio target works well with Chinese
>
>Thank you.
>
>> There is no need to force split words with the help
>> of space for Chinese, this change let the below
>> example works well.
>>
>> <<<天空>>>
>>
>> 我爱天空和大地
>>     ^^^^
>
>Org doesn't support mid-word radio targets. Is there any strong reason
>to make a case for Chinese? What about other languages?
>
>


Because Chinese need no space between words :-), for example:

    我不知道这个事情到底对不对,你觉得对就对,不对就不对。

I have updated the patch adviced by Eric Abrahamsen:




>Regards,
>
>-- 
>Nicolas Goaziou

[-- Attachment #2: 0001-Let-radio-target-works-well-with-Chinese.patch --]
[-- Type: application/octet-stream, Size: 1130 bytes --]

From 8dd941e06fb9225b446c86561c8ad898414c6a4d Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@163.com>
Date: Sun, 24 Feb 2019 17:52:51 +0800
Subject: [PATCH] Let radio target works well with Chinese
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/org.el (org-update-radio-target-regexp): Let radio target works well with Chinese.

There is no need to force split words with the help
of space for Chinese, this change let the below
example works well.

<<<天空>>>

我爱天空和大地
    ^^^^
---
 lisp/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 9f33c9e60..104982bfe 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6052,8 +6052,8 @@ by a #."
 Also refresh fontification if needed."
   (interactive)
   (let ((old-regexp org-target-link-regexp)
-	(before-re "\\(?:^\\|[^[:alnum:]]\\)\\(")
-	(after-re "\\)\\(?:$\\|[^[:alnum:]]\\)")
+	(before-re "\\(?:^\\|[^[:alnum:]]\\|\\c|\\)\\(")
+	(after-re "\\)\\(?:$\\|[^[:alnum:]]\\|\\c|\\)")
 	(targets
 	 (org-with-wide-buffer
 	  (goto-char (point-min))
-- 
2.20.1


  parent reply	other threads:[~2019-02-28 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-24 10:08 [PATCH] Let radio target works well with Chinese Feng Shu
2019-02-25 12:31 ` Nicolas Goaziou
2019-02-25 14:08   ` Emilio Francesquini
2019-02-25 19:50     ` Eric Abrahamsen
2019-02-26  3:02       ` tumashu
2019-02-28 10:39   ` tumashu [this message]
2019-02-28 13:52     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158fd2f6.1110a.16933b06f3d.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).