Emacs 中有 (repeat-last-command) 吗? [英] Is there a (repeat-last-command) in Emacs?

查看:16
本文介绍了Emacs 中有 (repeat-last-command) 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经常,我深入研究了合适的文件和文档,寻找类似以下内容的内容,但为了回到手头的任务而放弃:

Frequently, I've dug into apropos and docs looking for something like the following only to give up to get back to the task at hand:

(重复最后一个命令)

执行我刚刚执行的最后一个 C- 或 M- 命令(重新绑定到 fn 键)

do the last C- or M- command I just executed (to be rebound to a fn key)

或者有时是相关的:

(描述最后一个函数)

我只是错误地发出了什么按键,我想将其效果添加到我的技巧包中.describe-key 很接近,但需要知道我输入了什么.

what keystroke did I just mistakenly issue, the effect of which I'd like to add to my bag of tricks. describe-key is close, but requires knowing what I typed.

我是不是对我可信赖的伙伴要求太多了?

Am I simply asking too much from my trusty sidekick?

推荐答案

关于'describe-last-function':

有一个变量 last-command,它被设置为代表你最后一件事的符号.所以这个 elisp 片段 - (describe-function last-command) - 应该为立即发生的事情提供文档.

There's a variable last-command which is set to a symbol representative of the last thing you did. So this elisp snippet - (describe-function last-command) - ought to bring up the documentation for the thing that immediately happened.

所以你可以像这样制作一个微不足道的describe-last-function

So you could make a trivial working describe-last-function like so

(defun describe-last-function() 
  (interactive) 
  (describe-function last-command))

将该 elisp 放入 .emacs 或等效文件中,您将拥有一个 M-x describe-last-function.

Put that elisp in .emacs or equivalent, and you'll have a M-x describe-last-function.

如果您在您感兴趣的事情之后敲击了几个键或做了一些修改 last-command 的事情,command-history 函数可能会引起您的兴趣.您可以通过 M-x 命令历史

If you've banged on a few keys or done something that modified last-command since the thing you're interested in, the command-history function might be of interest. You can get that by M-x command-history

这篇关于Emacs 中有 (repeat-last-command) 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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