changeset 4337:cda282328afd

(delete-frame): Permit it, if > 1 frame is vis or iconic.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Jul 1993 04:50:27 +0000
parents 96d3869ae231
children 0e9960f5e99c
files lisp/menu-bar.el
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Thu Jul 29 04:12:41 1993 +0000
+++ b/lisp/menu-bar.el	Thu Jul 29 04:50:27 1993 +0000
@@ -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