Subject: bug#76248: [Feature Request] user-option for killing buffer in `quit-window'.

From: Elijah Gabe Perez <[email-masked]>
Date: Fri, 14 Feb 2025 23:33:25 -0600

martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> +either a member of this list or is derived from a member of this list.
> +In either case it will kill the buffer regardless of the value of the
> +KILL argument."
> +  :type '(repeat (symbol :tag "Major mode"))
> +  :version "31.1"
> +  :group 'windows)

Shouldn't it be something like this?

+  :type '(choice (repeat (symbol :tag "Major mode")) boolean)
+  :version "31.1"
+  :group 'windows)

Otherwise it would give a warning due type.

> +  (let (kill-from-mode)
> +    (with-current-buffer (window-buffer (window-normalize-window window))
> +      ;; Run the hook from the buffer implied to get any buffer-local
> +      ;; values.
> +      (run-hooks 'quit-window-hook)
> +
> +      (setq kill-from-mode
> +	    (or (eq quit-window-kill-buffer-modes t)
> +		(and (listp quit-window-kill-buffer-modes)
> +		     (derived-mode-p quit-window-kill-buffer-modes)))))

Wouldn't it be more convenient to put this into the let varlist?

+  (let ((kill-from-mode
+         (or (eq quit-window-kill-buffer-modes t)
+		      (and (listp quit-window-kill-buffer-modes)
+		           (derived-mode-p quit-window-kill-buffer-modes)))))

... or is there something i'm missing?

-- 
                                                   - E.G via GNU Emacs.