From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sEJLCNE82WRf9QAASxT56A (envelope-from ) for ; Sun, 13 Aug 2023 22:28:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qAkyCNE82WQbfwEA9RJhRA (envelope-from ) for ; Sun, 13 Aug 2023 22:28:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8E9F84B80F for ; Sun, 13 Aug 2023 22:28:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=LK0660qf; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691958481; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ViE6H/9Z722IT4ZPtGmP2nm3SbQOhgZ/yFZ3Q2jneDE=; b=b+SAzLRtZMR0uQAX+JMzMtKZUOQ6hvfyK9tUz02wLqqEu7a4lo0zZBsUXr5OX5m7msUnLf R2Zz4aqJZd5q6vEl8/jSKroIb/zmv0/muNWM5qQx5ve0PvyH1r29mInKB9HrRKycmEBS1o xZ88qoNaFt+vYK+ZaO7xhRfLtmeIT0RO5hHNFs3pXtmQj5PKfiHBNog4cmixdFHVa21Bu7 7Y/o8LwYiSk3DChvNoz6Py6j0n7X7ulmpcPKJDedmXzdxFmea+vT8X/sX+ugIyD61Q8zqG +4Hzyi+49a2X41v9K1QrGnRzw8JeMB5++YeRnADZ8p6nItsJPmwiwE625469JQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=LK0660qf; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691958481; a=rsa-sha256; cv=none; b=udULVIrfebnLUGuQuS0LAobvn/NtfcbxIq9Pl14WH6a5EMwTkKSACg9Tozcnqi//dNCQ8p DM3T01yQSWWD0QGhNFpCdFqLPEfv9UG1ltahkdbGEAUnfd4sF0fvc2/KE9tmOKe9EAQHmZ EGS45wV5ASHQkgWbJ/MOtaJTAaEshRUD+ZAEPlgJYYNDWH2Nx1u+OAwkTlIqH2nUr1CAK1 oxk3JizaqxlLlZc/FS/6M0R+CtU2kucFaetYjLxtLAG1JAe9J5qknswbNYHMArpZun8ore J7VT3EuBsdylvwdpxKz8uuoILjmkWcnenipYe/iwoEwN1SdWcjogLD4p/Rgp6w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVHg2-0006xU-85; Sun, 13 Aug 2023 16:27:06 -0400 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 1qVHfy-0006xF-Hh for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 16:27:02 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVHfw-0004St-80 for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 16:27:02 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bdb7b0c8afso12299135ad.3 for ; Sun, 13 Aug 2023 13:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691958418; x=1692563218; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=ViE6H/9Z722IT4ZPtGmP2nm3SbQOhgZ/yFZ3Q2jneDE=; b=LK0660qfC6orpF+EIyV1CFLaZ5piYWacRtc0Hw2oH674S4HPK+0aY+/j/X3d2guZ6H Qf+RhpTDugAEVlYd+FBARYfuihIoPWO3lR9pHi3vBJX8Xr6Q77WWjt5Cer6cpjOAd8wD ZWoVr1XKR0+KQkA46B1Cxtp+sjXuBULuHp0IPoLHfwuwRvStNMWK8xdh4GIX4rnqW4Z/ XclvqANRMyJmo5nCx1HyflKZAFnTkPKD0/hCfv6bWOwgKGRYBKozpnuP/2CZVp7HS4Bh i0g7lzaBuGnu/8nCvo2sITYTtUFLvo0xCv+F58DcjtODsjy8ptBbXWMw/kDshCxFClFh 1Bzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691958418; x=1692563218; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=ViE6H/9Z722IT4ZPtGmP2nm3SbQOhgZ/yFZ3Q2jneDE=; b=c/ZvzBLFGlQJAa/y/6RxwJkpPp5sySaU1kkaHL3WbvFruVwiY1C13TCLluHilsPbL7 Eiwhd9p1zT+nXj4Kv54UzJAZOvztpKu+OJD2pLmykxrirczLOn8terN/AlTf2d5h+ZVF tw0wOzNMZ18ngCY20Yyt5XT1aNh/iwxz2OW0ibEXNBTHHU+qm07QclDgXQ0Rc8U//3Dc 31z/+6VRy6BaEiuczGlSLaPEVrsmyY5ueO+pIrWrFyq+TaRrHXhJTMdbIU/pSKT/NS5h ndFCMqNH1iTtoZytupK3D45tvRPnIbuf72tI9hhN101HlPTKSYycTeUVT3vA473Y/ZRP 9gNg== X-Gm-Message-State: AOJu0Yx3lRkSwei2u+wyr7qO9NuHG4MGEEWqJIH2UVnVDSwFtpKqa4xL HBQVzEEI0tMTmDCLn7yp0hzJ6dpnpLA= X-Google-Smtp-Source: AGHT+IGAoW8HVMKadQboN9fudqRr9YNvkIjDYNsyKSeLFR+tYh9JkOBYiK3RTw4zLD8fY4O7S469YA== X-Received: by 2002:a17:903:41c5:b0:1b5:64a4:bea0 with SMTP id u5-20020a17090341c500b001b564a4bea0mr9116236ple.10.1691958417457; Sun, 13 Aug 2023 13:26:57 -0700 (PDT) Received: from [192.168.1.130] (222-154-28-155-vdsl.sparkbb.co.nz. [222.154.28.155]) by smtp.gmail.com with ESMTPSA id d11-20020a170903230b00b001b8af7f632asm7800558plh.176.2023.08.13.13.26.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Aug 2023 13:26:56 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------0RfVAdhvrS46HGI3p00yQHTO" Message-ID: Date: Mon, 14 Aug 2023 08:26:53 +1200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Passing table to Ruby session Content-Language: en-US To: emacs-orgmode@gnu.org References: <980379b9-3b1c-7671-839a-60fa488eed7c@gmail.com> <87350so731.fsf@localhost> <69e49c6b-62fe-f49c-2ac3-b1a57d2dea73@gmail.com> <7521f7c2-e3f0-6877-158c-0977620e06d1@gmail.com> <87o7jfb6td.fsf@localhost> <87pm3ut3zi.fsf@localhost> From: Mike Gauland In-Reply-To: <87pm3ut3zi.fsf@localhost> Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=mikelygee@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 8E9F84B80F X-Migadu-Scanner: mx1.migadu.com X-Spam-Score: -6.56 X-Migadu-Spam-Score: -6.56 X-TUID: As+zgoLTTw/m This is a multi-part message in MIME format. --------------0RfVAdhvrS46HGI3p00yQHTO Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/08/23 19:47, Ihor Radchenko wrote: > On Org side, the best we might do is splitting the long command into > multiline (if ruby REPL supports line continuation like \ this or > similar). Of course, it will be a workaround. I've redefined org-babel-ruby-var-to-ruby in my init.el to add a newline after each element in an array, which I think will work for anything less than a 4k-long string. Ideally, the hard-coded \n would follow the EOL convention of the buffer, but I haven't gotten that far yet. (defun org-babel-ruby-var-to-ruby (var)   "Convert VAR into a ruby variable. Convert an elisp value into a string of ruby source code specifying a variable of the same value."   (if (listp var)       (concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var ", \n") "]")     (if (eq var 'hline)     org-babel-ruby-hline-to       (format "%S" var)))) --------------0RfVAdhvrS46HGI3p00yQHTO Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 11/08/23 19:47, Ihor Radchenko wrote:
On Org side, the best we might do is splitting the long command into multiline (if ruby REPL supports line continuation like \ this or similar). Of course, it will be a workaround.

I've redefined org-babel-ruby-var-to-ruby in my init.el to add a newline after each element in an array, which I think will work for anything less than a 4k-long string. Ideally, the hard-coded \n would follow the EOL convention of the buffer, but I haven't gotten that far yet.


(defun org-babel-ruby-var-to-ruby (var)
  "Convert VAR into a ruby variable.
Convert an elisp value into a string of ruby source code
specifying a variable of the same value."
  (if (listp var)
      (concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var ", \n") "]")
    (if (eq var 'hline)
    org-babel-ruby-hline-to
      (format "%S" var))))

--------------0RfVAdhvrS46HGI3p00yQHTO--