SuperAPI AI 工具集

emacs-variables

通用与其它

查看项目

更新于 10-16 00:04

技能介绍

用途:在 Emacs 中检查或修改变量时,提供 elisp 变量处理的代码模式,涵盖变量定义、定制与状态管理。

主要能力:定义与设置变量(defvar、setq、defvar-local);缓冲区局部变量(make-local-variable、setq-local、buffer-local-value、local-variable-p);用户可定制选项(defcustom 及 boolean、string、integer、choice、repeat 等 :type);变量检查(boundp、describe-variable、documentation-property);let 与 let* 绑定及动态绑定;词法绑定与闭包(lexical-let、lexical-binding: t);哈希表(make-hash-table、gethash、puthash、remhash、maphash);属性列表(plist-get、plist-put、get、put);常用模式(安全访问、布尔切换、cl-incf/cl-decf、push/pop、getenv/setenv);钩子(add-hook、remove-hook、run-hooks)。

使用方式:按资料中的 elisp 片段在 Emacs 配置或交互中调用;闭包场景在动态绑定下使用 lexical-let,新文件建议在文件头启用 lexical-binding: t。

显示限制:用户使用仅支持黑、白、灰的墨水屏显示器,禁止使用颜色(如 :foreground "red"),改用 :weight bold、:weight light、:slant italic、:underline t 区分;标准 Emacs face(font-lock-*-face)可用。

适用场景:编写或调试 Emacs 配置、处理缓冲区局部状态、构建回调与 transient 菜单描述函数等。

限制:资料未提供安装命令、版本要求、收费或平台信息。