emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quit and Close Emacs Special Windows


From: Ergus
Subject: Re: Quit and Close Emacs Special Windows
Date: Mon, 29 Jun 2020 18:45:24 +0200
User-agent: NeoMutt/20180716

On Mon, Jun 29, 2020 at 03:09:59PM +0000, Drew Adams wrote:

Hi Drew:

1) Should we provide a custom variable to conditionally enable the
set-window-parameter part of your code within quit-window?

2) I am not very trained in lisp, so I must ask if you think that this
changes is general enough for all the buffers like: Help, man, Compile,
magit etc?? and won't conflict with others?
if 1 && 2): as this is your code, could you please add the changes if
nobody has any concern about it?

Best and thanks,
Ergus


FWIW, I do this:

(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)))

(global-set-key [remap quit-window] 'quit-window-delete)

I also use dedicated windows for buffers with names `*...*',
and I make frame "hiding" delete frames rather than iconify.

(setq special-display-regexps '("[ ]?[*][^*]+[*]"))
(setq frame-auto-hide-function 'delete-frame)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]