Emacs中有(重复 - 最后命令)吗? [英] Is there a (repeat-last-command) in Emacs?

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

问题描述

通常,我已经挖掘到apropos和docs寻找类似于以下的东西,只能放弃回到手头的任务:



(repeat-最后一个命令)



执行刚刚执行的最后一个C-或M-命令(要反弹到一个fn键)



或有时相关:



(describe-last-function)



什么键击我只是错误地发布,我想添加到我的包中的效果。描述键很近,但需要知道我输入的内容。



我只是从我的信任伙伴那里询问太多了。

解决方案

关于' describe-last-function ':



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



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

 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 
$ $ p>

将该elisp放在 .emacs 或等效项中,您将有一个 Mx describe-last-功能



如果你从几个关键字上敲了一下,或者做了一些修改last-command的内容,那就是你感兴趣的东西,命令历史函数可能会引起关注。您可以通过 M-x命令历史


获得

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:

(repeat-last-command)

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

or sometimes the related:

(describe-last-function)

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?

解决方案

with regards to 'describe-last-function':

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.

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

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

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

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中有(重复 - 最后命令)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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