From 86b08ef9ea316ee95068ee7710ba2dee4e74ca3f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 24 Nov 2024 09:49:18 +0400 Subject: [PATCH] Revert "aaaaaaa" This reverts commit 508f0f72a81bcb5e1cb2a8e78817d116a68a22b2. --- config/emacs/emacs.org | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index a0cd92f5..20b21378 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1087,27 +1087,24 @@ the feds are watching (setq elcord-quiet t) (setq elcord-display-elapsed nil) :config - (elcord-mode)) + (defun elcord--disable-elcord-if-no-frames (f) + (ignore f) + (when (let ((frames (delete f (visible-frame-list)))) + (or (null frames) + (elcord-mode -1))))) - (defun elcord--disable-elcord-if-no-frames (f) - (declare (ignore f)) - (when (let ((frames (delete f (visible-frame-list)))) - (or (null frames) - (and (null (cdr frames)) - (eq (car frames) terminal-frame)))) - (elcord-mode -1) - (add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created))) + (defun elcord--enable-on-frame-created (f) + (elcord-mode +1)) - (defun elcord--enable-on-frame-created (f) - (declare (ignore f)) - (elcord-mode +1)) + (add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created) - (defun sakomacs/elcord-mode-hook () - (if elcord-mode - (add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames) - (remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames))) - - (add-hook 'elcord-mode-hook 'sakomacs/elcord-mode-hook) + (defun sakomacs/elcord-mode-hook () + (if elcord-mode + (add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames) + (remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames))) + (elcord-mode) + (add-hook 'elcord-mode-hook 'sakomacs/elcord-mode-hook) + ) #+end_src ** Telegram does NOT WORK ON WINDOWS