From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Re: Bug? Highlighting inconsistent with export Date: Tue, 30 Aug 2016 12:36:40 -0400 Message-ID: <6869e618-463c-2c72-d60f-9c4b9fe54ea9@gmail.com> References: <87eg56in7c.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iwbke51BpdW03pt5dDVrVCQsTFi8GoDT4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bem2F-0001lI-KR for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 12:37:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bem29-0005sa-KI for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 12:37:14 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:62158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bem29-0005sQ-8b for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 12:37:09 -0400 Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0MXCaX-1bZ0sL0i7J-00WG2Y for ; Tue, 30 Aug 2016 18:37:08 +0200 In-Reply-To: <87eg56in7c.fsf@saiph.selenimh> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iwbke51BpdW03pt5dDVrVCQsTFi8GoDT4 Content-Type: multipart/mixed; boundary="gnjJdqfDFSN5Xk9s0Uoqv3jtmVjK7iUja"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: <6869e618-463c-2c72-d60f-9c4b9fe54ea9@gmail.com> Subject: Re: Bug? Highlighting inconsistent with export References: <87eg56in7c.fsf@saiph.selenimh> In-Reply-To: <87eg56in7c.fsf@saiph.selenimh> --gnjJdqfDFSN5Xk9s0Uoqv3jtmVjK7iUja Content-Type: multipart/mixed; boundary="------------F515120921AAC2A48AC05AE5" This is a multi-part message in MIME format. --------------F515120921AAC2A48AC05AE5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-30 06:08, Nicolas Goaziou wrote: > I have no objection to this. Ok; patch attached :) Here's a test case: ~this~~won't~~work~ ~but~=E2=80=8B~this~=E2=80=8B~will~ ~and~=E2=81=A0~so~=E2=81=A0~will~=E2=81=A0~this~ =E2=87=92 this~~won't~~work but=E2=80=8Bthis=E2=80=8Bwill and=E2=81=A0so=E2=81=A0will=E2= =81=A0this You can see the difference in behaviour by resizing the browser window: t= he second line will break at code boundaries (it uses zero-width spaces) = while the second line will stay together (it uses word joiners, aka zero-= width no-break spaces) I detailed the change in the commit message. > However, another option is to get rid of > `org-emphasis-regexp-components', make every paired "=3D" character > trigger verbatim mode and every paired "~" characters trigger code mode= , > but provide a way to escape "=3D" and "~". It should probably be extend= ed > to any emphasis markup and special characters like "|", "#"... I agree, though this seems non-trivial. Here's another idea (I don't kno= w how it compares to other options :): src_[]{} could be extended t= o allow different delimiters; this would make it more widely usable. For = example, the following forms would all be equivalent: src_elisp[=E2=80=A6options=E2=80=A6]<=E2=80=A6code=E2=80=A6> src_elisp[=E2=80=A6options=E2=80=A6]=E2=80=9C=E2=80=A6code=E2=80=A6=E2= =80=9D src_elisp[=E2=80=A6options=E2=80=A6]=E2=9F=A8=E2=80=A6code=E2=80=A6=E2= =9F=A9 src_elisp[=E2=80=A6options=E2=80=A6]=C2=AB=E2=80=A6code=E2=80=A6=C2=BB= This is inspired by LaTeX's \verb syntax, but using paired delimiters. T= he nice part of this is that it would solve the current issue that makes = src_ not always usable, namely unmatched curly braces: #+PROPERTY: header-args :exports code src_elisp{(defun foo () ?})} =E2=87=92 (defun foo () ?)} #+PROPERTY: header-args :exports code src_elisp{(defun foo () ?\})} is an ELisp function =E2=87=92 (defun foo () ?\}) --------------F515120921AAC2A48AC05AE5 Content-Type: text/x-diff; name="0001-Add-zero-width-spaces-to-org-emphasis-regexp-compone.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Add-zero-width-spaces-to-org-emphasis-regexp-compone.pa"; filename*1="tch" =46rom 8ac4260f312c5ddfc0c350ba30285dd0efde471d Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Cl=3DC3=3DA9ment=3D20Pit--Claudel?=3D 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 eleme= nts: ;; 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('\"{=E2=80=8B=E2=81=A0" "- \t.,:!?;'\")}\\[=E2=80=8B=E2=81=A0" = " \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 ch= aracter. Don't use non-shy groups here, and don't allow newline here. newline The maximum number of newlines allowed in an emphasis exp. =20 -You need to reload Org or to restart Emacs after customizing this.") +The default for both pre and post includes zero-width spaces (=E2=80=8B)= +and word joiners (=E2=81=A0, aka zero-width no-break space). You need t= o +reload Org or to restart Emacs after customizing this variable.") =20 (defcustom org-emphasis-alist '(("*" bold) --=20 2.7.4 --------------F515120921AAC2A48AC05AE5-- --gnjJdqfDFSN5Xk9s0Uoqv3jtmVjK7iUja-- --iwbke51BpdW03pt5dDVrVCQsTFi8GoDT4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXxbYYAAoJEPqg+cTm90wjzU0P/37F+xKJoZycQdLRW6SkzTbl dhwIaKy1YFTLTeVLI5MyGEYruY5Ohq6i0f4dQZT2LsHWnyn9S+yaSe6t//kA2dqN MVzXBCdyfkU4HooZQpiI6JUXTePslC4IZLPwY27D1dwJnPINP4jsnUQ6n8hD7vzo s9CxBynR8RyKuE+/YA/A5RVA5mkS4wWC4o9YfzN3KlETu5XWB7/YoJGDvnyTj0dp EjBy4pR5Lctb/gim56dubPbWi1rBscZGHXaMci3BS6icWBzYA6R9WsPInD6Sojlb 6iVXXf/nrvqec3LYqmAYWcCl3RAS42+qgYxobjZRIyu3/wJXnPJvtZp+KvCz4942 J9b0HFONH0q2+aiBOqv6sg2JlOyGS+1wTSg6Ybf0es2T/6TqD0R4CZoxsmJAvwP9 TEZq3V3cbG1hI/n4SxdQ8SsVtDQVJdmEnRCzTijM02g+s3lUzhTA5P7CIfCt+iiq iF/9sLoHONAvKDOvWI2nCsCvvAmkIkOl0stpzBS/SEsv6NhrWvxyPfR1wLjCXmnN s5Y1uu2Oqzp0wfNoPlBh6435gwtGupz7za6WEA3YxPNvbOJKpv5OAyzVhWMhlWD0 4Sz4nrT4JQA6HUnghTPgoyxU8PdiOx/9ryOggyT0KqhQtp8bJdzVoo5EFPHf7Afw FGD9rWNAVB8RHCn0v8fg =8bjV -----END PGP SIGNATURE----- --iwbke51BpdW03pt5dDVrVCQsTFi8GoDT4--