emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: Org emphasis markers inside src blocks causes incorrect fontification
Date: Thu, 16 Nov 2017 20:08:20 +0000	[thread overview]
Message-ID: <CAFyQvY0mtxu3gnB8+622Q7GKxeKGWWVHM_ebKPxunS+mxJ3aSA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

Hello,

I increase the number of consecutive lines to be parsed for Org emphasis to
20 lines using:

=====
 (setcar (nthcdr 4 org-emphasis-regexp-components) 20) ;Up to 20 lines,
 (org-set-emph-re 'org-emphasis-regexp-components
org-emphasis-regexp-components)
=====

With that set, I see that equal signs in source blocks falsely trigger the
org-verbatim fontification. And I see this[1]. Notice the fontification in
the attached image (link at bottom of this email).. The equal signs in the
first src block initiate the org-verbatim fontification and that goes on
till the equal signs in the next code block.. so Heading 2 shows up in
org-verbatim face.

Here is the test file:

=====
* Heading 1
#+BEGIN_SRC nim
let foo = 0
doAssert foo == 0
#+END_SRC
** Heading 2
#+BEGIN_SRC nim
let bar = 0
doAssert bar == 0
#+END_SRC
=====

Shouldn't the presence of org emphasis markers be ignored when inside src
blocks?

Org mode version 9.1.2 (release_9.1.2-202-g04e053 @
/home/kmodi/usr_local/apps/6/emacs/emacs-26/share/emacs/site-lisp/org/)

I don't see this issue (or rather that issue is masked) if I evaluate:

=====
 (setcar (nthcdr 4 org-emphasis-regexp-components) 1) ;Back to default
 (org-set-emph-re 'org-emphasis-regexp-components
org-emphasis-regexp-components)
=====

[1]: https://i.imgur.com/6TmUoTS.png
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2106 bytes --]

             reply	other threads:[~2017-11-16 20:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 20:08 Kaushal Modi [this message]
2017-11-16 21:47 ` Org emphasis markers inside src blocks causes incorrect fontification Nicolas Goaziou
2017-11-16 21:56   ` Kaushal Modi
2017-11-17 23:30     ` Nicolas Goaziou
2017-11-20 17:34       ` Kaushal Modi
2017-11-25 14:42         ` Nicolas Goaziou

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=CAFyQvY0mtxu3gnB8+622Q7GKxeKGWWVHM_ebKPxunS+mxJ3aSA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).