diff lisp/prim/frame.el @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents 0d2f883870bc
children 9f59509498e1
line wrap: on
line diff
--- a/lisp/prim/frame.el	Mon Aug 13 09:17:27 2007 +0200
+++ b/lisp/prim/frame.el	Mon Aug 13 09:18:39 2007 +0200
@@ -532,7 +532,7 @@
 This is equivalent to the type of the frame's device.
 Value is `tty' for a tty frame (a character-only terminal),
 `x' for a frame that is an X window,
-`ns' for a frame that is a NeXTstep window (not yet implemeted),
+`ns' for a frame that is a NeXTstep window (not yet implemented),
 `win32' for a frame that is a Windows or Windows NT window (not yet
   implemented),
 `pc' for a frame that is a direct-write MS-DOS frame (not yet implemented),
@@ -741,9 +741,13 @@
 (defun suspend-or-iconify-emacs ()
   "Calls iconify-emacs if frame is an X frame, otherwise calls suspend-emacs"
   (interactive)
-  (if (eq (frame-type (selected-frame)) 'x)
-      (iconify-emacs)
-    (suspend-emacs)))
+  (cond
+   ((eq (frame-type (selected-frame)) 'x) (iconify-emacs))
+   ((and (eq (frame-type (selected-frame)) 'tty)
+	 (console-tty-controlling-process (selected-console)))
+    (suspend-console (selected-console)))
+   (t
+    (suspend-emacs))))
 
 
 ;;; auto-raise and auto-lower
@@ -860,6 +864,7 @@
 	;; Sort the list so that iconic frames will be found last.  They
 	;; will be used too, but mapped frames take precedence.  And
 	;; fully visible frames come before occluded frames.
+        ;; Hidden frames come after really visible ones
 	(setq frames
 	      (sort (frame-list)
 		    #'(lambda (s1 s2)
@@ -867,6 +872,8 @@
 			       nil)
 			      ((not (frame-visible-p s2))
 			       (frame-visible-p s1))
+			      ((eq (frame-visible-p s2) 'hidden)
+			       (eq (frame-visible-p s1) t ))
 			      ((not (frame-totally-visible-p s2))
 			       (and (frame-visible-p s1)
 				    (frame-totally-visible-p s1)))))))
@@ -914,6 +921,8 @@
 		    #'(lambda (s1 s2)
 			(cond ((and (frame-visible-p s1)
 				    (not (frame-visible-p s2))))
+			      ((and (eq (frame-visible-p s1) t)
+				    (eq (frame-visible-p s2) 'hidden)))
 			      ((and (frame-visible-p s2)
 				    (not (frame-visible-p s1)))
 			       nil)
@@ -1014,7 +1023,7 @@
 	    (setq save-frame next-frame)
 	  (and 
 	   (or (not visible-only)
-	       (eq t (frame-visible-p next-frame)))
+	       (frame-visible-p next-frame))
 	   (setq frames (append frames (list next-frame))))))
 	(setq list (cdr list)))