From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WBLxIdQjZmOuHgAAbAwnHQ (envelope-from ) for ; Sat, 05 Nov 2022 09:50:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cJfvIdQjZmOFgwEA9RJhRA (envelope-from ) for ; Sat, 05 Nov 2022 09:50:28 +0100 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 70B681F4D4 for ; Sat, 5 Nov 2022 09:50:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orEri-0003Qz-S4; Sat, 05 Nov 2022 04:49:23 -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 1orErZ-0003Qf-5X for emacs-orgmode@gnu.org; Sat, 05 Nov 2022 04:49:14 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orErW-0005Ka-VX for emacs-orgmode@gnu.org; Sat, 05 Nov 2022 04:49:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E0AFD240027 for ; Sat, 5 Nov 2022 09:49:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667638148; bh=lYIExR1aB5cHMl9sZWWr9m9CcWaTJVFVDc970Rbys3o=; h=From:To:Cc:Subject:Date:From; b=B1HYxQtHF5aIXYkcSzqSyZrgXSumlSQxKAdSPgvrRWRA3M8vfUjc1mim6aWGSNN/a Up4SefqHVTyuodICUq/O2dcLd6kyeHyssbBRIHP9xbkJ1swQsWGJavEK1RtYagcZZR vHul0vzMheGu0afakg9E6E6styFGiypZkMLXSD2OQspSxKHLinzESLgZ9KQE4XXeNa /W3a20oPht59Sa5eoe/m+0Q5nKi55GvW05mtT5YrcYm4Ql74jSGnayRZIV2SlYaD9b LdGg+BhDnWh9/4ByvdCpa47uMKBGZm+AlgBSMmzuiEl2mhRqpkem13p1Ie/KUQrZap 9CUhNkFG5AJ/A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N4B4J1kvCz9rxM; Sat, 5 Nov 2022 09:49:03 +0100 (CET) From: Ihor Radchenko To: Heime Cc: "emacs-orgmode@gnu.org" Subject: Re: Inserting tables programatically in elisp In-Reply-To: References: Date: Sat, 05 Nov 2022 08:49:43 +0000 Message-ID: <87y1spkcpk.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de 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, 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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667638227; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=55uX8zWgH/fa4x15j7tVzduLs1kOP+2WfDKREGtR4Ss=; b=YEjfnhnGfL6vFJfJo+rL073LFub53yDoOWrPoiZ2ep0vf8HFKnPgDoIDwMZWBFCMSUJKpY KSS1wKgNYrNEu0z26BHTloXp4lZg/l6iOZP+6aMtoy8JYOFLNYhfai/pYXarYzEyIkbnXD SaPGh87cSxIOJ/ka/+sLBJAFMO8q5Yq/sJvZJLTmoKlngfGLiBf2Cqd4qJyGSdJq34IUPL G3Z330ft0DXc5ZEHz0gLfhagPxbS3cbttAiOED7TlsiqkxGLo0g+7qFnnb8bXBuDBpxiJv IhlzZUqjadVdhQhthCoLIULU5TLccJS/AyyJw63qAgCNLHq0wqVfGzuKzOSdgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667638227; a=rsa-sha256; cv=none; b=QsSnRpRbKBwW9hYRHUWUOZtaNZpgWsIrzzOV8JkcmKq9JH3cF2ZxpfPY8Rnsb2rMgdXZJ2 1bg1wPK++EDdV1EPVGRAgCEPYPsKVI/TJ3UQKmt46XDvNZ3HhCl/BS1j3xfA9tpkQFlALi ibe5N7nxaLQlcWNLQixS6233cgtTpiIrB9b+S2f86/9K/s7o8GEMFlfs5BfE098noPPlGd oShqjiugCH/++nlc0eBoU8/9WVYGfA8K0Mv9rUuFLEexqVJVJeWzk1X41E91gjs2H58Gbv cbGKXSgrT/g9TQa5vpB4LGqVQVErYYypOOCAPNEyJYIBEI37Bvg9ade+NeawmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=B1HYxQtH; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -2.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=B1HYxQtH; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: 70B681F4D4 X-Spam-Score: -2.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: gJA5e3zC/zkl Heime writes: > Have constructed this function, but the difficulty centers around > the challenge of inserting text in specific tests. > > (defun make-table () > (interactive) > (table-insert 4 5) > (table-forward-cell) > (table-insert-sequence "icomplt-horz" 1 1 1 'center) > (table-forward-cell 4) > (table-insert-sequence "icomplt-vert" 1 1 1 'center) > (table-release)) > > It might be that "table.el" was designed under the assumption that the table would > be edited interactively rather than from ELisp. The lack of info may just reflect > that nobody has thought about it making tables programatically that also goes beyond > its utilisation in "org-mode". You can call functions interactively from lisp, if needed. > I understand that "Org" cooperates with its author Takaaki Ota, perhaps things could > be extended in a way that makes inserting tables programatically much easier to work > with. Do you refer to things on table.el side? Then, you may have more luck asking on emacs-devel list. As for programmatically inserting native Org tables, you can always construct table AST via org-element-create API and then insert it via org-element-interpret-data. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at