如何清除Emacs缓冲区历史记录? [英] How to clear the Emacs buffer history?
问题描述
当我按下 C-x b
( ido-switch-buffer
)时,我得到了很多不想看到的缓冲区.我想清除缓冲区历史记录.
When I press C-x b
(ido-switch-buffer
) I get a lot of buffers that I don't want to see. I'd like to clear the buffer history.
我尝试评估此表达式(使用 M-x eval-buffer
):
I tried evaluating this expression (using M-x eval-buffer
):
(setq ido-buffer-history '())
它生效了;我可以说是因为我用 C-h v ido-buffer-history
看了变量.但是,当我按 C-x b
时,更改没有反映在迷你缓冲区中.
And it took effect; I can tell because I looked at the variable with C-h v ido-buffer-history
. However, the change did not get reflected in the minibuffer when I press C-x b
.
我还应该做什么?我还需要清除其他变量吗?
What else should I do? Are there other variables I should be clearing?
更新:我看到的额外"缓冲区未激活.有趣的是, C-x C-b
( ido-fallback-command
)准确地显示了我的期望.这是我感兴趣的缓冲区历史记录.(有关更多上下文,请参见 buffer-name-history
和 ido-buffer-history
变量.)
UPDATE : The 'extra' buffers that I'm seeing are not active. Interestingly, C-x C-b
(ido-fallback-command
) shows exactly what I would expect. It is the buffer history that I'm interested in. (See the buffer-name-history
and ido-buffer-history
variables for more context.)
注意:也许会有助于提及我使用的是安装了 ido-ubiquitous
的emacs-starter-kit.
Note: Perhaps it will help to mention that I'm using the emacs-starter-kit which has ido-ubiquitous
installed.
推荐答案
在init.el中添加以下内容:(setq ido-use-virtual-buffers nil)
Add the following to your init.el: (setq ido-use-virtual-buffers nil)
后代:
这些都是会话中所有活动的缓冲区.您可以使用以下命令来清理它们:
Those are all the active buffers in your session. You can clean them with the following commands:
-
M-x clean-buffer-list
将关闭您一段时间未使用的所有干净缓冲区 -
M-x kill-some-buffers
将访问每个缓冲区并询问是否要关闭它 -
M-x kill-matching-buffers
将提示输入有关缓冲区名称的正则表达式,您可以将其保留为空白
M-x clean-buffer-list
will close any clean buffers you haven't used in a whileM-x kill-some-buffers
will visit each buffer and ask if you want to close itM-x kill-matching-buffers
will prompt for a regex over buffer names, which you can just leave blank
您还可以通过 C-x C-b
获得无聊的旧缓冲区菜单.在此菜单中,可以按住 d
直到将每个缓冲区标记为要删除,然后按 x
进行提交.
There's also the boring old buffer menu you get with C-x C-b
. In this menu, you can hold d
until it marks each buffer for deletion, then press x
to commit.
这篇关于如何清除Emacs缓冲区历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!