Skip to content

Commit

Permalink
donot save minibuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Jul 2, 2022
1 parent ccd6948 commit a8a4d07
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/workgroups2.el
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,27 @@ When a buffer can't be restored, when creating a blank wg."
:type 'string
:group 'workgroups)

(defcustom wg-major-mode-excludes '(dired-mode
minibuffer-inactive-mode
minibuffer-mode)
"Buffers/frames with the major modes in this list are excluded."
:type '(repeat sexp)
:group 'workgroups)

;; {{ crazy stuff to delete soon
(defconst wg-buffer-list-original (symbol-function 'buffer-list))
(defalias 'wg-buffer-list-emacs wg-buffer-list-original)
(defalias 'wg-switch-to-workgroup #'wg-open-workgroup)

(defun buffer-list (&optional frame)
"Redefinition of `buffer-list'. Pass FRAME to it.
Remove file and dired buffers that are not associated with workgroup."
Remove file and buffers that are not associated with workgroup."
(let ((res (wg-buffer-list-emacs frame))
(wg-buf-uids (wg-workgroup-associated-buf-uids)))
(cl-remove-if (lambda (it)
(and (or (buffer-file-name it)
(eq (buffer-local-value 'major-mode it) 'dired-mode))
;;(not (member b wg-buffers))
(memq (buffer-local-value 'major-mode it)
wg-major-mode-excludes))
(not (member (wg-buffer-uid-or-add it) wg-buf-uids))) )
res)))

Expand Down

0 comments on commit a8a4d07

Please sign in to comment.