SuperAPI AI 工具集

emacsclient

通用与其它

查看项目

更新于 10-16 00:21

技能介绍

用途:当用户已运行 Emacs 服务器时,统一使用 emacsclient 执行所有 Emacs 操作,包括用户请求的动作以及代理发起的字节编译、语法检查、运行测试等。

主要能力与用法: 打开文件:emacsclient --no-wait "/path/to/file" 求值 elisp:emacsclient --eval '(some-function)' 定位到某行打开:emacsclient --no-wait +42 "/path/to/file" 字节编译文件:emacsclient --eval '(byte-compile-file "/path/to/file.el")' 检查括号:emacsclient --eval '(with-temp-buffer (insert-file-contents "/path/to/file.el") (check-parens))' 运行 ERT 测试:emacsclient --eval '(progn (load "/path/to/test-file.el" nil t) (ert-run-tests-batch-and-exit "pattern"))'

规则:始终使用 emacsclient,绝不使用 emacs 或 emacs --batch;打开文件时用 --no-wait 使命令立即返回;求值 elisp 用 --eval;--eval 的 elisp 应跨多行并正确缩进;通过 Bash 工具运行 emacsclient 命令。

限制:资料未提供更多关于环境配置、版本要求或错误处理的信息。