Commit a0213a97 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(delete-frame): Permit it, if > 1 frame is vis or iconic.

parent 5cb70bb5
......@@ -107,7 +107,15 @@
'(or revert-buffer-function revert-buffer-insert-file-contents-function
(and (buffer-file-name)
(not (verify-visited-file-modtime (current-buffer))))))
(put 'delete-frame 'menu-enable '(cdr (visible-frame-list)))
;; Permit deleting frame if it would leave a visible or iconified frame.
(put 'delete-frame 'menu-enable
'(let ((frames (frame-list))
(count 0))
(while frames
(if (cdr (assq 'visibility (frame-parameters (car frames))))
(setq count (1+ count)))
(setq frames (cdr frames)))
(> count 1)))
(put 'kill-this-buffer 'menu-enable '(kill-this-buffer-enabled-p))
(put 'advertised-undo 'menu-enable
......
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