From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Minshall Subject: Re: non-space, paste, (???) character for inline results Date: Thu, 01 Feb 2018 11:53:58 +0530 Message-ID: <29086.1517466238@minshall-apollo.minshall.org> References: <87607hzyq1.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh8I0-00029O-SS for emacs-orgmode@gnu.org; Thu, 01 Feb 2018 01:24:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh8Hx-0004WA-LM for emacs-orgmode@gnu.org; Thu, 01 Feb 2018 01:24:04 -0500 Received: from relay01.pair.com ([209.68.5.15]:34503) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eh8Hx-0004Vs-EA for emacs-orgmode@gnu.org; Thu, 01 Feb 2018 01:24:01 -0500 In-reply-to: Your message of "Wed\, 31 Jan 2018 19\:09\:58 +0100." <87607hzyq1.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: Org Mode List , Kaushal Modi --=-=-= Content-Type: text/plain Nico, > At some point, someone will want to write foo#call_bar() without > #call_bar() being replaced, and we will go back to point 0. IMO, > zero-width space is the way to go, if only because it can already be > used to escape other special characters in Org. oof, of course! color me convinced! one concern: if i essentially "revert" the changes in 7efa0f2879226695ad9b309c9263a4d1b5d79e89, call_ and src_ all work, but i get the ZERO WIDTH SPACE (ZSWP, \u200b) propagated into the resulting output file (.html, .tex). it doesn't seem to do any "harm", but, i find it disquieting (being an ASCII-type by birth, if not by current usage). the below patch, basically my #-paste patch turned into a \u200b-paste patch, gets rid of the ZWSP in the output file in the case of \u200bcall_, \u200bsrc_ (**), but, leaves it for all other uses, i.e., \u200b=fubar=. this inconsistency i *also* find disquieting, sigh; i can imagine the great-regexp in the sky in org-element.el could get rid of all these prefixing ZWSPs, but i'd not proceed in this direction without (policy, at least) direction. cheers, Greg (**) btw, if one wants \u200b<> in the output, one prefixes CALL_FOO() with *two* ZWSPs. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-use-ZERO-WIDTH-SPACE-as-a-separator-for-call_-src_.patch >From df94d943d085947212d96eddec9870d7dca0ea23 Mon Sep 17 00:00:00 2001 From: Greg Minshall Date: Thu, 1 Feb 2018 11:32:59 +0530 Subject: [PATCH] use ZERO WIDTH SPACE as a separator for call_, src_ (but, don't leave around in output) --- lisp/org-element.el | 15 +++++++++------ testing/lisp/test-ob-exp.el | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 5af2d6e..f550b89 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -161,8 +161,9 @@ specially in `org-element--object-lex'.") ;; entity, latex fragment. "\\\\\\(?:[a-zA-Z[(]\\|\\\\[ \t]*$\\|_ +\\)" ;; Objects starting with raw text: inline Babel - ;; source block, inline Babel call. - "\\(?:call\\|src\\)_")) + ;; source block, inline Babel call. possibly + ;; prefixed with ZERO WIDTH SPACE + "\u200b?\\(?:call\\|src\\)_")) "\\|"))) (org-element--set-regexps) @@ -2878,7 +2879,7 @@ Assume point is at the beginning of the babel call." (save-excursion (catch :no-object (when (let ((case-fold-search nil)) - (looking-at "call_\\([^ \t\n[(]+\\)[([]")) + (looking-at "\u200b?\\