about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-03-10T09·28+0800
committerChris Feng <chris.w.feng@gmail.com>2018-03-10T09·28+0800
commit3f6c609a2b1580d77a9863e205718cbba3872bcb (patch)
tree1c482e4d6f610633953ff8db19b3160f76e7179a
parentcb8706f91c1c343a9bf392c9deaadc0c42d4dba6 (diff)
Fix regressions
(exwm-init): Do not signal an error on startup.

* exwm-floating.el (exwm-floating-toggle-floating):
* exwm-input (exwm-input-send-next-key)
(exwm-input-send-simulation-key):
* exwm-layout (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen, exwm-layout-toggle-fullscreen): Fix
incorrect use of `cl-return-from'.
-rw-r--r--exwm-floating.el2
-rw-r--r--exwm-input.el4
-rw-r--r--exwm-layout.el6
-rw-r--r--exwm.el10
4 files changed, 12 insertions, 10 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index 8b1612e42a42..0210492b18e8 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -401,7 +401,7 @@ This is also used by X window containers.")
   "Toggle the current window between floating and non-floating states."
   (interactive)
   (unless (derived-mode-p 'exwm-mode)
-    (cl-return-from 'exwm-floating-toggle-floating))
+    (cl-return-from exwm-floating-toggle-floating))
   (with-current-buffer (window-buffer)
     (if exwm--floating-frame
         (exwm-floating--unset-floating exwm--id)
diff --git a/exwm-input.el b/exwm-input.el
index 6f96d7173803..4c1ce00b1200 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -745,7 +745,7 @@ EXWM will prompt for the key to send.  This command can be prefixed to send
 multiple keys."
   (interactive "p")
   (unless (derived-mode-p 'exwm-mode)
-    (cl-return-from 'exwm-input-send-next-key))
+    (cl-return-from exwm-input-send-next-key))
   (when (> times 12) (setq times 12))
   (let (key keys)
     (dotimes (i times)
@@ -893,7 +893,7 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
   "Fake a key event according to the last input key sequence."
   (interactive "p")
   (unless (derived-mode-p 'exwm-mode)
-    (cl-return-from 'exwm-input-send-simulation-key))
+    (cl-return-from exwm-input-send-simulation-key))
   (let ((keys (gethash (this-single-command-keys)
                        exwm-input--simulation-keys)))
     (dotimes (_ times)
diff --git a/exwm-layout.el b/exwm-layout.el
index 19d14d1140c3..847dd36389dc 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -147,7 +147,7 @@
   (interactive)
   (unless (and (or id (derived-mode-p 'exwm-mode))
                (not (exwm-layout--fullscreen-p)))
-    (cl-return-from 'exwm-layout-set-fullscreen))
+    (cl-return-from exwm-layout-set-fullscreen))
   (with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
     ;; Expand the X window to fill the whole screen.
     (with-slots (x y width height) (exwm-workspace--get-geometry exwm--frame)
@@ -174,7 +174,7 @@
   (interactive)
   (unless (and (or id (derived-mode-p 'exwm-mode))
                (exwm-layout--fullscreen-p))
-    (cl-return-from 'exwm-layout-unset-fullscreen))
+    (cl-return-from exwm-layout-unset-fullscreen))
   (with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
     (setq exwm--ewmh-state
           (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
@@ -200,7 +200,7 @@
   "Toggle fullscreen mode."
   (interactive (list (exwm--buffer->id (window-buffer))))
   (unless (or id (derived-mode-p 'exwm-mode))
-    (cl-return-from 'exwm-layout-toggle-fullscreen))
+    (cl-return-from exwm-layout-toggle-fullscreen))
   (when id
     (with-current-buffer (exwm--id->buffer id)
       (if (exwm-layout--fullscreen-p)
diff --git a/exwm.el b/exwm.el
index 379500b41206..359489ff342a 100644
--- a/exwm.el
+++ b/exwm.el
@@ -757,7 +757,7 @@ manager.  If t, replace it, if nil, abort and ask the user if `ask'."
       (setq exwm--wmsn-window new-owner))))
 
 ;;;###autoload
-(defun exwm-init (&optional frame)
+(cl-defun exwm-init (&optional frame)
   "Initialize EXWM."
   (interactive)
   (if frame
@@ -765,9 +765,11 @@ manager.  If t, replace it, if nil, abort and ask the user if `ask'."
       (select-frame-set-input-focus frame)
     (setq frame (selected-frame)))
   (when (not (eq 'x (framep frame)))
-    (user-error "Not running under X environment"))
+    (message "[EXWM] Not running under X environment")
+    (cl-return-from exwm-init))
   (when exwm--connection
-    (user-error "EXWM already running"))
+    (exwm--log "EXWM already running")
+    (cl-return-from exwm-init))
   (condition-case err
       (progn
         (exwm-enable 'undo)               ;never initialize again
@@ -809,7 +811,7 @@ manager.  If t, replace it, if nil, abort and ask the user if `ask'."
     ((quit error)
      (exwm-exit)
      ;; Rethrow error
-     (signal (car err) (cdr err)))))
+     (warn "[EXWM] EXWM fails to start (%s: %s)" (car err) (cdr err)))))
 
 
 ;;;###autoload