Skip to content

Instantly share code, notes, and snippets.

@razzius
Created December 4, 2023 16:48
Show Gist options
  • Save razzius/088beecff832961a7975a26d6425a11e to your computer and use it in GitHub Desktop.
Save razzius/088beecff832961a7975a26d6425a11e to your computer and use it in GitHub Desktop.
razzi-associate-extension-mode.el
(defun razzi-associate-extension-mode (extension mode)
"Associate a file extension with an editing mode.
For example, (razzi-associate-extension-mode \"js\" 'javascript-mode)"
(let ((pattern (concat "\\." extension "$")))
(add-to-list 'auto-mode-alist (cons pattern mode))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment