emacs-lisp

Standardize Emacs Lisp style with naming, docstring, and autoload conventions.

34|7|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/jkitchin/skillz --skill emacs-lisp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: emacs-lisp
Source: https://github.com/jkitchin/skillz/tree/main/skills/programming/emacs-lisp
Command: npx skills add https://github.com/jkitchin/skillz --skill emacs-lisp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guidance for writing professional Emacs Lisp code that adheres to community conventions, ensuring readability, maintainability, and robust interactive behavior.

Core Features & Use Cases

  • Layout & Indentation: consistent spacing, 2-space body indentation, 4-space special forms.
  • Naming & Style: prefix conventions, private function naming, predicate naming (p suffix).
  • Documentation: thorough docstrings, autoload cookies, and module headers.
  • Interactive Command Best Practices: proper interactive specs and autoloading.
  • Refactoring & Maintenance: guidance for macros, packages, and autoload strategies.

Quick Start

Create a small Emacs Lisp library with lexical-binding, a public function with autoload, and a private helper function.

Frequently Asked Questions about emacs-lisp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write clean, maintainable Emacs Lisp code that follows community standards?

Emacs Lisp style guides establish conventions for readability and consistency: 80-character line limits, 2-space indentation, kebab-case naming, lexical binding, thorough docstrings, and autoload cookies. Following these standards ensures your configuration files, packages, and interactive commands work reliably across Emacs environments and remain easy for others to understand and maintain.

What are the best practices for naming functions and variables in Emacs Lisp?

Emacs Lisp naming conventions use kebab-case for public symbols, private-function prefixes to denote internal helpers, and predicate-naming suffixes (e.g., `-p` for boolean-returning functions). Consistent naming improves code clarity, prevents namespace collisions, and makes your packages compatible with Emacs ecosystem expectations.

How do I create autoloading functions in Emacs Lisp packages?

Autoload cookies defer function loading until first use, reducing startup time. Place autoload directives above function definitions, use lexical binding at the file header, and structure your package with public entry points and private helpers. This approach enables faster Emacs initialization while keeping full functionality available on demand.

What's the difference between lexical and dynamic binding in Emacs Lisp?

Lexical binding restricts variable scope to their definition block, improving performance and predictability. Enable it with `lexical-binding: t` in your file header. Dynamic binding searches the call stack, which is slower and error-prone. Modern Emacs Lisp development favors lexical binding for cleaner, more maintainable code.

How should I structure and document an Emacs Lisp library or package?

Structure packages with modular organization, module headers describing purpose, comprehensive docstrings for all public functions, autoload cookies for interactive commands, and private symbol conventions. This combination ensures users can quickly understand your package, load it efficiently, and extend it safely without namespace conflicts.