From: Bastien <bzg@gnu.org>
To: Oleh <ohwoeowho@gmail.com>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: Make ,* show up as * in babel blocks
Date: Fri, 03 Jan 2014 16:52:39 +0100 [thread overview]
Message-ID: <87fvp5awqg.fsf@bzg.ath.cx> (raw)
In-Reply-To: <CAA01p3o9j4WnYkVbhpVAkLNCxrYK1AX7iKo1omOCnWGTso3PvA@mail.gmail.com> (Oleh's message of "Mon, 23 Dec 2013 22:12:52 +0100")
Hi Oleh,
Oleh <ohwoeowho@gmail.com> 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
prev parent reply other threads:[~2014-01-03 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 21:12 Make ,* show up as * in babel blocks Oleh
2014-01-03 15:52 ` Bastien [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fvp5awqg.fsf@bzg.ath.cx \
--to=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=ohwoeowho@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).