From 8ac4260f312c5ddfc0c350ba30285dd0efde471d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= Date: Tue, 30 Aug 2016 12:22:29 -0400 Subject: [PATCH] Add zero-width spaces to org-emphasis-regexp-components * lisp/org.el: Add U+8203 and U+8288 to pre and post regexps of org-emphasis-regexp-components; this makes it easy to fix cases in which a marker is not properly detected, by inserting a zero-width space (breaking) or a word joiner (non breaking) before or after the marker. --- lisp/org.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bec8a99..80f7b06 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4496,7 +4496,7 @@ After a match, the match groups contain these elements: ;; set this option proved cumbersome. See this message/thread: ;; http://article.gmane.org/gmane.emacs.orgmode/68681 (defvar org-emphasis-regexp-components - '(" \t('\"{" "- \t.,:!?;'\")}\\[" " \t\r\n" "." 1) + '(" \t('\"{​⁠" "- \t.,:!?;'\")}\\[​⁠" " \t\r\n" "." 1) "Components used to build the regular expression for emphasis. This is a list with five entries. Terminology: In an emphasis string like \" *strong word* \", we call the initial space PREMATCH, the final @@ -4511,7 +4511,9 @@ body-regexp A regexp like \".\" to match a body character. Don't use non-shy groups here, and don't allow newline here. newline The maximum number of newlines allowed in an emphasis exp. -You need to reload Org or to restart Emacs after customizing this.") +The default for both pre and post includes zero-width spaces (​) +and word joiners (⁠, aka zero-width no-break space). You need to +reload Org or to restart Emacs after customizing this variable.") (defcustom org-emphasis-alist '(("*" bold) -- 2.7.4