- “sometimes i feel like we’re making emacs better and better because we don’t know what to do with emacs once it is finished.” – AlexSchroeder on InternetRelayChat
Click the heading to search for all pages belonging to the writing of Lisp code. These pages contain information for would-be authors of new major and minor modes: EmacsLisp style, coding conventions, pointers and documentation to existing features. What follows are some suggestions; find more other pages by searching for backlinks via the heading.
Before you get starting diving into Emacs Lisp, it’s a good idea to be aware of some EmacsLispLimitations. Once upon a time I thought I wanted to use Emacs Lisp for all of my coding needs, but then rediscovered the old truism: some languages are better suited for some tasks. – JohnWiegley
Learning Emacs Lisp
Ordered for pedagogy:
Writing a Major Mode
Tips and tricks to writing a MajorMode.
- GenericMode – for very simple modes including font-locking and comments
- DerivedMode – for new modes very similar to existing modes
- SampleMode – complete Emacs Lisp example for a real major mode
- ModeTutorial – a tutorial for mode writers
- ImenuMode – provide an index menu to the interesting parts in the buffer
- Font-lock programming
- Other tools and solutions
Style and suggestions
- AdviceVsHooks – Sometimes a package cannot be customized using variables and hooks; in these situations defadvice must be used.
- CheckDoc – A tool to check your documentation strings.
- CodingStyle – Write well formatted code.
- ElispPackageChecklist – A document with suggestions for package authors.
- InitFileByPurpose? – Utilities (and a bit of ranting) as to how you should take back control of the organization of your InitFile.
- MeaningfulNames – choosing identifiers (symbols) for code
- NonLocalExit – Examples of error handling and
‘throw’…‘catch’. - NonNilValues – Which non-
‘nil’ value should I use? ‘t’? ‘42’? Does it matter? - QuotedLambda – There is no need to quote lambda expressions.
- UnitTesting – How to write unit-test code.
- WhenToUseIf – When to use which conditional control structure (
‘cond’, ‘if’, ‘when’, ‘unless’, ‘and’, ‘or’, ‘case’).
Writing code that works on different versions of Emacs and XEmacs is ComparativeEmacsology.
Emacs Lisp Tools and Tricks
Emacs Lisp Installers
- el-get - apt-get user experience for Emacs Lisp, with full support for emacswiki
- XEmacs package manager – (Could an XEmacs please describe her experience with this)
- InstallElisp - Retrieve and install elisp from Internet
- elinstall - An installer for elisp code. It sets up autoloads, load-path, etc. by Tom Breton (Tehom)
- ELPA - Emacs Lisp Package Archive by TomTromey
- Pases – Packaging system for Emacsen
- AutoInstall - Asynchronous retrieve and install elisp file from Internet.
- plugin.el – Automatic fetching, installing and loading of Emacs modules
- use-package.el – Arrange use of an elisp package
- UsePackage - Describe how to get and configure a package, then install on demand with an autoload-like mechanism
Emacs Lisp Libraries
- ArrayExtension – Support for arrays, and matrixes.
- AutoOverlays – Overlays defined by regexps, automatically created, updated and destroyed as buffer is modified.
- AVLtrees – AVL tree data structures (self-balancing binary trees)
- CompletionUI – Completion user interface, providing various highly customizable completion mechanisms (dynamic, hotkeys, cycling, tab-completion, help-echo, tooltip, menu…)
- DoReMi – Macro
‘define-doremi’ and command ‘doremi’. Use them to define commands that let you use the arrow keys and/or mouse wheel to make incremental changes to things or cycle through a ring of things. - DictionaryTrees – Advanced dictionary data structures
- ElispParser – A small parser tool written in EmacsLisp.
- EmacsDataBase is a flexible system for defining, accessing, modifying, summarizing, and generally playing with, a set of records. You can view each record individually or summarized (with other records) in separate buffer. Record format (field names and their types) can be arbitrarily complex.
- TinyDb – A mini-database, smaller than EmacsDataBase
- ParserCompiler – A macro that compiles Recursive Descent parsers in elisp.
- Heaps – Heap data structures (a.k.a. priority queues)
- Icicles – New possibilities for using completion and cycling of completion candidates.
- IncrementalRead – support building libraries that act incrementally on input.
- Iterate – A macro for iterating in different fashions over various data structures, similar in spirit to Common Lisp iterate library
- LaterDo – Calling functions later, thus do some sort of fake threading
- LuiMode – A Linewise User Interface
- MacroUtilities – Utilities for writing macros.
- ModeLocal – Causing a variable or function to have a value/behavior based on major mode.
- PasswordGenerator
- PatternMatching – Matching Lisp expressions based on pattern expressions.
- Queues – Queue data structures
- RecordType – Definition of a new type: record. A record is a set of named fields with their associated type.
- SemanticBovinator – A flex/bison lexer and parser generator written in EmacsLisp.
- SubdirsToList – Adding subdirectories to a list recursively
- TaggedNFA – Tagged non-deterministic finite state automata (generally used for regular expression matching algorithms)
- TcpClient – Network interface to ease the creation of network related script
- TernarySearchTrees – ternary search tree data structures (obsolete - use Tries instead)
- ThingAtPoint – Functions to return various kinds of Emacs Lisp entity at or near point. For example, return the Lisp symbol name nearest point.
- Tries – General trie data structures (including ternary search trees)
- UseCustomizeForKeyBindings – Widget and
‘defcustom’ code to let users use Customize for key bindings. - VectorModificationLibrary? – Functions to modify vectors
- XmlParser – Writing code which reads and manipulates XML. Pointers to DOM, XPath, etc.
- [[Infix?]] – Writing infix math expressions
Proof of Concept
Discussion About Emacs Lisp
- CategoryExtensionLanguage – Other Emacs extension languages currently supported, and future implementations of Emacs in other languages.
- DynamicBindingVsLexicalBinding – Benefits and pitfalls of dynamic binding and a way to simulate lexical binding.
- EmacsLispLimitations – Limitations of EmacsLisp and reasons not to use it for everything.
- LangPollResults – Preliminary results of the language poll on the #emacs channel.
- WhyDoesElispSuck – Why people say that EmacsLisp is a bad language, deprecated, not the ideal choice for the future, or <your remark here>…
- RationalElispPackaging – Design of a packaging system for Emacs Lisp software.
- Emacs Internals – I’ve been reading the source for a while. Trying to start annotate how to read the source for others. Here’s a diagram of how I see it presently. (Not sure if this is correct place to put this?)
Curiosities
This list is mostly for pages that are no longer relevant because Emacs comes with features making them obsolete.
See Also