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.
This commit is contained in:
Chris Feng 2015-08-27 13:05:05 +08:00
parent 7032ee7003
commit 5222dc17d6

View file

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