From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: wael-zwaiter@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Setting variables, argumunts in defun Date: Sat, 13 Feb 2021 17:36:16 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14290"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 13 17:36:54 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAxug-0003dI-Hl for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 17:36:54 +0100 Original-Received: from localhost ([::1]:40510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAxuf-0003tq-9q for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 11:36:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAxu7-0003tj-Cw for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:36:19 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:49033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAxu5-0007kv-MF for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:36:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613234176; bh=+Xg5Jqy5ps4If51F/W+OFD0zEhWP6QOHbRakjPADLyA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ZgX+yJsf/y26+S0qlMxkmNTwI1MgZEHwt+MkuO5cKjkbxMpAFiWWJ3VfVvfpSdlff T1d4VUdtPld3YBnXTDFPaL1dn00Izba8B1RMyNR9NzgYS+rebxZVDTKn1PslR47BkM 5b5FeXBK0P5ecEbtv0nKqNkid4Qtm8Jy0x6IKCxo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs12.server.lan [172.19.170.180]) (via HTTP); Sat, 13 Feb 2021 17:36:16 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:iJjGqF5MJhALMhfd1TBX4b42O0FwAhqpoubZcrgvvsTqdOXHHPXtgnw6QE2MLTWHemPqN cEWm6mABXKGVZX2OSIHXmN49M67cvFF25hzvevJBauXvKvo/iVGFsvlWwe/TEvb2et8mxB0u3Rii qcwxu6d3kFSIVvZuy/OoCQIdcb/jyOwPTZqnoQiqHHGTqmyxAOR3MxRZzJhhhVpxmNQUURsF9eh/ LMy9T5YzgDKm4Gd+riEz8cWGxgDo/cVb3vwarN4tuTt6rlRoWqiqF6/5xY95ZcuuqgD4W4yfauqX 1c= X-UI-Out-Filterresults: notjunk:1;V03:K0:tdzJPRSG8Ek=:1K+5aG0ZmXFz4QWOltCsIH HbfdVQM9qadtK/Qi3tUDTx9oTOyguaMnubYnboAyrqhWPp2rl0QhOrVWdcSVvx1L//NRy1Hlc 1qMMQrI6zTZlH4LjEoQOKnLqj+2t89GMRpMve5SxAtmheFbX8vvO0K2+DFsztafZbskw5rR1o sjVWauSH3rXY7sAwUikvG1//y7mf+nClWCvUjRDRyyHIc9c8LZgBe0bHOItxK5qp66oAwgjey THusjinyKlAQQACwwK9Ij6kD9er5PTl2WCV+vk9KI7ZJddmPXR41JaxZasOn9kIt5jsGsq+Tx /JkgA14YIGDHbw464eQ7iBSS4BkEoDCGPIFe/nx+DAzF3tsRC4/4uIU5R7csnroaHuEQoeLVY UjzQNhzUJA2GS4TDVi/AgyEaLZfJ3fbrv/EnrGqpCAzh1+2upOKX0RwAmR+XkVyZeSlbothRp aA23DCkeAgwrgaMntNQ8XAHq8Hvog1zWw2lJ9jbubsgTlA8tEelHimVqIn07FrAq40ZrW/3/I 7cHxXBfgP8b4tfYeDLMajp8tcQr1UCOw6195eMy0Vro17bgtK95/v3xLYIQqkMyLnjIbzbgWZ v+q9CSFMBwCY0= Received-SPF: pass client-ip=212.227.15.15; envelope-from=wael-zwaiter@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127959 Archived-At: Did not know about pcase. Could solve my problem with using strings. > Sent: Sunday, February 14, 2021 at 4:33 AM > From: "Christopher Dimech" > To: wael-zwaiter@gmx.com > Cc: "Help Gnu Emacs" > Subject: Re: Setting variables, argumunts in defun > > I am trying to use pcase on a string, but do need some direction > on how to use it. > > (pcase (string-match "enable" objv) > ( > (setq devi 0.18) > (setq scal 0.2) ) > > ( (string-match "disable" objv) > (setq devi 0.0) > (setq scal 1.0) ) > > ) > > > > Sent: Sunday, February 14, 2021 at 4:14 AM > > From: wael-zwaiter@gmx.com > > To: "Help Gnu Emacs" > > Subject: Setting variables, argumunts in defun > > > > I would like to set up devi and scal by selecting either one or > > the other. Wow can I do this in elisp. Should I pass parameters > > to the function. Can one pass a string, then check its contents? > > > > (defun deviscal () > > > > (setq devi 0.18) > > (setq scal 0.2) > > > > (setq devi 0.0) > > (setq scal 1.0) ) > > > > > > > > > > >