emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] My attempt of org babel inline src block highlighting


From: Bowen Li
Subject: [O] My attempt of org babel inline src block highlighting
Date: Wed, 18 Dec 2013 16:13:49 +0800

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]