From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Make ,* show up as * in babel blocks Date: Fri, 03 Jan 2014 16:52:39 +0100 Message-ID: <87fvp5awqg.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz73J-0002Z5-Sn for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 10:52:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz73E-0003Kr-6M for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 10:52:49 -0500 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:57578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz73D-0003Kj-Up for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 10:52:44 -0500 Received: by mail-wg0-f49.google.com with SMTP id x12so13410667wgg.28 for ; Fri, 03 Jan 2014 07:52:43 -0800 (PST) In-Reply-To: (Oleh's message of "Mon, 23 Dec 2013 22:12:52 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: org mode Hi Oleh, Oleh writes: > When a line of babel source code starts with leading star > (also some other characters, see `org-unescape-code-in-string') > org-mode auto-escapes it with a comma. > I assume that there's no easy way not to add the comma. > But I think it should be possible to fontify it as if it's not there. > > This comma is auto-removed for purposes of evaluation > or when switching to native mode to edit a source block. > > The issue is that it's not removed when viewing the org-file. > > Small example to illustrate: J souce "*/ 2 2" displays as > > #+begin_src J > ,*/ 2 2 > #+end_src > > I've found a work around: > > (defvar keyword-comma-star > '(("^\\(,\\*\\)" (1 (prog1 () > (compose-region (match-beginning 1) > (match-end 1) > ?*)))))) > (font-lock-add-keywords 'org-mode keyword-comma-star) I think it's a good candidate for http://orgmode.org/worg/org-hacks.html but the default should be to display the comma so that users know it's here. 2 cents, -- Bastien