[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting variables, argumunts in defun
From: |
wael-zwaiter |
Subject: |
Re: Setting variables, argumunts in defun |
Date: |
Sat, 13 Feb 2021 18:23:08 +0100 |
There seems to be some problem with the following test
Am getting "Wrong number of arguments: (2 . 2), 4"
(defun test (objv)
"Set some local variables."
(pcase objv
( "enable"
(setq-local devi '(0.18 -0.18)
scal 0.2))
( "disable"
(setq-local devi '(0.0 0.0)
scal 1.0)) ) )
(defun myenable ()
"Enable."
(interactive)
(test "enable") )
> Sent: Sunday, February 14, 2021 at 4:57 AM
> From: tomas@tuxteam.de
> To: help-gnu-emacs@gnu.org
> Subject: Re: Setting variables, argumunts in defun
>
> On Sat, Feb 13, 2021 at 05:52:58PM +0100, wael-zwaiter@gmx.com wrote:
> > Is the following valid?
> >
> > (setq-local devi 0.18
> > scal 1.0)
>
> Just ask Emacs: C-h f setq-local says:
>
> ----------------------------------------------------------------
> setq-local is a Lisp macro in ‘subr.el’.
>
> (setq-local [VARIABLE VALUE]...)
>
> Probably introduced at or before Emacs version 24.
>
> Make variables in PAIRS buffer-local and assign them the
> corresponding values.
>
> PAIRS is a list of variable/value pairs. For each variable,
> make it buffer-local and assign it the corresponding value.
> [rest elided]
> ----------------------------------------------------------------
>
> So I'd say yes, it is valid. Whether it does what you want it to
> do I can't say, because you didn't tell us that :-)
>
> Cheers
> - t
>
- Setting variables, argumunts in defun, wael-zwaiter, 2021/02/13
- Re: Setting variables, argumunts in defun, Christopher Dimech, 2021/02/13
- Re: Setting variables, argumunts in defun, wael-zwaiter, 2021/02/13
- Re: Setting variables, argumunts in defun, Philip Kaludercic, 2021/02/13
- Re: Setting variables, argumunts in defun, wael-zwaiter, 2021/02/13
- Re: Setting variables, argumunts in defun, tomas, 2021/02/13
- Re: Setting variables, argumunts in defun,
wael-zwaiter <=
- Re: Setting variables, argumunts in defun, Michael Heerdegen, 2021/02/13
- Re: Setting variables, argumunts in defun, Philip Kaludercic, 2021/02/13
- Re: Setting variables, argumunts in defun, Philip Kaludercic, 2021/02/13
Re: Setting variables, argumunts in defun, Jean Louis, 2021/02/13