emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* My attempt of org babel inline src block highlighting
@ 2013-12-18  8:13 Bowen Li
  2013-12-18  9:49 ` Sebastien Vauban
  0 siblings, 1 reply; 2+ messages in thread
From: Bowen Li @ 2013-12-18  8:13 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1323 bytes --]

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

* Re: My attempt of org babel inline src block highlighting
  2013-12-18  8:13 My attempt of org babel inline src block highlighting Bowen Li
@ 2013-12-18  9:49 ` Sebastien Vauban
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2013-12-18  9:49 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Bowen Li wrote:
> 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)*

I may have missed obvious things, but I don't understand which problem
you are trying to resolve. Could you elaborate, please?

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2013-12-18  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18  8:13 My attempt of org babel inline src block highlighting Bowen Li
2013-12-18  9:49 ` Sebastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).