Loading ...
Sorry, an error occurred while loading the content.

369Folding for nxml-mode

Expand Messages
  • Joe Casadonte
    Dec 3, 2003
      I tried using outline mode to fold blocks, as someone posted earlier,
      but had no luck with it. Here's something quick and (very) dirty that
      I whipped together using hideshow mode:

      (defun my-nxml-mode-hook ()
      "Functions to run when in nxml mode."
      (setq nxml-sexp-element-flag t)
      (hs-minor-mode 1))

      (add-hook 'nxml-mode-hook 'my-nxml-mode-hook)

      (eval-after-load "hideshow.el"
      (let ((nxml-mode-hs-info '(nxml-mode ("^\\s-*\\(<[^/].*>\\)\\s-*$" 1) "^\\s-*</.*>\\s-*$")))
      (when (not (member nxml-mode-hs-info hs-special-modes-alist))
      (setq hs-special-modes-alist
      (cons nxml-mode-hs-info hs-special-modes-alist)))))

      If anyone comes up with a better set of regexps, please post them!


      Joe Casadonte

      Llama Fresh Farms => http://www.northbound-train.com
      Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
      Perl for Win32 => http://www.northbound-train.com/perlwin32.html
      Emacs Stuff => http://www.northbound-train.com/emacs.html
      Music CD Trading => http://www.northbound-train.com/cdr.html
      Live Free, that's the message!