Variable: project-kill-buffer-conditions

project-kill-buffer-conditions is a customizable variable defined in project.el.gz.

Value

(buffer-file-name (and (major-mode . fundamental-mode) "\\`[^ ]")
		  (and (derived-mode . special-mode)
		       (not (major-mode . help-mode))
		       (not (derived-mode . gnus-mode)))
		  (derived-mode . compilation-mode)
		  (derived-mode . dired-mode)
		  (derived-mode . diff-mode)
		  (derived-mode . comint-mode)
		  (derived-mode . eshell-mode)
		  (derived-mode . change-log-mode))

Documentation

List of conditions to kill buffers related to a project.

This list is used by project-kill-buffers. Each condition is either:
- a regular expression, to match a buffer name,
- a predicate function that takes a buffer object as argument
  and returns non-nil if the buffer should be killed,
- a cons-cell, where the car describes how to interpret the cdr.
  The car can be one of the following:
  * major-mode: the buffer is killed if the buffer's major
    mode is eq to the cons-cell's cdr.
  * derived-mode: the buffer is killed if the buffer's major
    mode is derived from the major mode in the cons-cell's cdr.
  * not: the cdr is interpreted as a negation of a condition.
  * and: the cdr is a list of recursive conditions, that all have
    to be met.
  * or: the cdr is a list of recursive conditions, of which at
    least one has to be met.

If any of these conditions are satisfied for a buffer in the current project, it will be killed.

This variable was added, or its default value changed, in project version 0.8.2.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
(defcustom project-kill-buffer-conditions
  '(buffer-file-name    ; All file-visiting buffers are included.
    ;; Most of temp and logging buffers (aside from hidden ones):
    (and
     (major-mode . fundamental-mode)
     "\\`[^ ]")
    ;; non-text buffer such as xref, occur, vc, log, ...
    (and (derived-mode . special-mode)
         (not (major-mode . help-mode))
         (not (derived-mode . gnus-mode)))
    (derived-mode . compilation-mode)
    (derived-mode . dired-mode)
    (derived-mode . diff-mode)
    (derived-mode . comint-mode)
    (derived-mode . eshell-mode)
    (derived-mode . change-log-mode))
  "List of conditions to kill buffers related to a project.
This list is used by `project-kill-buffers'.
Each condition is either:
- a regular expression, to match a buffer name,
- a predicate function that takes a buffer object as argument
  and returns non-nil if the buffer should be killed,
- a cons-cell, where the car describes how to interpret the cdr.
  The car can be one of the following:
  * `major-mode': the buffer is killed if the buffer's major
    mode is eq to the cons-cell's cdr.
  * `derived-mode': the buffer is killed if the buffer's major
    mode is derived from the major mode in the cons-cell's cdr.
  * `not': the cdr is interpreted as a negation of a condition.
  * `and': the cdr is a list of recursive conditions, that all have
    to be met.
  * `or': the cdr is a list of recursive conditions, of which at
    least one has to be met.

If any of these conditions are satisfied for a buffer in the
current project, it will be killed."
  :type '(repeat (choice regexp function symbol
                         (cons :tag "Major mode"
                               (const major-mode) symbol)
                         (cons :tag "Derived mode"
                               (const derived-mode) symbol)
                         (cons :tag "Negation"
                               (const not) sexp)
                         (cons :tag "Conjunction"
                               (const and) sexp)
                         (cons :tag "Disjunction"
                               (const or) sexp)))
  :version "29.1"
  :group 'project
  :package-version '(project . "0.8.2"))