all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Use font-lock-face property in org-src-font-lock-fontify-block?
@ 2012-09-27 10:55 Takafumi Arakaki
  2012-09-28  6:53 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Takafumi Arakaki @ 2012-09-27 10:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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

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

end of thread, other threads:[~2012-09-28 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 10:55 [PATCH] Use font-lock-face property in org-src-font-lock-fontify-block? Takafumi Arakaki
2012-09-28  6:53 ` Bastien
2012-09-28 10:24   ` Takafumi Arakaki

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.