all messages for Emacs-related lists mirrored at yhetil.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>
Subject: RE: a ses question
Date: Sun, 29 Oct 2023 21:25:15 +0000	[thread overview]
Message-ID: <PAXP192MB1608A59C34C202976990193484A2A@PAXP192MB1608.EURP192.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <PAXP192MB16087BA5697F0AF5B7F2E1DB84A2A@PAXP192MB1608.EURP192.PROD.OUTLOOK.COM>

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

Just to complete my answer, if you do not want to rely on SES to do formatting output (with cell printers), then you can retrieve the computation result and format it explicitly with some code like this (not tested) :

(let ((range (with-current-buffer the-ses-buffer (ses-range A1 C3 ; adapt to your case
                                              *2 '>v ; use 'v> to read columnwsise
                                              ))))
  (dolist (row (cdr range))
    (dolist (cell (cdr row))
      (insert (format "%f" cell) ; assuming all cells are floating point numbers
            "&" ;; if & is the column separator
            ))
    (insert "\\\\\n"; if \\ is the row separator
          )))

________________________________
De : Vincent Belaïche <vincent.b.1@hotmail.fr>
Envoyé : dimanche 29 octobre 2023 17:43
À : Andrés Ramírez <rrandresf@hotmail.com>
Cc : emacs-devel <emacs-devel@gnu.org>
Objet : RE: a ses question

Please wite to me directly also, because I am not actively following the list.

I think that the issue is that you collect the result of the computation by reading the text in the print area. The print area is refreshed in a deferred way, and this is why it is not up-to-date when you read it with a buffer-substring call.
You need to call ses-write-cells before doing that. I have not tested it.

  Vincent.

PS : you can set the cell value by just doing something like (setq A1 "value of A1" A2 "value of A2"), that will work for setting the input of the the computation, but the undoing won't work, and you will need an explicit ses-recalculate-… to trigger the computation. Also this is probably not futureproof because I intend to change the way how the ses cell value are stored. Maybe I should create a ses-setq form to do that. If you set the input as you are doing, I don't think that the ses-recalculate-… is needed, but if you collect the result from buffer-substringing the print-area you will need it.
________________________________
De : Andrés Ramírez <rrandresf@hotmail.com>
Envoyé : lundi 21 août 2023 12:38
À : Vincent Belaïche <vincent.b.1@hotmail.fr>
Objet : a ses question


Hi Vincent.

In case You are not following the emacs-help mailing list. I am sending You the link to the mail message.

–8<----------–—cut here----------–—start--------–—>8— https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3ASJ1PR12MB6363267DB30BCE80E678BCFDA61EA%40SJ1PR12MB6363.namprd12.prod.outlook.com&submit=Search%21&idxname=help-gnu-emacs –8<----------–—cut here----------–—end----------–—>8—

Best Regards

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

  reply	other threads:[~2023-10-29 21:25 UTC|newest]

Thread overview: 27+ 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 [this message]
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
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
2023-11-01 17:07 a ses question Andrés Ramírez

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

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

  git send-email \
    --in-reply-to=PAXP192MB1608A59C34C202976990193484A2A@PAXP192MB1608.EURP192.PROD.OUTLOOK.COM \
    --to=vincent.b.1@hotmail.fr \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.