From afabc77f74c9dfac8209de2fd8c0df59c9baafee Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 29 Oct 2021 16:01:18 -0700 Subject: feat(wpcarro/emacs): Include *scratch* and *Messages* While these aren't technically source code buffers, but the purpose of `buffer-ivy-source-code` is to create a list of buffers I likely want to switch to, which includes these. Change-Id: If3f7b6afa6282a3fb8d0d4a3f7aa4ee64287df65 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4799 Tested-by: BuildkiteCI Reviewed-by: wpcarro Autosubmit: wpcarro --- users/wpcarro/emacs/.emacs.d/wpc/buffer.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'users/wpcarro/emacs/.emacs.d/wpc/buffer.el') diff --git a/users/wpcarro/emacs/.emacs.d/wpc/buffer.el b/users/wpcarro/emacs/.emacs.d/wpc/buffer.el index c152f53bc658..098d499e39d3 100644 --- a/users/wpcarro/emacs/.emacs.d/wpc/buffer.el +++ b/users/wpcarro/emacs/.emacs.d/wpc/buffer.el @@ -56,6 +56,9 @@ 'fundamental-mode) "A blacklist of major-modes to ignore for listing source code buffers.") +(defconst buffer-ivy-source-code-whitelist '("*scratch*" "*Messages*") + "A whitelist of buffers to include when listing source code buffers.") + (defconst buffer-source-code-timeout 2 "Number of seconds to wait before invalidating the cycle.") @@ -156,7 +159,8 @@ Return a reference to that buffer." "Use `ivy-read' to choose among all open source code buffers." (interactive) (ivy-read "Source code buffer: " - (-drop 1 (buffer-source-code-buffers)) + (-concat buffer-ivy-source-code-whitelist + (-drop 1 (buffer-source-code-buffers))) :sort nil :action #'switch-to-buffer)) -- cgit 1.4.1