xwem-patches
[Top] [All Lists]

[Merge Req] Summary for xwem--steve--2.1--patch-5

From: Steve Youngs <steve@xxxxxxxx>
Subject: [Merge Req] Summary for xwem--steve--2.1--patch-5
Date: Tue, 15 Feb 2005 00:57:08 +1000
Location: steve@xxxxxxxxxxxxxx http://arch.eicq.org/2005/

Revision: xwem--steve--2.1--patch-5
Archive: steve@xxxxxxxxxxxxxx
Creator: Steve Youngs <steve@xxxxxxxx>
Date: Tue Feb 15 00:56:32 EST 2005
Standard-date: 2005-02-14 14:56:32 GMT
New-files: xwem-agent/.arch-ids/.arch-inventory.id
    xwem-agent/.arch-inventory
Modified-files: lisp/xwem-main.el xwem-agent/xwem-agent.c
New-patches: steve@xxxxxxxxxxxxxx/xwem--steve--2.1--patch-5
Summary: Implement XWEM_RUNNING environment variable.
Keywords: enhancement

* xwem-agent/xwem-agent.c (start_emacs): Set the environment variable
  XWEM_RUNNING to `notyet'.
  (main): Unset XWEM_RUNNING environment variable when we fall out of the
  event loop.
  Also update commentary section.

* lisp/xwem-main.el (xwem-after-window-setup): Maybe set XWEM_RUNNING
  environment variable to "yes".
  (xwem-fini): Maybe unset XWEM_RUNNING environment variable.

The XWEM_RUNNING variable can be used to later control doing things in
(S)XEmacs that either shouldn't be done if XWEM is running or should only
be done if XWEM is running.  For example, in your init.el, you could have
something like...

;; Only set the frame plists if we are _not_ in XWEM
(unless (getenv "XWEM_RUNNING")
  (setq initial-frame-plist '(top 10 left 10 width 98 height 41)
        default-frame-plist '(top 10 left 10 width 98 height 41)))

;; Only start XWEM if we're on a window system device and XWEM_RUNNING is
;; set to "notyet".
(when (and (string= "notyet" (getenv "XWEM_RUNNING"))
           (device-on-window-system-p))
  (xwem-init))

* xwem-agent/.arch-inventory: Make xwem-agent and xwem-agent.o precious.


* added files

    xwem-agent/.arch-ids/.arch-inventory.id
    xwem-agent/.arch-inventory
    
{arch}/xwem/xwem--steve/xwem--steve--2.1/steve@xxxxxxxxxxxxxx/patch-log/patch-5

* modified files

--- orig/lisp/xwem-main.el
+++ mod/lisp/xwem-main.el
@@ -247,6 +247,11 @@
   ;; Now xwem is fully intialized and it is time to run hooks
   (run-hooks 'xwem-after-init-hook)
 
+  ;; If the user is being tricky with $XWEM_RUNNING variable, set it
+  ;; to "yes"
+  (when (getenv "XWEM_RUNNING")
+    (setenv "XWEM_RUNNING" "yes"))
+
   (XSync (xwem-dpy))
 
   (unless xwem-inhibit-startup-message
@@ -335,6 +340,10 @@
   ;; Finally run exit hooks
   (run-hooks 'xwem-exit-hook)
 
+  ;; Remove XWEM_RUNNING environment variable if it is set
+  (when (getenv "XWEM_RUNNING")
+    (setenv "XWEM_RUNNING" nil 'unset))
+
   ;; And close display
   (xwem-fini-root)
   )


--- orig/xwem-agent/xwem-agent.c
+++ mod/xwem-agent/xwem-agent.c
@@ -33,10 +33,13 @@
  * So if any problem occurs and somebody(including xwem) causes
  * problem to XEmacs and hang it or crash, we lost X session and all
  * running clients.  It is much of pain.  The idea to write xwem-agent
- * firstly occured on #xwem channel by alex-i(Please alex-i name your
- * self, to include your name here) in very interesting discussion
- * about how window manager and desktop environment should be built.
- * Many thanks to alex-i for an excelent idea.
+ * firstly occured on #xwem channel by a discussion between myself and
+ * Steve Youngs about 6 to 12 months ago.  The idea was recently
+ * expanded upon an improved after a discussion on IRC with
+ * alex-i(Please alex-i name your self, to include your name here) in
+ * very interesting discussion about how window manager and desktop
+ * environment should be built.  Many thanks to alex-i for an excelent
+ * idea.
  *
  * When xwem-agent starts it install magic keys (C-Sh-F6 and C-Sh-F11)
  * by default and starts (S)XEmacs.  Whenever you want to restart
@@ -145,6 +148,7 @@
 pid_t
 start_emacs()
 {
+       setenv("XWEM_RUNNING", "notyet", 1);
         if ((epid = fork()) == 0) {
                 /* Direct (S)XEmacs stdout/stderr to file */
                 if (outfile) {
@@ -332,6 +336,7 @@
                         break;
                 }
         }
+       unsetenv("XWEM_RUNNING");
 
         return 0;
 }




<Prev in Thread] Current Thread [Next in Thread>
  • [Merge Req] Summary for xwem--steve--2.1--patch-5, Steve Youngs <=