GNU bug report logs -
#79065
31.0.50; [PATCH] Allow inverting the meaning of 'quit-window-kill-buffer'
Previous Next
Full log
Message #11 received at 79065 <at> debbugs.gnu.org (full text, mbox):
> Cc: rudalics <at> gmx.at
> Date: Sun, 20 Jul 2025 22:22:53 -0700
> From: Jim Porter <jporterbugs <at> gmail.com>
>
> +If @var{kill} is the special value @code{invert}, or when calling
> +interactively with the prefix argument, then @code{quit-window} inverts
> +the meaning of @code{quit-window-kill-buffer}, so that when it would
> +normally kill the buffer, it buries it instead, and vice versa.
'invert' is a problematic symbol for this purpose, because it doesn't
tell what will happen. I prefer to use 2 symbols with explicit names,
'kill' and 'bury', instead, and have the prefix argument compute the
value by looking at the value of quit-window-kill-buffer. This way, a
Lisp program will tell explicitly what it does, and interactive usage
still "inverts" the value of the option.
> (defun quit-window (&optional kill window)
> "Quit WINDOW and bury its buffer.
> -WINDOW must be a live window and defaults to the selected one.
> -With prefix argument KILL non-nil, kill the buffer instead of
> -burying it.
> +WINDOW must be a live window and defaults to the selected one. Kill the
> +buffer instead according to `quit-window-kill-buffer' (which see).
> +
> +If KILL is `invert' (interactively, with the prefix argument), then
When you mention literal symbols in doc strings, please use
If KILL is the symbol `invert', ....
This prevents Emacs from accidentally creating a false link leading
nowhere relevant.
This bug report was last modified 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.