From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reuben Thomas Subject: Bug: Please make org-emphasis-regexp-components respect all whitespace [9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.d/elpa/org-20170904/)] Date: Thu, 14 Sep 2017 20:59:01 +0100 Message-ID: <87lglh9hmi.fsf@sc3d.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsaHy-0003w8-9y for emacs-orgmode@gnu.org; Thu, 14 Sep 2017 15:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsaHx-0004mN-7h for emacs-orgmode@gnu.org; Thu, 14 Sep 2017 15:59:06 -0400 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:49466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dsaHw-0004kw-WF for emacs-orgmode@gnu.org; Thu, 14 Sep 2017 15:59:05 -0400 Received: by mail-wr0-x22e.google.com with SMTP id u96so284208wrb.6 for ; Thu, 14 Sep 2017 12:59:04 -0700 (PDT) Received: from skwd ([2a02:c7d:51cb:c700:41ea:a973:5cb1:6687]) by smtp.gmail.com with ESMTPSA id c1sm10654126wre.84.2017.09.14.12.59.01 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Sep 2017 12:59:01 -0700 (PDT) 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 Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ I tried writing: ~get~/~set~ methods Fair enough, this renders as all verbatim, according to the parsing rules. So, I tried adding zero-width spaces around the slash. Same result. org-emphasis-regexp-components indeed does not consider all whitespace, just some. So, I tried adding [:space:] to the PRE and POST patterns, and now it works. I currently have in my Emacs init: (setq org-emphasis-regexp-components ;; define before loading org '("[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]\r\n" "." 1)) In other words, I added [:space:] to the BORDER pattern too. It would seem reasonable to have something like this be the default. In particular, worg/dev/org-syntax.org already talks about =E2=80=9Cwhitespace= =E2=80=9D, not specifically =E2=80=9Cspaces, tabs etc.=E2=80=9D. But, I wonder, is it a problem that [:space:] contains vertical whitespace characters too? (I left =E2=80=9C\r\n=E2=80=9D in the BORDER pat= tern as a reminder that they are there on purpose, whereas PRE and POST previously contained only space and tab, i.e. horizontal whitespace.) On the other hand, since PRE and POST are anchored to the start and end of a line, and the number of newlines is by default limited to 1, perhaps it=E2=80=99s= not a problem? In any case, it would be nice to have a natural solution to the problem of emphasis delimiters in this sort of situation. Simply taking advantage of Unicode characters such as zero-width space seems simpler than complicating the parser (and it=E2=80=99s also increasingly obvious to users as they get used to the power of Unicode, and is the sort of trick that works with lots of different systems, not just Org). Emacs : GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-09-12 Package: Org mode version 9.0.10 (9.0.10-5-g1654a5-elpa @ /home/rrt/.emacs.= d/elpa/org-20170904/) --=20 https://rrt.sc3d.org/