Permalink
Browse files

new language init files

  • Loading branch information...
1 parent b9d5f78 commit e3196d646aacc45047a6e41517b299cea6b080c1 Eric Schwartz committed Dec 27, 2012
Showing with 20 additions and 0 deletions.
  1. +6 −0 init.d/lisp.el
  2. +14 −0 init.d/xml.el
View
@@ -0,0 +1,6 @@
+(add-hook 'lisp-mode-hook
+ (lambda ()
+ (run-hooks 'ems-code-modes-hook)))
+(add-hook 'emacs-lisp-mode-hook
+ (lambda ()
+ (run-hooks 'ems-code-modes-hook)))
View
@@ -0,0 +1,14 @@
+(defun bf-pretty-print-xml-region (begin end)
+ "Pretty format XML markup in region. You need to have nxml-mode
+http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do
+this. The function inserts linebreaks to separate tags that have
+nothing but whitespace between them. It then indents the markup
+by using nxml's indentation rules."
+ (interactive "r")
+ (save-excursion
+ (nxml-mode)
+ (goto-char begin)
+ (while (search-forward-regexp "\>[ \\t]*\<" nil t)
+ (backward-char) (insert "\n"))
+ (indent-region begin end))
+ (message "Ah, much better!"))

0 comments on commit e3196d6

Please sign in to comment.