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'.
This commit is contained in:
Chris Feng 2018-03-10 17:28:43 +08:00
parent cb8706f91c
commit 3f6c609a2b
4 changed files with 12 additions and 10 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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)

10
exwm.el
View file

@ -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