Переглянути джерело

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.

<<<天空>>>

我爱天空和大地
    ^^^^
Feng Shu 6 роки тому
батько
коміт
69c211d154
1 змінених файлів з 5 додано та 2 видалено
  1. 5 2
      lisp/org.el

+ 5 - 2
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))