emacs-lisp

Guides writing Emacs Lisp code following community style conventions and best practices.

2|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/ShineBreaker/Guix-configs --skill emacs-lisp-shinebreaker
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: emacs-lisp
Source: https://github.com/ShineBreaker/Guix-configs/tree/main/dotfiles/mutable/agents/skills/.config/agents/skills/emacs-lisp
Command: npx skills add https://github.com/ShineBreaker/Guix-configs --skill emacs-lisp-shinebreaker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Emacs Lisp that follows community conventions is difficult without deep familiarity with naming rules, indentation standards, lexical binding, autoloading, and documentation requirements. This Skill provides expert guidance so your Emacs packages, modes, and configuration code are consistent, maintainable, and idiomatic. ## Core Features & Use Cases - Style Enforcement: Applies the community-driven Emacs Lisp Style Guide covering layout, indentation, naming conventions (package prefixes, predicates, private functions), and preferred syntax like when, unless, and 1+. - Package Structure Guidance: Provides templates for file headers with lexical binding, defcustom variables, autoload cookies, docstrings, and proper provide footers. - Mode and Command Development: Covers defining major/minor modes, interactive commands with proper interactive specifications, keybindings, hooks, macros, and error handling. - Use Case: When creating a new Emacs package, the Skill ensures every public symbol is prefixed, every function has a docstring, interactive commands carry autoload cookies, and the file ends with the correct footer. ## Quick Start Ask the assistant to write a new Emacs Lisp minor mode or review an existing .el file for style guide compliance.

Frequently Asked Questions about emacs-lisp

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

FAQPage Schema
How do I write an Emacs Lisp package that follows community conventions?▼

Start with a file header declaring lexical-binding, add author and package metadata, prefix all public symbols with the package name, write docstrings for every function, add autoload cookies to interactive commands, and end with (provide 'package-name) plus the footer comment.

What naming conventions should Emacs Lisp functions follow?▼

Public functions use the package prefix like my-package-function, private functions use a double hyphen like my-package--helper, single-word predicates end in p (evenp), and multi-word predicates end in -p (buffer-live-p). Unused variables are prefixed with an underscore.

Should I use lexical binding or dynamic binding in Emacs Lisp?▼

Always enable lexical binding by adding -*- lexical-binding: t; -*- to the file header. It provides better performance, proper closures, more predictable scoping, and improved byte-compiler optimization.

When should I use a macro instead of a function in Emacs Lisp?▼

Use macros only when functions cannot work, such as when you need special evaluation order or to wrap body forms. Include a declare form for indentation and debug specs, and prefer backquote syntax over manual list construction.

How do I make Emacs Lisp commands load on demand?▼

Add an ;;;###autoload cookie directly before interactive commands and mode definitions. This lets users invoke the command without loading the entire package first, improving startup time.

Why should I avoid lambdas in Emacs hooks?▼

Lambdas in hooks cannot be removed individually and make debugging harder. Define a named function instead and add it with a function quote, such as (add-hook 'emacs-lisp-mode-hook #'my-setup-function).