emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Prettier (or at least fancier) code block delimiters
@ 2014-01-21 20:31 Eric Schulte
  0 siblings, 0 replies; only message in thread
From: Eric Schulte @ 2014-01-21 20:31 UTC (permalink / raw)
  To: Org Mode Mailing List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-21 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 20:31 Prettier (or at least fancier) code block delimiters Eric Schulte

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).