From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bowen Li Subject: My attempt of org babel inline src block highlighting Date: Wed, 18 Dec 2013 16:13:49 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2c736f6ba9804edca9f36 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtCGN-00084p-OZ for emacs-orgmode@gnu.org; Wed, 18 Dec 2013 03:13:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtCGM-00043Y-Eu for emacs-orgmode@gnu.org; Wed, 18 Dec 2013 03:13:51 -0500 Received: from mail-qc0-x22d.google.com ([2607:f8b0:400d:c01::22d]:42536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtCGM-00043T-BS for emacs-orgmode@gnu.org; Wed, 18 Dec 2013 03:13:50 -0500 Received: by mail-qc0-f173.google.com with SMTP id m20so5744555qcx.4 for ; Wed, 18 Dec 2013 00:13:49 -0800 (PST) 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: emacs-orgmode@gnu.org --001a11c2c736f6ba9804edca9f36 Content-Type: text/plain; charset=ISO-8859-1 Hi, I just naively modified org-fontify-drawers to fontify org babel inline src block. The result looks reasonable to me. I put these two functions in a src block in my org file and executed it, then refreshed display with M-x org-mode. (defun org-fontify-inline-src-block (limit) "Fontify inline source block." (when (re-search-forward org-babel-inline-src-block-regexp limit t) (add-text-properties *(match-beginning 1*) (match-end 0) '(font-lock-fontified t face (t (:foreground "#008ED1" :background "#FFFFEA")))) (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) t)) (defun org-set-font-lock-defaults () ...... ;; Drawers '(org-fontify-drawers) * ;; Inline source block* * '(org-fontify-inline-src-block)* Cheers, Bowen --001a11c2c736f6ba9804edca9f36 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I just naively modified=A0org-fonti= fy-drawers to fontify org babel inline src block. The result looks reasonab= le to me. I put these two functions in a src block in my org file and execu= ted it, then refreshed display with M-x org-mode.


(defun org-fontify-inline-src-block= (limit)
=A0 "Fontify inline source block."
= =A0 (when (re-search-forward org-babel-inline-src-block-regexp limit t)
=A0 =A0 (add-text-properties
=A0 =A0 =A0(match-beginning = 1) (match-end 0)
=A0 =A0 =A0'(font-lock-fontified t face = (t (:foreground "#008ED1" :background "#FFFFEA"))))
=A0 =A0 (org-remove-flyspell-overlays-in (match-beginning 0) (match-= end 0))
=A0 =A0 t))

(defun org-set-font-lo= ck-defaults ()
......
=A0 ;; Drawers
=A0 '(org-fontify-drawers)
=A0 ;; Inline s= ource block
=A0 '(org-fontify-inline-src-block)

Cheers,
Bowen
--001a11c2c736f6ba9804edca9f36--