GNU bug report logs - #52328
27.2; [DOC] Paragraph about quit-restore-window

Previous Next

Package: emacs;

Reported by: Kevin Vigouroux <ke.vigouroux <at> laposte.net>

Date: Mon, 6 Dec 2021 11:48:01 UTC

Severity: normal

Found in version 27.2

Full log


Message #38 received at 52328 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "rms <at> gnu.org" <rms <at> gnu.org>, martin rudalics <rudalics <at> gmx.at>
Cc: "eric <at> ericabrahamsen.net" <eric <at> ericabrahamsen.net>,
 "ke.vigouroux <at> laposte.net" <ke.vigouroux <at> laposte.net>,
 "52328 <at> debbugs.gnu.org" <52328 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#52328: 27.2; [DOC] Paragraph about
 quit-restore-window
Date: Sat, 11 Dec 2021 04:48:42 +0000
I can't speak to what the manual should or shouldn't
say about `quit-restore'.  But since my name was
mentioned I'll just say that I never knowingly or
intentionally use `quit-window' interactively.  I go
out of my way to avoid any use of the `quit-restore'
window parameter.

I replace Emacs's default `quit-window' key bindings,
at least those in libraries I load, with the command
below.

It's close to what `quit-window' used to do, before
Emacs adopted `quit-restore-window'.

(In its doc string, you'll see mention of the option
that Martin mentioned, `frame-auto-hide-function',
which he offered as a way around the imposition by
Emacs of iconifying a window when quitting it or
burying its buffer.) 

(when (fboundp 'quit-restore-window)

  (defun quit-window-delete (&optional kill window)
    "Quit WINDOW, deleting it, 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.

This is similar to the version of `quit-window' that Emacs had before
the introduction of `quit-restore-window'.  It ignores the information
stored in WINDOW's `quit-restore' window parameter.

It deletes the WINDOW more often, rather than switching to another
buffer in it.  If WINDOW is alone in its frame then the frame is
deleted or iconified, according to option `frame-auto-hide-function'."
    (interactive "P")
    (set-window-parameter
      window 'quit-restore `(frame frame nil ,(current-buffer)))
    (quit-restore-window window (if kill 'kill 'bury)))

  )

This bug report was last modified 3 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.