From d1806e91888cc2d56e252299d07cb6af05a3e9d0 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 16 Aug 2015 18:53:04 +0000 Subject: Improve code robustness. * exwm-layout.el (exwm-layout-unset-fullscreen) (exwm-layout-set-fullscreen): Use `user-error' rather than `cl-assert'. * exwm-input.el (exwm-input--set-focus): Silently accept unknown ids. (exwm-input--grab-keyboard) (exwm-input--release-keyboard): Silently ignore calls for windows that have no buffer. * exwm-manage.el (exwm-manage--kill-client): Don't throw error when trying to kill a vanished window. --- exwm-manage.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'exwm-manage.el') diff --git a/exwm-manage.el b/exwm-manage.el index ffe21e23e7ad..3274d65c177a 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -260,10 +260,9 @@ corresponding buffer.") "Kill an X client." (interactive) (unless id (setq id (exwm--buffer->id (current-buffer)))) - (let ((pid (slot-value - (xcb:+request-unchecked+reply exwm--connection - (make-instance 'xcb:ewmh:get-_NET_WM_PID :window id)) - 'value))) + (let* ((response (xcb:+request-unchecked+reply exwm--connection + (make-instance 'xcb:ewmh:get-_NET_WM_PID :window id))) + (pid (and response (slot-value response 'value)))) (if pid (signal-process pid 'SIGKILL) (xcb:+request exwm--connection -- cgit 1.4.1