unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: wael-zwaiter@gmx.com
To: tomas@tuxteam.de
Cc: help-gnu-emacs@gnu.org
Subject: Re: Setting variables, argumunts in defun
Date: Sat, 13 Feb 2021 18:23:08 +0100	[thread overview]
Message-ID: <trinity-999efb6d-4f5b-46c6-9023-050f017ff3ab-1613236988003@3c-app-mailcom-bs12> (raw)
In-Reply-To: <20210213165749.GC5448@tuxteam.de>

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
>



  reply	other threads:[~2021-02-13 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-13 16:14 Setting variables, argumunts in defun wael-zwaiter
2021-02-13 16:33 ` Christopher Dimech
2021-02-13 16:36   ` wael-zwaiter
2021-02-13 16:42   ` Philip Kaludercic
2021-02-13 16:52     ` wael-zwaiter
2021-02-13 16:57       ` tomas
2021-02-13 17:23         ` wael-zwaiter [this message]
2021-02-13 22:59           ` Michael Heerdegen
2021-02-13 17:08       ` Philip Kaludercic
2021-02-13 17:09         ` Philip Kaludercic
2021-02-13 19:15 ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-999efb6d-4f5b-46c6-9023-050f017ff3ab-1613236988003@3c-app-mailcom-bs12 \
    --to=wael-zwaiter@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).