Using the :set to make an alist
Heime <[email protected]>
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <_QNeCD3sEZJIr6ya_TgBLVm-26NKpH5vgrC4hJf7X4_d1usHXpkg-EFf5U3bZnMKDvFljYYyg60GjbZKwzxBhdt78MJ6mArGnxOseu0rbZ8=@protonmail.com> |
I want a customisable variable that is an alist with elements (key . directory-path).
Have made the :set function to set the list by appending sub-directories using orellana-fpln base directories. Because usually one uses (set-default symbol value) to set the value, I do not understand how this can be applied to a list.
(defcustom galaxiakos-fpln nil
"Association List (alist) specifying a flight plan, where each element is
a cons cell (WAYPT . DIRECTORY-PATH) linking a waypoint code to its
associated directory path for different Galaxiakos components."
:group 'galaxiakos
:type '(alist :key-type (symbol :tag "Code")
:value-type (string :tag "Path"))
:set (lambda (symbol value)
(set-default symbol value)
(let ( (glxks-waypt (assoc-default 'GLXKS orellana-fpln) )
(when glxks-waypt
(setq galaxiakos-fpln
`((GLXKS . ,glxks-waypt)
(OMNIX . ,(concat glxks-waypt "/omniskon"))
(PROTL . ,(concat glxks-waypt "/protilus"))
(GRGRS . ,(concat glxks-waypt "/gregers"))) )) )) )