gpt4 book ai didi

emacs - 从 switch-to-buffer 列表中排除 "hated buffers"

转载 作者:行者123 更新时间:2023-12-04 14:59:24 24 4
gpt4 key购买 nike

我的 .emacs 中有这个:

(global-set-key "\M-s" 'switch-to-buffer)

并且:
(defvar crs-hated-buffers
'("KILL" "*Compile-Log*" "*Buffer List*" "*Messages*" "*Occur*"
"*Completions*" "*compilation*" "TAGS" "*scratch*" "*grep*"
"source" "headers"))
(setq iswitchb-buffer-ignore (append '(
"^ "
"^\\*Buffer"
"^\\*Completions\\*"
"^\\*tramp"
"^\\*Dired log\\*"
"^\\*Quail Completions\\*"
"^\\*Disabled Command\\*"
"^TAGS"
)
crs-hated-buffers))

如何从 switch-to-buffer 列表中排除这些讨厌的缓冲区?

最佳答案

也许是这样的:

(global-set-key [?\M-s] 'my-switch-to-buffer)

(defun my-switch-to-buffer ()
(interactive)
(let ((completion-regexp-list '("\\`[^*]"
"\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*")))
(call-interactively 'switch-to-buffer)))

它可能值得通过 M-x report-emacs-bug 提出功能请求.

关于emacs - 从 switch-to-buffer 列表中排除 "hated buffers",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19989072/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com