From 3f778cff8bc51710496ccf3b2be250e24572d424 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 25 Nov 2025 11:22:43 +0000 Subject: afio: better definition of default parameters --- lib/eos/jao-afio.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index c4445bd..74e1d78 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -34,9 +34,16 @@ (defvar jao-afio--configs '(?c ?w ?g ?p ?s ?t)) (defvar jao-afio--previous-config (car jao-afio--configs)) +(defvar jao-afio--config-names + '((?c . "main") (?s . "scratch") (?g . "mail") + (?p . "docs") (?w . "web") (?t . "chats"))) (define-multisession-variable jao-afio-configurations nil) +(defmacro jao-afio-add-frame-parameters (name &rest params) + `(add-to-list 'jao-afio-frame-parameters + '(,(if name (format "%s" name) 'def) ,params))) + (defun jao-afio--current-wc () (window-state-get (frame-root-window) t)) @@ -61,7 +68,8 @@ (when jao-afio-use-frames (let ((fn (jao-afio-frame-name cfg))) (set-frame-name fn) - (when-let* ((params (cadr (assoc fn jao-afio-frame-parameters)))) + (when-let* ((params (cadr (or (assoc fn jao-afio-frame-parameters) + (assoc 'def jao-afio-frame-parameters))))) (modify-frame-parameters nil params))))) (defun jao-afio--init (&optional f) @@ -205,9 +213,7 @@ (seq-find (lambda (f) (eq (jao-afio--current-config nil f) c)) (frame-list))) (defun jao-afio-frame-name (&optional c) - (alist-get (or c (jao-afio--current-config)) - '((?c . "main") (?s . "scratch") (?g . "mail") - (?p . "docs") (?w . "web") (?t . "chats")))) + (alist-get (or c (jao-afio--current-config)) jao-afio--config-names)) (defun jao-afio-frame-no (&optional c) (alist-get (or c (jao-afio--current-config)) -- cgit v1.2.3