将 Emacs 宏转换为 Elisp [英] Convert Emacs macro into Elisp

查看:22
本文介绍了将 Emacs 宏转换为 Elisp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将 emacs 宏转换为 elisp,而不是像 M-x insert-kbd-macro 那样,实际活动变成了 elisp 语句.

Is there a way to convert an emacs macro into elisp, not like what M-x insert-kbd-macro does, the actual activity becoming elisp statements.

感谢您的帮助.

推荐答案

我在 https://github.com/Silex/elmacro

它有一些怪癖,但效果很好……例如,以下宏:

It has some quirks but it works pretty well... for example, the following macro:

F3 C-e M-b M-u C-a C-n F4

生成以下 elisp:

Generates the following elisp:

(defun upcase-last-word ()
  "Change me!"
  (interactive)
  (move-end-of-line 1)
  (backward-word 1)
  (upcase-word 1)
  (move-beginning-of-line 1)
  (next-line 1 1))

这篇关于将 Emacs 宏转换为 Elisp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆