Lesser known functionalities in core Emacs

submited by
Style Pass
2021-06-15 23:00:16

While reading EmacsWiki or browsing the Emacs Source Code itself, one often encounters libraries and packages that are unrightfully underappreciated.

This command can easily be confused with abbrev or yasnippet. But both of these are meant expand abbrevations (e.g. “lag” to “ladies and gentlemen”) or interactive snippets (e.g. “err” to an error handling block in Go).

Auto-insert is instead intended to be used when a new file is created: Create an empty HTML buffer, and then run M-x auto-insert – after querying the title a skeleton of a HTML file is generated.

All in all, it is a useful mode, especially for well structured file formats that might be hard to memorize. The main reason I think auto-insert is not talked about that much is that not that many major modes are supported out-of-the-box. The user option auto-insert-alist, that defines the behaviour for a file type only has 13 entries, for these file types:

Adding support for more modes, both for modes in Emacs itself and third-party code would probably help to make this more useful.

Leave a Comment