unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: "andrés ramírez" <rrandresf@hotmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>,
	"boruch_baum@gmx.com" <boruch_baum@gmx.com>
Subject: RE: using ses programatically (was: a ses question)
Date: Sat, 18 Nov 2023 22:55:08 +0000	[thread overview]
Message-ID: <PAXP192MB1608A14EB40012864BDD2A6284B6A@PAXP192MB1608.EURP192.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <SJ1PR12MB636308CC0DAD6E0BF11DAF34A6ABA@SJ1PR12MB6363.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]

Dear Andrès,

I attached an updated ses-setq macro.

[https://res.cdn.office.net/assets/mail/file-icon/png/generic_16x16.png]ses.el<https://1drv.ms/u/s!AkDIBBjRAOVwg3PG8zN19RiycfN_>

You can both set values and formulas programmatically. There are 4 switches sv rcv sf and rcf. The …v sitches are for setting values, and the …f switches are for setting formula. The s… switches are for indicating the cell by symbol (e.g. A1) and the rc… 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 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és ramírez <rrandresf@hotmail.com>
Envoyé : dimanche 5 novembre 2023 20:33
À : Vincent Belaïche <vincent.b.1@hotmail.fr>
Cc : emacs-devel <emacs-devel@gnu.org>; boruch_baum@gmx.com <boruch_baum@gmx.com>
Objet : Re: using ses programatically (was: a ses question)

Hi. Vincent.
My comments below.
>>>>> "Vincent" == Vincent Belaïche <vincent.b.1@hotmail.fr> writes:

    Vincent>  Dear Andrès,

    Vincent> Concerning the backward compatibility you could test emacs version in smeter.el to know
    Vincent> whether the newer ses is distibuted. Otherwise, if not distributed you could have some
    Vincent> newer ses.el copied to the same dir as smeter.el and change the 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 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és Ramírez

[-- Attachment #2: Type: text/html, Size: 7238 bytes --]

  reply	other threads:[~2023-11-18 22:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <SJ1PR12MB6363EAEDEA36DA78E736B9DEA61EA@SJ1PR12MB6363.namprd12.prod.outlook.com>
2023-10-29 16:43 ` a ses question Vincent Belaïche
2023-10-29 21:25   ` Vincent Belaïche
2023-10-30  5:43     ` Vincent Belaïche
2023-10-30 19:03       ` andrés ramírez
2023-11-01 19:08         ` Vincent Belaïche
2023-11-01 19:23           ` Vincent Belaïche
2023-11-02 11:20             ` Vincent Belaïche
2023-11-02 11:27               ` Vincent Belaïche
2023-11-02 11:31                 ` Vincent Belaïche
2023-11-02 18:19                 ` Stefan Monnier
2023-11-03 15:54                   ` Vincent Belaïche
2023-11-03 22:13                     ` Vincent Belaïche
2023-11-04 13:46                       ` andrés ramírez
     [not found]                       ` <SJ1PR12MB636334BD471403C3F936BF25A6A4A@SJ1PR12MB6363.namprd12.prod.outlook.com>
2023-11-05 10:25                         ` using ses programatically (was: a ses question) Vincent Belaïche
2023-11-05 14:58                           ` andrés ramírez
2023-11-05 16:55                             ` Vincent Belaïche
2023-11-05 19:33                               ` andrés ramírez
2023-11-18 22:55                                 ` Vincent Belaïche [this message]
2023-11-19 19:24                                   ` andrés ramírez
2023-11-19 23:18                                     ` Vincent Belaïche
2023-11-19 23:24                                       ` Vincent Belaïche
2023-11-20  0:33                                         ` andrés ramírez
2023-12-24 11:51                                           ` Vincent Belaïche
2023-12-24 15:44                                             ` andrés ramírez
2023-12-24 21:13                                               ` Vincent Belaïche
2023-12-27 17:42                                                 ` Vincent Belaïche

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=PAXP192MB1608A14EB40012864BDD2A6284B6A@PAXP192MB1608.EURP192.PROD.OUTLOOK.COM \
    --to=vincent.b.1@hotmail.fr \
    --cc=boruch_baum@gmx.com \
    --cc=emacs-devel@gnu.org \
    --cc=rrandresf@hotmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).