branch: externals/exwm
commit a6fc0f868a8ba5b2ccac9e612881ec135c96e5e5
Author: Steven Allen <ste...@stebalien.com>
Commit: Steven Allen <ste...@stebalien.com>

    Improve error message when failing to create workspaces
    
    * exwm-workspace.el (exwm-workspace-switch-create): Explain why we're
    failing to create more than 10 (by default) workspaces. (fixes #141)
---
 exwm-workspace.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index df3605f3b4..b15b66413a 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -725,11 +725,11 @@ Passing a workspace frame as the first option is for 
internal use only."
   (if (or (framep frame-or-index)
           (< frame-or-index (exwm-workspace--count)))
       (exwm-workspace-switch frame-or-index)
-    (let ((exwm-workspace--create-silently t))
-      (dotimes (_ (min exwm-workspace-switch-create-limit
-                       (1+ (- frame-or-index
-                              (exwm-workspace--count)))))
-        (make-frame))
+    (let ((count (1+ (- frame-or-index (exwm-workspace--count))))
+          (exwm-workspace--create-silently t))
+      (when (< exwm-workspace-switch-create-limit count)
+        (user-error "Cannot implicitly create more than %d workspaces at a 
time, customize `exwm-workspace-switch-create-limit' to change this limit" 
exwm-workspace-switch-create-limit))
+      (dotimes (_ count) (make-frame))
       (run-hooks 'exwm-workspace-list-change-hook))
     (exwm-workspace-switch frame-or-index)))
 

Reply via email to