SuperAPI AI 工具集

emacs-ecosystem

通用与其它

查看项目

更新于 10-16 05:45

技能介绍

用途:整理 Emacs 生态中行为与名称不符、容易静默出错的机制,供编写 Emacs Lisp、init.el 与 use-package 配置时参考。

主要能力:覆盖基线选择(Emacs 30.x、lexical-binding、eglot、Tree-sitter、vertico/orderless/marginalia/consult/corfu/cape、use-package 的 :custom/:hook/:defer、#'函数引用、包前缀命名);Tree-sitter 模式可用性判断(fboundp 不足,需 treesit-language-available-p 与模式到语言的映射,并测试同步);键位映射断言与优先级(lookup-key 有损,用 map-keymap 遍历;命名功能键需尖括号;emulation-mode-map-alists 与 minor-mode-overriding-map-alist 的层级;避免修改共享 keymap,改用 make-composed-keymap);验证陷阱(陈旧 .elc、load-prefer-newer 与候选顺序、cl-letf 被编译优化绕过、跨文件宏、批量 load-path、宏展开形状、警告抑制);动态模块加载路径与签名检查;autoload cookie 只放在可识别定义形式前;宏卫生(eval-and-compile、cl-gensym、declare indent/debug);生命周期与错误边界(清理需同时处理 error 与 quit、inhibit-quit、change-major-mode-hook 清理缓冲局部资源)。

使用方式:按文中规则编写与测试配置;示例命令如 emacs -Q --batch --eval '(setq load-prefer-newer t)' -L . -L test -l ert -l ./my-feature.el -l ./test/my-feature-test.el -f ert-run-tests-batch-and-exit 保持原样。

适用场景:Emacs 配置开发、包编写、键位与模式调试、字节编译与测试验证。

限制:资料未提供具体安装步骤、收费信息或平台支持范围;部分行为随 Emacs 版本变化,需按目标版本验证。