New command M-x x-auto-raise-mode toggles auto-raise mode on and off.
authorChris Hanson <org/chris-hanson/cph>
Thu, 26 Mar 1992 22:29:37 +0000 (22:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 26 Mar 1992 22:29:37 +0000 (22:29 +0000)
v7/src/edwin/xcom.scm

index 57ad63bf60b8e5db909460f53b23fdf59d7ab18e..b31ed9c0a490eedd001c54f67431db012a951a7b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/xcom.scm,v 1.7 1992/03/13 23:59:41 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/xcom.scm,v 1.8 1992/03/26 22:29:37 cph Exp $
 ;;;
 ;;;    Copyright (c) 1989-92 Massachusetts Institute of Technology
 ;;;
@@ -41,7 +41,7 @@
 ;;;; X Commands
 
 (declare (usual-integrations))
-\f
+
 (define-primitives
   (x-window-clear 1)
   (x-window-lower 1)
@@ -65,7 +65,7 @@
 
 (define (current-xterm)
   (screen-xterm (selected-screen)))
-
+\f
 (define-command x-set-foreground-color
   "Set foreground (text) color to COLOR."
   "sSet foreground color"
            (editor-error "Unknown font name: " font))
        (xterm-set-size xterm x-size y-size)))))
 
-(define-command x-raise-screen
-  "Raise the editor screen so that it is not obscured by other X windows."
-  ()
-  (lambda () (x-window-raise (current-xterm))))
-
-(define-command x-lower-screen
-  "Lower the editor screen so that it does not obscure other X windows."
-  ()
-  (lambda () (x-window-lower (current-xterm))))
-\f
 (define-command x-set-size
   "Set size of editor screen to WIDTH x HEIGHT."
   "nScreen width (chars)\nnScreen height (chars)"
   "nSet internal border width"
   (lambda (width)
     (x-window-set-internal-border-width (current-xterm) (max 0 width))))
-
+\f
 (define-command x-set-window-name
   "Set X window name to NAME.
 Useful only if `x-screen-name-format' is false."
@@ -198,6 +188,30 @@ Used only if `x-screen-icon-name-format' is non-false."
                   (variable-local-value
                    (window-buffer window)
                    (ref-variable-object x-screen-icon-name-length))))))
+
+(define-command x-raise-screen
+  "Raise the editor screen so that it is not obscured by other X windows."
+  ()
+  (lambda () (x-window-raise (current-xterm))))
+
+(define-command x-lower-screen
+  "Lower the editor screen so that it does not obscure other X windows."
+  ()
+  (lambda () (x-window-lower (current-xterm))))
+
+(define-command x-auto-raise-mode
+  "Toggle auto-raise mode.
+With argument, turn auto-raise mode on iff argument is positive."
+  "P"
+  (lambda (argument)
+    (let ((argument (command-argument-value argument)))
+      (cond ((and (or (not argument) (positive? argument))
+                 (not x-screen-auto-raise))
+            (set! x-screen-auto-raise true))
+           ((and (or (not argument) (not (positive? argument)))
+                 x-screen-auto-raise)
+            (set! x-screen-auto-raise false))))
+    (message "Auto-raise " (if x-screen-auto-raise "enabled" "disabled"))))
 \f
 (define-command x-set-mouse-shape
   "Set mouse cursor shape to SHAPE.