.emacs-my
changeset 1559 9f4456fcac0e
parent 1558 a7bb0608855b
child 1560 10e5b207ec7d
equal deleted inserted replaced
1558:a7bb0608855b 1559:9f4456fcac0e
  3500 (add-to-list 'auto-mode-alist '("\.atom\\'" . nxml-mode))
  3500 (add-to-list 'auto-mode-alist '("\.atom\\'" . nxml-mode))
  3501 
  3501 
  3502 (my--eval-after-load nxml-mode
  3502 (my--eval-after-load nxml-mode
  3503   (define-key nxml-mode-map [C-return] 'nxml-complete))
  3503   (define-key nxml-mode-map [C-return] 'nxml-complete))
  3504 
  3504 
       
  3505 (defun my-nxml-pp ()
       
  3506   "Pretty-print XML."
       
  3507   (interactive)
       
  3508   (goto-char (point-min))
       
  3509   (while (re-search-forward ">[ \t\n\r]+<" nil t)
       
  3510     (replace-match ">\n<"))
       
  3511   (while (re-search-forward "><" nil t)
       
  3512     (replace-match ">\n<"))
       
  3513   (indent-region (point-min) (point-max))
       
  3514   (goto-char (point-min)))
       
  3515 
  3505 (defun my-nxml-where (&optional prefix)
  3516 (defun my-nxml-where (&optional prefix)
  3506   "Display the hierarchy of XML elements the point is on as a path."
  3517   "Display the hierarchy of XML elements the point is on as a path."
  3507   (interactive "P")
  3518   (interactive "P")
  3508   (let (path)
  3519   (let (path)
  3509     (save-excursion
  3520     (save-excursion