emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/exwm 472f7cb: Simplify debugging and fix dynamic-scopin


From: Chris Feng
Subject: [elpa] externals/exwm 472f7cb: Simplify debugging and fix dynamic-scoping `eval'
Date: Sun, 16 Sep 2018 10:02:34 -0400 (EDT)

branch: externals/exwm
commit 472f7cb82b67b98843f10c12e6bda9b8ae7262bc
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Simplify debugging and fix dynamic-scoping `eval'
    
    * exwm-core.el (exwm-debug): New global minor mode to replace
    `exwm-debug-on' and `exwm-debug-toggle'.
    
    * exwm-manage.el (exwm-manage--get-configurations): Use
    lexical-scoping `eval'.
---
 exwm-core.el   | 20 ++++++--------------
 exwm-manage.el |  2 +-
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index 365e24b..66eb98c 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -68,10 +68,12 @@
 (declare-function exwm-workspace-move-window "exwm-workspace.el"
                   (frame-or-index &optional id))
 
-(defvar exwm-debug-on nil "Non-nil to turn on debug for EXWM.")
+(define-minor-mode exwm-debug
+  "Debug-logging enabled if non-nil"
+  :global t)
 
 (defmacro exwm--debug (&rest forms)
-  (when exwm-debug-on `(progn ,@forms)))
+  (when exwm-debug `(progn ,@forms)))
 
 (defmacro exwm--log (&optional format-string &rest objects)
   "Emit a message prepending the name of the function being executed.
@@ -79,22 +81,12 @@
 FORMAT-STRING is a string specifying the message to output, as in
 `format'.  The OBJECTS arguments specify the substitutions."
   (unless format-string (setq format-string ""))
-  `(when exwm-debug-on
+  `(when exwm-debug
      (xcb-debug:message ,(concat "%s:\t" format-string "\n")
                         (xcb-debug:compile-time-function-name)
                         ,@objects)
      nil))
 
-(defun exwm-debug-toggle (&optional arg)
-  "Toggle EXWM debugging output.
-When ARG is positive, turn debugging on; when negative off.  When
-ARG is nil, toggle debugging output."
-  (interactive
-   (list (or current-prefix-arg 'toggle)))
-  (setq exwm-debug-on (if (eq arg 'toggle)
-                          (not exwm-debug-on)
-                        (> 0 arg))))
-
 (defsubst exwm--id->buffer (id)
   "X window ID => Emacs buffer."
   (cdr (assoc id exwm--id-buffer-alist)))
@@ -201,7 +193,7 @@ least SECS seconds later."
   (let ((map (make-sparse-keymap)))
     (define-key map "\C-c\C-d\C-l" #'xcb-debug:clear)
     (define-key map "\C-c\C-d\C-m" #'xcb-debug:mark)
-    (define-key map "\C-c\C-d\C-t" #'exwm-debug-toggle)
+    (define-key map "\C-c\C-d\C-t" #'exwm-debug)
     (define-key map "\C-c\C-f" #'exwm-layout-set-fullscreen)
     (define-key map "\C-c\C-h" #'exwm-floating-hide)
     (define-key map "\C-c\C-k" #'exwm-input-release-keyboard)
diff --git a/exwm-manage.el b/exwm-manage.el
index 7b28d68..79c5405 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -182,7 +182,7 @@ You can still make the X windows floating afterwards."
   (when (derived-mode-p 'exwm-mode)
     (dolist (i exwm-manage-configurations)
       (save-current-buffer
-        (when (eval (car i))
+        (when (eval (car i) t)
           (cl-return-from exwm-manage--get-configurations (cdr i)))))))
 
 (defun exwm-manage--manage-window (id)



reply via email to

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