unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Font lock in org+elisp confused with ?\[
@ 2021-04-01  5:43 Tom Gillespie
  2021-04-01  7:18 ` Arthur Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Gillespie @ 2021-04-01  5:43 UTC (permalink / raw)
  To: arthur.miller, emacs-devel

This is a known issue with org babel blocks. It is due to the fact
that org babel translates the font locking for the language but not
the syntax propertization. Another frequent cause is the bash case
statement. The end result is that unmatched parens leak out from the
babel blocks and wreak havoc elsewhere in the org file unless you
balance out the parens e.g. in a comment. I have a hacked fix for
this, but it has horrible performance, especially with line numbers
enabled. I think that a proper solution would run arbitrary syntax
propertization on subsets of a buffer without having to continually
check where those subsets start or end. Best,
Tom



^ permalink raw reply	[flat|nested] 9+ messages in thread
* Font lock in org+elisp confused with ?\[
@ 2021-04-01  4:42 Arthur Miller
  2021-04-02  4:23 ` Tim Cross
  0 siblings, 1 reply; 9+ messages in thread
From: Arthur Miller @ 2021-04-01  4:42 UTC (permalink / raw)
  To: emacs-devel


Is it me or is it a bug?

When in org mode in an elisp block, this seems to confuse syntax
checker:

#+begin_src emacs-lisp
(progn
  (if (= (following-char) ?\])
      (forward-char -1))
  )
#+end_src

Identation seems to think it is one level extra, and it also shows as
error. Same of course when testing for ?\[.

It does evaluate correctly. Ordinary elisp buffer does not have problem
with this, only when in code blocks in org-mode or elisp mode.I can send
in some screenshot with errors if needed.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-03 18:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01  5:43 Font lock in org+elisp confused with ?\[ Tom Gillespie
2021-04-01  7:18 ` Arthur Miller
2021-04-01  9:04   ` tomas
2021-04-01 15:44     ` Arthur Miller
  -- strict thread matches above, loose matches on Subject: below --
2021-04-01  4:42 Arthur Miller
2021-04-02  4:23 ` Tim Cross
2021-04-02 13:03   ` John Kitchin
2021-04-02 22:59     ` Tom Gillespie
2021-04-03 18:38     ` Arthur Miller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).