Commit 5a4cf282 authored by Martin Rudalics's avatar Martin Rudalics
Browse files

New option frame-auto-hide-function replacing frame-auto-delete.

* window.el (frame-auto-hide-function): New option replacing
frame-auto-delete.  Suggested by Stefan Monnier.
(window--delete): Call frame-auto-hide-function instead of
investigating frame-auto-delete.
parent 9854542e
2011-10-05 Martin Rudalics <rudalics@gmx.at>
* window.el (frame-auto-hide-function): New option replacing
frame-auto-delete. Suggested by Stefan Monnier.
(window--delete): Call frame-auto-hide-function instead of
investigating frame-auto-delete.
2011-10-05 Stefan Monnier <monnier@iro.umontreal.ca> 2011-10-05 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/edebug.el: Heed checkdoc recommendations. * emacs-lisp/edebug.el: Heed checkdoc recommendations.
......
...@@ -2738,13 +2738,18 @@ the buffer `*scratch*', creating it if necessary." ...@@ -2738,13 +2738,18 @@ the buffer `*scratch*', creating it if necessary."
(set-buffer-major-mode scratch) (set-buffer-major-mode scratch)
scratch))) scratch)))
(defcustom frame-auto-delete nil (defcustom frame-auto-hide-function #'iconify-frame
"Non-nil means automatically delete frames. "Function called to automatically hide frames.
The default value nil means to iconify frames instead. Functions The function is called with one argument - a frame.
affected by this variable are `quit-window' (when burying the
window's buffer) and `bury-buffer'." Functions affected by this option are those that bury a buffer
:type 'boolean shown in a separate frame like `quit-window' and `bury-buffer'."
:group 'windows) :type '(choice (const :tag "Iconify" iconify-frame)
(const :tag "Delete" delete-frame)
(const :tag "Do nothing" ignore)
function)
:group 'windows
:group 'frames)
(defun window--delete (&optional window dedicated-only kill) (defun window--delete (&optional window dedicated-only kill)
"Delete WINDOW if possible. "Delete WINDOW if possible.
...@@ -2760,9 +2765,8 @@ if WINDOW gets deleted." ...@@ -2760,9 +2765,8 @@ if WINDOW gets deleted."
(cond (cond
((eq deletable 'frame) ((eq deletable 'frame)
(let ((frame (window-frame window))) (let ((frame (window-frame window)))
(if (or kill frame-auto-delete) (when (functionp frame-auto-hide-function)
(delete-frame frame) (funcall frame-auto-hide-function frame)))
(iconify-frame frame)))
'frame) 'frame)
(deletable (deletable
(delete-window window) (delete-window window)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment