diff options
| author | jao <jao@gnu.org> | 2025-11-25 11:22:43 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2025-11-25 11:22:43 +0000 |
| commit | 3f778cff8bc51710496ccf3b2be250e24572d424 (patch) | |
| tree | 06373dfa1212767b6ef0649d0f1ff4d2c88791d5 /lib/eos | |
| parent | a78c2ad2ba4d7c137bbb8e1be69fd1599080f8ec (diff) | |
| download | elibs-3f778cff8bc51710496ccf3b2be250e24572d424.tar.gz elibs-3f778cff8bc51710496ccf3b2be250e24572d424.tar.bz2 | |
afio: better definition of default parameters
Diffstat (limited to 'lib/eos')
| -rw-r--r-- | lib/eos/jao-afio.el | 14 |
1 files changed, 10 insertions, 4 deletions
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)) |
