emacs

emacs is a cursor rule for Cursor from sanjeed5/awesome-cursor-rules-mdc. It costs 2,380 tokens per session, scanned A, original, CC0-1.0.

A set of guidelines for writing Emacs Lisp, the programming language used to extend and configure the Emacs editor. It covers file structure, naming, dependencies, and maintainable configuration code.

In plain words
What is it for?
Use it when creating Emacs packages, custom commands, editor settings, or reusable Emacs configuration.
Why use it?
It helps keep editor extensions and configurations organized, readable, and less likely to conflict with other code. It also encourages modern Lisp practices and consistent tooling.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when creating Emacs packages, custom commands, editor settings, or reusable Emacs configuration.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/emacs
About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,571 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for emacs

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/emacs.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/emacs)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/emacs"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/emacs.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,380 This file is loaded in full into every session.
When invoked 2,380 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02380 $0.02380
Opus 5 $0.01190 $0.01190
Sonnet 5 $0.00476 $0.00476
Haiku 4.5 $0.00238 $0.00238

Measured 4d ago against content hash 982ca4d68be0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

emacs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules-mdc/emacs.mdc · 327 lines

How it starts

The opening of the file, as written. The whole thing — 327 lines — stays where its author put it; the contents beside it link to each section on GitHub.

emacs Best Practices

This guide outlines the definitive best practices for Emacs Lisp development and configuration. Adhere to these rules to ensure your code is maintainable, performant, and integrates seamlessly with the Emacs ecosystem.

1. Code Organization and Structure

1.1 File Headers

Every Emacs Lisp file must start with a standard header, including lexical-binding and a clear description.

❌ BAD:

;; my-feature.el
(defun my-feature-do-something () ...)

✅ GOOD:

;;; my-feature.el --- A short description of my-feature -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2025 Your Name
;; Author: Your Name <[email protected]>
;; Keywords: convenience, tools
;;
;;; Commentary:
;; This library provides functions for doing X, Y, and Z.
;;
;;; Code:

(require 'cl-lib) ; Example dependency

(provide 'my-feature)
;;; my-feature.el ends here

1.2 Naming Conventions

All global symbols (functions, variables, constants) must be prefixed with a short, hyphen-separated package name. Use a double hyphen (--) for internal, non-public symbols.

❌ BAD:

(defvar foo-list nil "A list of foos.")
(defun do-something () ...)

✅ GOOD:

(defvar myproj-foo-list nil "A list of foos for My Project.")
(defun myproj-do-something (arg) ...)
(defun myproj--internal-helper (arg) ...) ; Internal function

1.3 init.el Configuration

Your init.el must be a single file, primarily using use-package. If you prefer a literate Org file, always tangle it to init.el; never use org-babel-load-file.

❌ BAD:

;; init.el
(org-babel-load-file "~/.emacs.d/init.org")
(load-file "~/.emacs.d/my-custom-settings.el")
(setq global-setting t) ; Scattered settings

✅ GOOD:

;; init.el (or tangled from init.org)
;; -*- lexical-binding: t; -*-

;; Package manager setup (e.g., straight.el or elpaca)
(setq package-enable-at-startup nil)
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile (require 'use-package))
(require 'use-package-ensure) ; For :ensure t

;; Global Emacs settings (use the 'emacs' pseudo-feature)
(use-package emacs
  :init
  (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
  (load custom-file 'noerror 'nomessage)
  (setq-default fill-column 80
                indent-tabs-mode nil
                tab-width 2)
  :config
  (global-display-line-numbers-mode))

;; Example package configuration
(use-package my-package
  :ensure t
  :defer t ; Defer loading until needed
  :bind (("C-c m" . my-package-command))
  :config
  (setq my-package-setting t))

Read the full file on GitHub · 327 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 327 lines · 2,380 tokens per session scan A 982ca4d68be0

Subscribe to this mod's changes

emacs is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,380 tokens to every session, about $0.0119 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other cursor rules, from other repositories

life-premortem

Write the failure story of your year, relationship, move, or big life bet in advance — imagine it's a year later and it went wrong, tell that story vividly, then mine it for the real risks and the cheap things that would have prevented them. Use when someone says 'I'm about to make a big life change', 'what could go…

mohitagw15856/pm-claude-skills · 121 tokens

ultracite

Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.

elie222/inbox-zero · 0 tokens

typescript-workflow

Cursor rule "typescript-workflow" from Adam-CAD/CADAM, covering typescript workflow rules, type checking, always run type check after type changes, type check commands and when to run type check.

Adam-CAD/CADAM · 868 tokens

uv

┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Project Init │ │ Dependency Mgmt │ │ Environment │ │ - uv init │───▶│ - uv add/remove │───▶│ - uv sync │ │ - pyproject │ │ - uv lock │ │ - uv run │ │ - workspace │ │ - uv update │ │ - .venv │ └─────────────────┘ └──────────────────┘ └─────────────────┘.

AIFlowML/cursor_rules · 6,470 tokens

python

Python best practices and patterns for modern software development with Flask and SQLite.

PatrickJS/awesome-cursorrules · 734 tokens

clean-code-reviewer

Eliminates technical debt using SOLID, DRY, YAGNI, and Addy Osmani production-grade engineering principles. / TR: SOLID, DRY, YAGNI ve Addy Osmani üretim seviyesi mühendislik ilkeleri ile kod kalitesini denetleyen yetenek.

GktuOktay/ai-skills · 0 tokens