emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Prettier (or at least fancier) code block delimiters


From: Eric Schulte
Subject: [O] Prettier (or at least fancier) code block delimiters
Date: Tue, 21 Jan 2014 13:31:29 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi,

I tried the following on a lark not thinking I'd like it.  However,
after a week or two I've yet to turn it off and I think it makes my code
block heavy Org-mode buffers somewhat more readable, so I'm sharing it
here.

    ;; -*- emacs-lisp -*-
    (defun prettier-org-code-blocks ()
      (interactive)
      (font-lock-add-keywords nil
        '(("\\(\+begin_src\\)"
           (0 (progn (compose-region (match-beginning 1) (match-end 1) ?¦)
                     nil)))
          ("\\(\+end_src\\)"
           (0 (progn (compose-region (match-beginning 1) (match-end 1) ?¦)
                     nil))))))
    (add-hook 'org-mode-hook 'prettier-org-code-blocks)

Add it to your config or evaluate in your scratch buffer, then open a
new Org-mode file with code blocks to give it a try.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



reply via email to

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