From 69c211d154003773eb3aa45e7aaaf96de200cd1c Mon Sep 17 00:00:00 2001 From: Feng Shu 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 477e8148f..87b9120a4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6188,8 +6188,11 @@ by a #." Also refresh fontification if needed." (interactive) (let ((old-regexp org-target-link-regexp) - (before-re "\\(?:^\\|[^[:alnum:]]\\)\\(") - (after-re "\\)\\(?:$\\|[^[:alnum:]]\\)") + ;; Some languages, e.g., Chinese, do not use spaces to + ;; separate words. Also allow to surround radio targets with + ;; line-breakable characters. + (before-re "\\(?:^\\|[^[:alnum:]]\\|\\c|\\)\\(") + (after-re "\\)\\(?:$\\|[^[:alnum:]]\\|\\c|\\)") (targets (org-with-wide-buffer (goto-char (point-min))