stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] [PATCH] New defvar *interactive* used to know if a defcommand is


From: Lionel Flandrin
Subject: [STUMP] [PATCH] New defvar *interactive* used to know if a defcommand is called interactively
Date: Sat, 24 May 2008 19:37:39 +0200

* replaced all references to *executing-stumpwm-command* with *interactive*
---
 events.lisp         |    5 +++--
 message-window.lisp |    2 +-
 primitives.lisp     |    6 +++---
 user.lisp           |    2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/events.lisp b/events.lisp
index 0dc10fb..b65257e 100644
--- a/events.lisp
+++ b/events.lisp
@@ -316,7 +316,7 @@ chunks."
          (cmd (bytes-to-string data)))
     (let ((msgs (screen-last-msg screen))
           (hlts (screen-last-msg-highlights screen))
-          (*executing-stumpwm-command* t))
+          (*interactive* nil))
       (setf (screen-last-msg screen) '()
             (screen-last-msg-highlights screen) '())
       (interactive-command cmd)
@@ -589,7 +589,8 @@ the window in it's frame."
             ;; reprocessed after restarting to the top level. So fake
             ;; it, and put the restart here.
             (with-simple-restart (top-level "Return to stumpwm's top level")
-              (apply eventfn event-slots))
+             (let ((*interactive* t))
+               (apply eventfn event-slots)))
             (xlib:display-finish-output *display*))
         ((or xlib:window-error xlib:drawable-error) (c)
           ;; Asynchronous errors are handled in the error
diff --git a/message-window.lisp b/message-window.lisp
index af40586..059fbf1 100644
--- a/message-window.lisp
+++ b/message-window.lisp
@@ -205,7 +205,7 @@ function expects to be wrapped in a with-state for win."
   "Draw each string in l in the screen's message window. HIGHLIGHT is
   the nth entry to highlight."
   (when strings
-    (unless *executing-stumpwm-command*
+    (when *interactive*
       (let ((width (render-strings screen (screen-message-cc screen) 
*message-window-padding* 0 strings '() nil)))
         (setup-message-window screen (length strings) width)
         (render-strings screen (screen-message-cc screen) 
*message-window-padding* 0 strings highlights))
diff --git a/primitives.lisp b/primitives.lisp
index 34acda3..6a629de 100644
--- a/primitives.lisp
+++ b/primitives.lisp
@@ -68,7 +68,7 @@
           *screen-list*
           *initializing*
           *processing-existing-windows*
-          *executing-stumpwm-command*
+          *interactive*
           *debug-level*
           *debug-expose-events*
           *debug-stream*
@@ -511,8 +511,8 @@ single char keys are supported.")
 (defvar *processing-existing-windows* nil
   "True when processing pre-existing windows at startup.")
 
-(defvar *executing-stumpwm-command* nil
-  "True when executing external commands.")
+(defvar *interactive* nil
+  "True when a defcommand is called interactively")
 
 ;;; The restarts menu macro
 
diff --git a/user.lisp b/user.lisp
index 2379681..2ab1658 100644
--- a/user.lisp
+++ b/user.lisp
@@ -785,7 +785,7 @@ jump to that frame."
 (defcommand echo (string) ((:rest "Echo: "))
   "Display @var{string} in the message bar."
   ;; The purpose of echo is always to pop up a message window.
-  (let ((*executing-stumpwm-command* nil))
+  (let ((*interactive* t))
     (message "~a" string)))
 
 ;; Simple command & arg parsing
-- 
1.5.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]