Posts about lisp

Pretty-printing XML with Emacs' NXML-mode

Did you ever get a stream of XML out of a log file, or in a data stream, and it's all mashed together without line-breaks so that it just appears as gobble-de-gook? If there's a data error (not an XML parsing error) then you have to read it so that you can find where the error is, but you don't have XML-spy and NetBeans is overkill or takes forever to fire up...

Emacs to the rescue! Benjamin Ferrari wrote this increadibly useful (and simple) elisp function to pretty-print a block of XML code:

Read more…

Essentials to make Windows almost bareable

Okay, so I hate working in Windows, but on my employer's equipment at least, I must live with it. After having had this machine replaced twice (faulty Dell hardware) and rebuilt more times than I can remember (Windows BSODs), for a total of at least 3 system migrations this past year, I thought I'd better keep a list of what free software to install on top of Windows, and what adjustments to make, so that at least I don't feel like I'm wearing a straight jacket. Here goes:

Read more…

jEdit macros, vs. Emacs functions

I've been playing with customising jEdit a little bit, and decided to have a go at writing some simple date insertion macros. These perform the same work as some old elisp functions I wrote years ago in Emacs, to insert date/time stamps in various formats. In my .emacs file, I bind these functions to short-cut keys, and then use them for updating Changelogs in code and in offline journal entries.

Read more…