From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Org-mode Babel does not show syntax highlight when open with another mode Date: Sat, 17 Oct 2015 03:30:42 -0400 Message-ID: <87r3ku9ckd.fsf@kyleam.com> References: <87k2r1l627.fsf@gmail.com> <87io6ll5lw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnLx6-0000wj-6k for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 03:30:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnLx1-0007wH-6S for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 03:30:52 -0400 Received: from mail-qg0-f44.google.com ([209.85.192.44]:33340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnLx1-0007w9-39 for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 03:30:47 -0400 Received: by qgeo38 with SMTP id o38so74916306qge.0 for ; Sat, 17 Oct 2015 00:30:46 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: stardiviner Cc: Org-Mode stardiviner writes: > I try to configure Org-mode to open ruby source code block with `enh-ruby-mode`. > > configuration as following: > > #+BEGIN_SRC emacs-lisp > (with-eval-after-load 'enh-ruby-mode > (add-to-list 'org-src-lang-modes '("ruby" . enh-ruby))) > #+END_SRC > > This will open code block in `enh-ruby-mode` when you edit with [C-c ']. > > You can see the syntax highlighting failed result screenshot at here: > > http://emacs.stackexchange.com/questions/17042/org-mode-babel-failed-syntax-highlight-after-change-org-src-lang-modes > > I hope to keep the syntax highlight, (If can use enh-ruby-mode syntax highlight > will be better). Sorry for the delayed response. It seems the problem is that enh-ruby-mode highlights its buffers in a way that doesn't respond to font-lock-fontify-buffer, which org-src-font-lock-fontify-block calls in the buffer " org-src-fontification:enh-ruby-mode" to get the faces. -- Kyle