Emacs: Xah Emacs Lisp Mode
xah-elisp-mode is a major mode for emacs lisp.
Download here: https://github.com/xahlee/xah-elisp-mode
For any problems, file a report on github, or comment here.
- Syntax coloring of ALL elisp symbols documented in elisp manual, and ONLY those. If a symbol is not colored, it's either a typo or not documented in elisp manual.
- Symbols are colored by their technical type: function, special form, macro, command, user option, variable.
- Completion for function names with `ido-mode' interface for ALL symbols emacs knows (all in obarray, including loaded 3rd party packages). (press Tab ⇥ after word). Ido supports flex match. That is, you can type any char that appear in the middle of symbol you are looking for (not just prefix).
- Command to format entire sexp expression unit. (press Tab ⇥ before word.)
- Function param template. (press Space after function name.)
- 1 to 4 letters abbrevs for top 50 most used functions. e.g. “d” → expands full (defun ...) template.
No dependency on third-party package. Only require bare GNU emacs.
Single-letter abbrevs includes:
- d → defun
- i → insert
- l → let
- m → message
- p → point
- s → setq
- w → when
Each one expands to the full function template. For example:
m actually expands to
(message "%s▮" ARGS)
list-abbrevs to see the full list.
Yasnippt, Auto-Complete, Company Mode
xah-elisp-mode is designed to not need yasnippt or company-mode.
yasnippt or company-mode are are supported if you want to use them.
there are still some big tasks to do.
- function templates for ALL functions, not just top 100 used ones. Autogenerate the templates.
- command to collapse sexp tree by level.
- Automatic formatting, including join lines or separate lines. (For example, toggle a sexp tree into single line or multiple lines.) Or, reformat whole buffer, file, directory. See: Programing: Lisp: Automatic Code Formatting, Lint, Auto Indentation
- full-featured semantic-based extend selection beyond gnu emacs builtin lisp parser provides. See: A Text Editor Feature: Extend Selection by Semantic Unit (without requiring expand-region package)
- 100% structure-aware editing. Any key you press or command you call will be lisp syntax aware, so that invalid syntax isn't possible. Note: paredit mode is opposite of this.
If you would like these features, different from traditional idea of line-based indentation, please do donate.
PayPal to 〔email@example.com〕. In the comment box, say “fund for elisp mode”.
or, Buy Xah Emacs Tutorial and add a comment “fund for elisp mode”.
or, buy something from Best Keyboard for Emacs