From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] How to fontify blocks other than begin_src? Date: Fri, 07 Jan 2011 11:46:33 -0700 Message-ID: <8762u0y2av.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=59436 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbHQ8-00027w-Fi for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 13:52:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbHQ7-0006V4-G9 for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 13:52:16 -0500 Received: from mail-yi0-f41.google.com ([209.85.218.41]:59119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbHQ7-0006Ut-BH for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 13:52:15 -0500 Received: by yia25 with SMTP id 25so5222776yia.0 for ; Fri, 07 Jan 2011 10:52:14 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Seth Burleigh Cc: emacs-orgmode@gnu.org Hi Seth, The easiest way to fontify embedded html is most likely to wrap the html in "#+begin_src html" code blocks. As for defining your own clojure blocks that sounds like a risky proposition to me. All of the code block evaluation functions are built to use standard org-mode syntax for code blocks, e.g. "#+begin_src lang". That said you can easily use clj as an alias for clojure in your code blocks, use the following elisp code to add this alias to org-src-lang-modes #+begin_src emacs-lisp (add-to-list 'org-src-lang-modes '("clj" . clojure)) #+end_src Once that is done you will notice clj blocks like the one below are fontified. Also, after pulling the latest version of Org-mode (I just made a small change to make this possible), it is also possible to evaluate "#+begin_src clj" blocks as though they were regular "clojure" blocks. #+begin_src clj (map (partial + 1) (range 20)) #+end_src Hope this helps -- Eric Seth Burleigh writes: > I would like blocks like begin_html/end_html to be fontified just like > begin_src blocks are. > I would also like to define my own source blocks for clojure (basically a > shorthand) and also have them highlighted. Heres what i have to turn on > fontifying and define a block. > > (setq org-src-fontify-natively t) > ;; define #+clj as start of clojure code block and #+end as end of block > (add-to-list 'org-edit-src-region-extra > '("^[ \t]*#\\+clj.*\n" "\n[ \t]*#\\+end" "clojure")) > > Ive also noticed that the code block (#+clj ... #+end) doesnt fold - > however, if i define the block as begin_clj and end_clj it will fold, so im > guessing org assumes a certain block format for folding code. > > Any way to do the above two things? > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode