Heime <[email protected]> writes:
> On Thursday, August 20th, 2026 at 7:17 AM, [email protected] <[email protected]> wrote:
>
>> Heime <[email protected]> writes:
>>
>> > On Thursday, August 20th, 2026 at 4:59 AM, [email protected] <[email protected]> wrote:
>> >
>> >> Heime <[email protected]> writes:
>> >>
>> >> >
>> >> > Where should I call setopt exactly?
>> >> >
>> >>
>> >> Not where, but when. After your definitions (defun,
>> >> defcustom) have been evaluated. You can call ‘setopt’ in an
>> >> elisp buffer, in the *scratch* buffer, with M-:, or in your
>> >> Emacs initialization file.
>> >
>> > I hoped to declare the initial value in the defcustom definition.
>>
>> There is an option for that described in the Emacs Lisp
>> reference manual:
>>
>> (info "(elisp) Variable Definitions")
>
> Yes there is, but can use use a let binding before the assignment like this
>
> (defcustom galaxiakos-fpln
> (let (basepath (assoc-default 'GLXKS orellana-fpln))
> (setq galaxiakos-fpln
> `((GLXKS . ,basepath)
> (OMNIX . ,(concat basepath "/omniskon"))
>
>
That is near what you could write using the ‘:initialize’
option to ‘defcustom’:
(defcustom galaxiakos-fpln
...
:initialize (lambda (option _value)
(let ((basepath (assoc-default 'GLXKS orellana-fpln)))
(set option
`((GLXKS . ,basepath)
(OMNIX . ,(concat basepath "/omniskon"))))))
...)
--
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.