首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Emacs创建了太多的缓冲区

Emacs创建了太多的缓冲区
EN

Stack Overflow用户
提问于 2012-03-04 04:11:22
回答 5查看 1.2K关注 0票数 2

Emacs创建了太多的缓冲区,比如启动时的这个:

代码语言:javascript
复制
Loading /home/david/.recentf...done
Cleaning up the recentf list...done (0 removed)
For information about GNU Emacs and the GNU system, type C-h C-a.

当我想要自动补全时,还有一些像下面这样的:

代码语言:javascript
复制
Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
perl-backward-to-noncomment     perl-beginning-of-function
perl-electric-terminator    perl-end-of-function
perl-indent-command     perl-indent-exp
perl-mark-function  perl-mode
perldb

有没有一种方法可以让emacs删除自动补全缓冲区,而不是在一开始就创建它?谢谢。

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2014-08-26 07:14:34

或者干脆完全禁用scratch、message和completions缓冲区,而不会破坏任何东西:

发布了第一个here,并粘贴了如下内容:

将此代码放入您的.emacs:

代码语言:javascript
复制
;; Makes *scratch* empty.
(setq initial-scratch-message "")

;; Removes *scratch* from buffer after the mode has been set.
(defun remove-scratch-buffer ()
  (if (get-buffer "*scratch*")
      (kill-buffer "*scratch*")))
(add-hook 'after-change-major-mode-hook 'remove-scratch-buffer)

;; Removes *messages* from the buffer.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")

;; Removes *Completions* from buffer after you've opened a file.
(add-hook 'minibuffer-exit-hook
      '(lambda ()
         (let ((buffer "*Completions*"))
           (and (get-buffer buffer)
                (kill-buffer buffer)))))

;; Don't show *Buffer list* when opening multiple files at the same time.
(setq inhibit-startup-buffer-menu t)

;; Show only one active window when opening multiple files at the same time.
(add-hook 'window-setup-hook 'delete-other-windows)

奖励:

代码语言:javascript
复制
;; No more typing the whole yes or no. Just y or n will do.
(fset 'yes-or-no-p 'y-or-n-p)
票数 1
EN

Stack Overflow用户

发布于 2012-03-04 06:37:05

当我第一次开始使用emacs时,我有这种感觉。虽然我通常会在结束后关闭这样的“临时”缓冲区,但更普遍的答案是,您只需将它们抛在脑后,开发一个工作流程,这样您就可以到达您真正想要的缓冲区。否则,当它们不相关时,您将开始将自己的缓冲区视为杂乱,并浪费精力关闭它们。

iswitchb-mode是一个很好的开始。

票数 5
EN

Stack Overflow用户

发布于 2012-03-05 05:57:42

在emacs 24中有elisp函数:

清理缓冲区列表

这是由MidnightMode提供的,可以添加到其他版本中。

顾名思义,这也可以安排。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9549466

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档