简体   繁体   English

关闭Emacs中的所有缓冲区,但保持Neotree打开

[英]Close all buffers in Emacs but preserve neotree open

I'm using the Emacs Neotree plugin that provides a filebrowser sidebar for Emacs, and I have this function to close all buffers but the current one: 我正在使用Emacs Neotree插件,该插件为Emacs提供文件浏览器侧边栏,并且我具有此功能来关闭除当前缓冲区外的所有缓冲区:

(defun kill-other-buffers ()
  "Close all other buffers."
  (interactive)
  (mapc 'kill-buffer (delq (current-buffer) (buffer-list))))

It works ok, but it closes the neotree navigation too and I want it to remain open. 它可以正常工作,但是它也关闭了新树导航,我希望它保持打开状态。 Any idea on how I can get this done? 关于如何完成此工作的任何想法吗?

由于neo-buffer-name在neotreel.el中定义为*NeoTree* ,因此以下更改应可解决问题:

(mapc 'kill-buffer (delq neo-buffer-name (delq (current-buffer) (buffer-list))))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM