major-mode-developer

Streamline Emacs major-mode development with font-lock, indentation, and keymaps.

100|9|Updated Feb 6, 2025
One-click install
npx skills add https://github.com/captainflasmr/ollama-buddy --skill major-mode-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: major-mode-developer
Source: https://github.com/captainflasmr/ollama-buddy/tree/main/.agents/skills/major-mode-developer
Command: npx skills add https://github.com/captainflasmr/ollama-buddy --skill major-mode-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often struggle to create robust Emacs major modes that provide reliable syntax highlighting, indentation, and editor navigation across languages.

Core Features & Use Cases

  • Guidance for implementing font-lock-based syntax highlighting, indentation, and navigation.
  • How to define commands, keymaps, menus, and integrate with common Emacs frameworks (company, flycheck, LSP).
  • Real-world scenarios include creating a new mode for a domain-specific language or extending an existing one for better editing experience.

Quick Start

Create a new major-mode skeleton, then implement basic font-lock, indentation, and keymaps to get started.

Frequently Asked Questions about major-mode-developer

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

FAQPage Schema
How do I create a new Emacs major mode for a domain-specific language?

To create a major mode, generate a skeleton and implement font-lock for syntax highlighting, indentation functions, and keymaps. This provides reliable language support and editor navigation.

How does font-lock configuration work for Emacs major mode syntax highlighting?

Font-lock configuration applies regular expressions to faces for syntax highlighting. The major mode developer guides configuring these patterns to ensure reliable visual distinction across language elements.

Can I integrate Emacs major modes with LSP, company, and flycheck?

Major modes can integrate with LSP, company, and flycheck. The developer covers defining commands and mode hooks to connect your mode with these common Emacs frameworks for completion and linting.

What is the best way to set up indentation and syntax tables in an Emacs major mode?

Setting up indentation requires defining custom indentation functions and configuring syntax tables. The major mode developer streamlines this process for both simple and advanced implementations.

Does Emacs major mode development support imenu patterns and comment handling?

Major mode development supports imenu patterns for navigation and specific comment handling. Configuring these elements ensures proper code structure indexing and commenting behavior in the editor.

Why do I need to consider namespaces when developing an Emacs major mode?

Namespace considerations prevent naming conflicts between your major mode and other Emacs packages. Proper namespace management ensures reliable integration and avoids overriding existing definitions.