help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using variables to set defaults to parameters


From: Stefan Monnier
Subject: Re: Using variables to set defaults to parameters
Date: Thu, 03 Feb 2022 11:24:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> I am currently defining a minor-mode with default parameters, but want
> to pass defaulted variables instead.  What is the way to do this,
> using setq ?
>
> (define-minor-mode rich-minor-mode
> "Brief description" nil "" nil

Don't use this long obsolete form.  Use the keyword arguments, instead:

    (define-minor-mode rich-minor-mode
      "Brief description"
      :lighter "")

> then changed to
>
> (setq initval nil)
> (setq mdline-indic "")
> (setq other nil)

I don't know what you mean with "then changed" nor where the above code
is intended to be placed (inside the `define-minor-mode`?  In some
other function?).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]