User parameter collection and assignment
Heime <[email protected]> Sun, 02 Aug 2026 21:05:42 +0000
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <Lgb0feg5GssdrPdgvXxtzlRmia7Dzw_qjEWFk1us0_Ggf6qI5q2qDJC777yChqh850PRmnUHjfeUHbMhcaeEqcm74GNj0GsnAzkAQKq5WFg=@protonmail.com> |
Have made this generic function for users to fill an alist
of parameters.
Then I made the command galaxiakos-frame-config to call the generic
function and try to populate the global variable I want - for instance
galaxiakos-frame-prms.
How can I go about a good implomentation?
(defun galaxiakos-alist-config (smbl params)
"Define parameters PARAMS, as alist with elements
in the form (NAME . VALUE)."
(interactive
(list
(let (result)
(while t
(let ((name (read-string
"Parameter Name (leave empty to finish): ")))
(if (string=3D name "")
(cl-return result)
(let ((value (read-string (format "Value for %s: " name))))
(push (cons (intern name) value) result))))))))
;; Store parameters in smbl
(set smbl (nreverse params)) )
(defun galaxiakos-frame-config ()
"Define frame parameters PARAMS, as list of cons cells in the form
(NAME . VALUE) as supported by `make-frame'."
(interactive)
(call-interactively 'galaxiakos-alist-config)
;; fill galaxiakos-frame-prms
)