From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?Windows-1252?Q?Vincent_Bela=EFche?= Newsgroups: gmane.emacs.devel Subject: RE: using ses programatically (was: a ses question) Date: Sat, 18 Nov 2023 22:55:08 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_PAXP192MB1608A14EB40012864BDD2A6284B6APAXP192MB1608EURP_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7811"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , "boruch_baum@gmx.com" To: =?Windows-1252?Q?andr=E9s_ram=EDrez?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 06:35:34 2023 Return-path: Envelope-to: ged-emacs-devel@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 1r4aT0-0001o5-4l for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 06:35:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4aSR-0007mi-1d; Sun, 19 Nov 2023 00:34:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4UIT-0000Hx-IY for emacs-devel@gnu.org; Sat, 18 Nov 2023 18:00:17 -0500 Original-Received: from mail-he1eur01olkn0829.outbound.protection.outlook.com ([2a01:111:f400:fe1e::829] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4UIQ-0002Y3-BJ for emacs-devel@gnu.org; Sat, 18 Nov 2023 18:00:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYpR7lheLV4CQOIrZGrI4DK+sUhhAuNsQZlkuAdCYlyvm06vemcQDYmIvL7dpTVld4ddXsWqxJp9/+zMKmSccou62uIZhJMpmq2I18TmPlte4vdcYsnqGtE1p71MdaBqdyCbNHmHPDoGhrhM/NRanhn+dAu2HObLeT7SW2gJ5K2DPt56VsAy69IYe0OqUNi2F76zEd8TlQ6rcIE89oFbqtHnpMH5syJmlViaZPwMHFrXodO7DmFMqDjBSIjD4p6f6HacBkJ4umZNnOYBYZIBL9fedUusRg1Ow0Z28cTOGBnjgIX5acJ1i1IC4kxB6ADSL1AUYK/Oeim4sc5wpk5XCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vcte2tj5/hQxK5HneBbBMv10IiHrg6VS6Q6FJqR19HM=; b=c+MyfGbjg7bFqbnmCbGCmIdfeFNBJVvjm0SI/T8ypKti4o2EE82CqxAMz4v8TbImwIkMhrVGj8JawPWmotkUHalDKZcwtQaxWJjZ3tLAhxfkpYwj6p7xFP+i0jbQkDd5qkSQMj9D4snNA+sN+x2oXmDiwM+dbJvlRW8ivCLCqBg2f+74ygQeFrHEJmUF38HMibWbiQScHp/B77LGs13YnGIAfBtL9r13lWfvhbN3VaM3fICket+CcSwk5FvwVD45+GdYoQiu+Gz3Mid/lMK5PRaCn9o+NSPpe0HmwZ65F1Xk/sw7HlghJGQYzsCObpPNll+sdZfxHSMqzi33BaMBFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Original-Received: from PAXP192MB1608.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:28c::22) by PAXP192MB1134.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:198::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.26; Sat, 18 Nov 2023 22:55:08 +0000 Original-Received: from PAXP192MB1608.EURP192.PROD.OUTLOOK.COM ([fe80::d4fd:99e8:e147:9752]) by PAXP192MB1608.EURP192.PROD.OUTLOOK.COM ([fe80::d4fd:99e8:e147:9752%5]) with mapi id 15.20.7002.025; Sat, 18 Nov 2023 22:55:08 +0000 Thread-Topic: using ses programatically (was: a ses question) Thread-Index: AQHaDyaIFxl+uTQAXkSovHGVyH2ZGrBrhKoNgABOFwCAAB8A5YAALdsAgBSj6gg= In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [SZb9hwHRR0tCNMBp1AbxRqcZToesJ19T] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAXP192MB1608:EE_|PAXP192MB1134:EE_ x-ms-office365-filtering-correlation-id: c487e5d8-2929-4fd1-9c12-08dbe889698a x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cf3jQAMMPFXaPcUIyGbBc0cy8FACufktUN5/2qSAVfGBdpObfa60FfbeSW1s8R1O+JEdTp/ud6/hagfyTL5SawpbKcs2LzWAYMxteGCOTKPAPtp/xsyBY+SdgwCARss0jQAAFnVCkE4kkjkVU+C2y0gZhkNFeEiMCGmVs+YNZIJqk652iVmx1Rco1RDAJzMmJemPx3Z9yzmaYkAwavsgKnrXJaIZpkjk/s8PfbsQKSYA9GR5J1ubj0wmuILoEzQ7/gLnVh7WpPdnBFAQQiraLHMnrH95bYdQGDcBmhzupp0fiJcK7drNv8nbiBKYQgBCBVFFi08zIw4v0+EuFouHRSqIbgPRctBjXWS7s8NMfh+edmD8l0d8oJeTN1wM9RU91byXuFIWAs8CyITNW6/IBSh9xWJ4OYQCUgYuwM/UFHuy2CfxaEiFHSPhTCFYMgTMGhilM86ep38IBvDgXdNm+brSXXJ3oRyjuqmjNdHzYQ0tIXyyr0q64gWg+ooW0ry3dBkL/qsFqBqmYkShpjCW6WQMld+Yy86WdhqOZD9wRRBTN8sVN6vrRe8JQ8TOcQ43MUIE+vDUDVtZU5T+6chfzNMy9GGh8iMRKo1ugfiEbnQaLsKt4h1RW0GJZPGu2vPVHWf23sXeyx1HQ5gvGvtXQoy3sLlWxHfOFonTSHXfFhraZ5RP+xxKDRUcwLbOzHCwrwPNMyVRtI+kSLly3+1tw3gVJgRmU5wBGEaiCBR3HZaH1dhEHUjjA0IWMd649 27z x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?Gb4l1VSZuDeiIAgEhQf9GXRQOc3yllwOmbssQDSyguhbxWfhi+DFuVGE?= =?Windows-1252?Q?lMxOkUfAZzbbPNwVaYLf6NqiWO0v3IHy6jtu2+PipxMyjP8u7EYJ4ous?= =?Windows-1252?Q?ABMSQnYqS4oavPrA7R0UaQf2PiTS9WB8SfoRCBFndHhxqoPLxgZIK8h8?= =?Windows-1252?Q?/9nuv+BLG4lHIWOg7UB4dm0GtZg0g9XEWWfl7AXdLlC4J4JrrsKR/77B?= =?Windows-1252?Q?celFGL1HS08CfAvkEqs+wCIFBX/sroAeyalMaNFWYAxssdFPBsv62Nf2?= =?Windows-1252?Q?/wzSsZXEbOiT+5DZol5f4M2Zw9bzOWdbbkvJiKOPrfm8o6M/rD7nhY6A?= =?Windows-1252?Q?zHysPpDBva1XzJGLi75I1fbbS5U9aYSHDTzjM865L5e9F42NXLh44Bh7?= =?Windows-1252?Q?5KGEPAu4xeJJvtCMl/fhvUxaUKMngSz3wHE+NGg+nLLEvvj0p2Wtu6dA?= =?Windows-1252?Q?9bZKUXwI8743LFpEGvnIvclGBo4J2oE6hYsK5Kkf+DFpeMuVIQJmJ4y8?= =?Windows-1252?Q?N/755JatAAJ2ihywEChUUXOTgWnhHg/h3pGfApdNv/5M50/ECj7eILO4?= =?Windows-1252?Q?fOPS79d8I2T8eJhgE63Iej4IVYpGwI5Sx4LVRIiG5bCgRev8rBpuSNUr?= =?Windows-1252? X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-fb43a.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAXP192MB1608.EURP192.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: c487e5d8-2929-4fd1-9c12-08dbe889698a X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2023 22:55:08.1518 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP192MB1134 Received-SPF: pass client-ip=2a01:111:f400:fe1e::829; envelope-from=vincent.b.1@hotmail.fr; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 19 Nov 2023 00:34:55 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312942 Archived-At: --_000_PAXP192MB1608A14EB40012864BDD2A6284B6APAXP192MB1608EURP_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Dear Andr=E8s, I attached an updated ses-setq macro. [https://res.cdn.office.net/assets/mail/file-icon/png/generic_16x16.png]ses= .el You can both set values and formulas programmatically. There are 4 switches= sv rcv sf and rcf. The =85v sitches are for setting values, and the =85f s= witches are for setting formula. The s=85 switches are for indicating the c= ell by symbol (e.g. A1) and the rc=85 switches are for indicating the cell = by row col coordinate, (e.g. 0 0 are for A1). Default initial switch is sv.= You can change the current switch with the :: argument. So (ses-setq A1 1 :: sf B1 (1+ A1)) will set A1 to 1, and B1 to the formula that adds 1 to A1, so B1 will be 2. Other examples that do the same job : (ses-setq :: rcv 0 0 1 :: sf B1 (1+ A1)) Or (ses-setq A1 1 :: rcf 0 1 (1+ A1)) I still need more work to handle properly the safe function stuff in the ca= se of setting formulae. In the case of smeter you could use the sf / rcf switch to set any formula = you like in order to compute the result. Vincent. ________________________________ De : andr=E9s ram=EDrez Envoy=E9 : dimanche 5 novembre 2023 20:33 =C0 : Vincent Bela=EFche Cc : emacs-devel ; boruch_baum@gmx.com Objet : Re: using ses programatically (was: a ses question) Hi. Vincent. My comments below. >>>>> "Vincent" =3D=3D Vincent Bela=EFche writes: Vincent> Dear Andr=E8s, Vincent> Concerning the backward compatibility you could test emacs ver= sion in smeter.el to know Vincent> whether the newer ses is distibuted. Otherwise, if not distrib= uted you could have some Vincent> newer ses.el copied to the same dir as smeter.el and change th= e load path in smeter.el Vincent> for this newer ses.el to be loaded instead of the coming with = the older emacs. Ok. Vincent> FYI, I have no idea when I will push to master the ses-setq et= c... changes, and no idea Vincent> when this is in a new release of Emacs. Fine. Vincent> Thank you for the information about the cl-... macros, I will = I have look when time Vincent> allows ... Ok. [...] Vincent> PS : Maybe smeter.el would be simpler if the final sum was don= e by SES rather than Vincent> org-table stuff. Sure. I am thinking a little bit ahead. Why not testing setting formulae on the fly for doing that final calculation? WDYT?. Thank for your help. Andr=E9s Ram=EDrez --_000_PAXP192MB1608A14EB40012864BDD2A6284B6APAXP192MB1608EURP_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Dear Andr=E8s,

I attached an updated ses-setq macro.


You can both set values and formulas programmatically. There are 4 switches= sv rcv sf and rcf. The =85v sitches are for setting values, and the =85f s= witches are for setting formula. The s=85 switches are for indicating the c= ell by symbol (e.g. A1) and the rc=85 switches are for indicating the cell by row col coordinate, (e.g. 0 0 are for A1). = Default initial switch is sv. You can change the current switch with the ::= argument.

So 
   (ses-setq A1 1 :: sf B1 (1+ A1))

will set A1 to 1, and B1 to the formula that adds 1 to A1, so B1 will be 2.=

Other examples that do the same job : 

   (ses= -setq :: rcv 0 0 1 :: sf B1 (1+ A1))
Or 

= I still need more work to handle properly the safe function stuff in the case of setting formulae= .

In the case of smeter you could use the sf= / rcf switch to set any formula you like in order to compute the result.

   Vincent.


De : andr=E9s ram=EDrez <= ;rrandresf@hotmail.com>
Envoy=E9 : dimanche 5 novembre 2023 20:33
=C0 : Vincent Bela=EFche <vincent.b.1@hotmail.fr>
Cc : emacs-devel <emacs-devel@gnu.org>; boruch_baum@gmx.c= om <boruch_baum@gmx.com>
Objet : Re: using ses programatically (was: a ses question)
 
Hi. Vincent.
My comments below.
>>>>> "Vincent" =3D=3D Vincent Bela=EFche <vinc= ent.b.1@hotmail.fr> writes:

    Vincent>  Dear Andr=E8s,

    Vincent> Concerning the backward compatibility you co= uld test emacs version in smeter.el to know
    Vincent> whether the newer ses is distibuted. Otherwi= se, if not distributed you could have some
    Vincent> newer ses.el copied to the same dir as smete= r.el and change the load path in smeter.el
    Vincent> for this newer ses.el to be loaded instead o= f the coming with the older emacs.

Ok.

    Vincent> FYI, I have no idea when I will push to mast= er the ses-setq etc... changes, and no idea
    Vincent> when this is in a new release of Emacs.

Fine.

    Vincent> Thank you for the information about the cl-.= .. macros, I will I have look when time
    Vincent> allows ...

Ok.

[...]


    Vincent> PS : Maybe smeter.el would be simpler if the= final sum was done by SES rather than
    Vincent> org-table stuff. 

Sure. I am thinking a little bit ahead. Why not testing setting formulae on the fly for doing that final calculation? WDYT?.

Thank for your help.
Andr=E9s Ram=EDrez
--_000_PAXP192MB1608A14EB40012864BDD2A6284B6APAXP192MB1608EURP_--