I found this SO post: https://stackoverflow.com/questions/944614/emacs-does-hideshow-work-with-xml-mode-sgml-mode
Does the functionality already exist to reformat this buffer to be somewhat user-readable?
Of course, and you have plenty of options. I'd probably feed it to an external program using:
C-x h C-u M-| xmllint --format - RET
This program comes with libxml2. You could also use tidy. Here's a list of commandline xml formatting tools: https://stackoverflow.com/...
The built-in sgml-mode has a command to do this: sgml-pretty-print. If you're in nxml-mode it looks like you need switch to sgml-mode first. You could write a command to temporarily switch to sgml-mode, run pretty-print, then switch back to nxml-mode.
For example, here is a command that will pretty-print the region, optionally with auto-fill enabled:
write this into your ~/.emacs.d/init.el:
(defun ninrod/reformat-xml ()
(sgml-pretty-print (point-min) (point-max))
(indent-region (point-min) (point-max))))
reload emacs, then just call M-x reformat-xml on the badly formatted xml buffer.
Try the command sgml-pretty-print from sgml-mode. This operates on the region, so you could mark the buffer first:
Or maybe define a command :
(defun my-xml-pretty-print ()
(unless (featurep 'sgml-mode) (require 'sgml-mode))
(sgml-pretty-print (point-min) (point-max)))
Install nxml-mode and which-function-mode. Take the nxml-where function from here and add it to your .emacs file followed by:
(defun xml-find-file-hook ()
(when (derived-mode-p 'nxml-mode)
(setq which-func-mode t)
(add-hook 'which-func-functions 'nxml-where t t)))
(add-hook 'find-file-hook 'xml-find-file-hook t)
The answer is that you can't use Emacs as a Feedly client, or at least not without regenerating a developer key every three months. I received the same information as the folks at Feednix.
There are two possible alternate solutions, neither of which I've yet tested:
Use rss2email and have it send the articles from your list of RSS feeds to an email account ...
You'll probably like to either disable auto-image-file-mode or tweak image-file-name-extensions.
BTW, if Emacs crashes or hangs for a particular SVG file, I suggest you M-x report-emacs-bug about it. Maybe there's not much Emacs's code can do about it (e.g. the problem is in the SVG rendering livbrary), but it might be a good reason to change the default ...
If you use evil-mode, you can install https://github.com/redguardtoo/evil-matchit and press %
If you prefer original Emacs,
(autoload 'sgml-skip-tag-backward "sgml-mode" nil t)
(autoload 'sgml-skip-tag-forward "sgml-mode" nil t)
(defun html-get-tag ()
(let ((b (line-beginning-position))
You can close an XML block in nXML-mode via
To find such functions, have a look at the mode's description, accessible via C-h m when in nXML-mode. It says
C-c / finishes the current element by inserting an end-tag.
Two options I'm aware of:
mmm-mode is a minor mode for Emacs that allows Multiple Major Modes
to coexist in one buffer. It is well-suited to editing:
Preprocessed code, such as server-side Ruby, Perl or PHP embedded in HTML
Code generating code, such as HTML output by CGI scripts
Literate programming: code ...
You can use xml.el to handle XML data. The following function should provide you with the class names you are looking for:
(defun activity-from-manifest (manifest)
(mapcar (lambda (node)
(let ((name (xml-get-attribute-or-nil node 'android:name)))
I have a solution that does 2 things:
Attempt to open any XML file in nXML mode, and this obviously needs to include SVG files.
If such a file is an SVG file, then define C-c C-c to image-mode.
For the first item, I use magic-mode-alist to select nxml-mode on some sequences at the beginning of the buffer: <?xml, some DOCTYPE line with XHTML, and <svg ...
See nxml-mode, option nxml-sexp-element-flag, and movement commands such as nxml-forward-balanced-item, nxml-forward-element, and nxml-up-element.
If you use library Icicles then you can use Icicles search commands icicle-search-xml-element and icicle-search-xml-element-text-node for navigating among and within XML elements.
(Non-nil option icicle-ignore-...
Turns out the hardest part has to be done outside Emacs.
Install auto-complete and auto-complete-nxml from MELPA (easy).
Note: don't use genrnc from MELPA 'cause it does not fit the bill...
Ensure that xsltproc is installed on the system (easy for Linux/Unix/OSX users).
Add the following customization into the user's ~/.emacs file (easy):
You need to add this hook:
(add-hook 'nxml-mode-hook 'hs-minor-mode)
After that put this in your init.el file or somewhere it'll be loaded.
(define-key nxml-mode-map (kbd "C-c h") 'hs-toggle-hiding)
If you now press C-c h it will fold the xml at the element where your cursor is.