summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Shu <tumashu@163.com>2019-02-24 17:52:51 +0800
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-28 14:06:17 +0100
commit69c211d154003773eb3aa45e7aaaf96de200cd1c (patch)
tree5b8a7be4085982a93a2e6f441acc8a378f498236
parente21ad2aea1075f8788f288ea41f4c0a1b4c100db (diff)
downloadorg-mode-69c211d154003773eb3aa45e7aaaf96de200cd1c.tar.gz
Let radio target works well with Chinese
* 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. <<<天空>>> 我爱天空和大地 ^^^^
-rw-r--r--lisp/org.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 477e814..87b9120 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))