From 5222dc17d66375f20485d65573043e5a8286ae9d Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Thu, 27 Aug 2015 13:05:05 +0800 Subject: [PATCH] Avoid deleting the frame created by Emacs client by accident When Emacs is invoked as `emacsclient -a '' -c`, it creates a frame that can be deleted without any prompt. This commit removes the `client` parameter from that frame to avoid such inconvenience. --- exwm-workspace.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index 27e3179..f4e1dd1 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -24,9 +24,6 @@ ;; This module adds workspace support for EXWM. -;; Todo: -;; + prevent from deleting frames of Emacs client (`frame-delete-functions') - ;;; Code: (defvar exwm-workspace-number 4 "Number of workspaces (1 ~ 10).") @@ -230,8 +227,10 @@ The optional FORCE option is for internal use only." ;; Emacs client creates an extra (but unusable) frame (dolist (i exwm-workspace--list) (unless (frame-parameter i 'window-id) - (setq exwm-workspace--list (delq i exwm-workspace--list))))) - (cl-assert (= 1 (length exwm-workspace--list))) + (setq exwm-workspace--list (delq i exwm-workspace--list)))) + (cl-assert (= 1 (length exwm-workspace--list))) + ;; Prevent user from deleting this frame by accident + (set-frame-parameter (car exwm-workspace--list) 'client nil)) ;; Create remaining frames (dotimes (i (1- exwm-workspace-number)) (nconc exwm-workspace--list