From: Takafumi Arakaki <aka.tkf@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Use font-lock-face property in org-src-font-lock-fontify-block?
Date: Thu, 27 Sep 2012 12:55:29 +0200 [thread overview]
Message-ID: <CAPM+gBRgUKBPH0fTE8S0qhv+UXzy90XPagC1BiHcFD+RP3FoEA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]
Hi,
I am trying to use org-src.el bundled in org-mode to support syntax
highlighgint for multiple languages in my IPython notebook client in
Emacs (EIN) [1]. It works very well but I need to patch (please see the
attached file) it to use. The problem is that fontification is gone when I
edit the buffer. I found that I can workaround this problem by
putting font-lock-face property instead of face property.
When the fontification vanishes,
(text-properties-at (point))
returns
(font-lock-fontified t fontified t)
Before the fontification vanishes (before inserting a cell),
(text-properties-at (point))
returns this at the same point:
(font-lock-multiline t face font-lock-keyword-face
font-lock-fontified t fontified t)
I couldn't reproduce this problem outside of EIN (in org-mode or
other plain buffers).
I am thinking about including my version of
org-src-font-lock-fontify-block in EIN, but Dan Davison suggested to
ask in this ML because it could be a problem in org-mode too.
Does anyone know what is happening here? Could this happen in
org-mode too?
See [2] for the original discussion.
[1] https://github.com/tkf/emacs-ipython-notebook/
[2] https://github.com/tkf/emacs-ipython-notebook/issues/2
[-- Attachment #2: org-src.patch --]
[-- Type: application/octet-stream, Size: 548 bytes --]
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 496dafe..1e3a1d8 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -796,7 +796,7 @@ fontification of code blocks see `org-src-fontify-block' and
(setq pos (point-min))
(while (setq next (next-single-property-change pos 'face))
(put-text-property
- (+ start (1- pos)) (+ start next) 'face
+ (+ start (1- pos)) (+ start next) 'font-lock-face
(get-text-property pos 'face) org-buffer)
(setq pos next)))
(add-text-properties
next reply other threads:[~2012-09-27 10:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 10:55 Takafumi Arakaki [this message]
2012-09-28 6:53 ` [PATCH] Use font-lock-face property in org-src-font-lock-fontify-block? Bastien
2012-09-28 10:24 ` Takafumi Arakaki
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPM+gBRgUKBPH0fTE8S0qhv+UXzy90XPagC1BiHcFD+RP3FoEA@mail.gmail.com \
--to=aka.tkf@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.