From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ag Ibragimov Newsgroups: gmane.emacs.devel Subject: ASCII Tables with row and colspans Date: Thu, 12 Oct 2023 16:05:08 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23830"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 12 23:05:56 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 1qr2sW-000625-Lz for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Oct 2023 23:05:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qr2ru-0005Jg-Lb; Thu, 12 Oct 2023 17:05:18 -0400 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 1qr2rs-0005Ie-UD for emacs-devel@gnu.org; Thu, 12 Oct 2023 17:05:16 -0400 Original-Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qr2ro-0000YK-Kv for emacs-devel@gnu.org; Thu, 12 Oct 2023 17:05:16 -0400 Original-Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1e9d3cc6e7aso258191fac.2 for ; Thu, 12 Oct 2023 14:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697144709; x=1697749509; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=WQJFk6zYQ8EWvvvZo0hY7RVQ07jeaPo4uCSWntyG3bo=; b=ZtpN/1i33F0kdd6BYKkkcETWwiV4edt70apJecaAH8sgUNEp+ieJTBA0HtuROyto8z wbnpq6eTd8+OGQynHDQvpWRETtimWpPYVG/f3TWplzBGDv0w1xkbdcXOLgLePIjfqwFY eKHszXtge44D/vLUKM9C7GzUL/q3suXEv56z4mMuzYpaJZr4hGrwIB+kSA1HYp7Id8LV ccfEk7+NLyvwecogldYZ+L5LMc1M6ZWX66wzjjdEoYE0VS0rppcZYRGtGf3OkLvKwxmP gTQJuunJ9HVFRl626Qh+VEEWstrODiNLS/lu90eo18L6cV3637oDoSdWQTuWubLcCygv 8k4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697144709; x=1697749509; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WQJFk6zYQ8EWvvvZo0hY7RVQ07jeaPo4uCSWntyG3bo=; b=XC1sIed3MEhLEo6X6LbgvbysJ3ena2Kq2wUMY34qVFo4F6H6IBYDMKxZnsCmijMvpf kdRflzK8r21cE5OOjf5jPTJjzIvHTCQJLkzVao62yQJ4psYUyzj1ydRS98lteZ6rsh94 CfSVCHjGhw20nelSQr8faAXngU0lNLCypK3IclQbG5gJlhYyA0gxyqt/8Ia8ZDcXAnaC ntfETZDFqRbu4sefn+41IQVM+NugPIos71jxx7387j27qeRLgfOse2+1zYMiyLG+E59f YgI9LtMpX5mQNoAsx/BJUJ7TG7We4bAk4+0y/bsFF7JCWYYKzJN7vICdnk6+FCuI64Kc 3E6w== X-Gm-Message-State: AOJu0YxhlNqkm2Q+Xv1AVFira+49FuP6DqVZ80/TbaWQDyoa0eNGkACq szjBM3VZVeV/SzY8JYVBGDP+SyJJAUA= X-Google-Smtp-Source: AGHT+IH7Eu9F4FrNIwyPp5x4+55gmHyz83jecMrCRIqm0qCo1grqtsXtUpsWSk0MkPIfW41kehS5lg== X-Received: by 2002:a05:6870:671b:b0:1e9:8a35:863a with SMTP id gb27-20020a056870671b00b001e98a35863amr8043311oab.20.1697144709598; Thu, 12 Oct 2023 14:05:09 -0700 (PDT) Original-Received: from trabajo ([99.97.209.112]) by smtp.gmail.com with ESMTPSA id eg44-20020a05687098ac00b001e9dabc3224sm45060oab.50.2023.10.12.14.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 14:05:09 -0700 (PDT) Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=agzam.ibragimov@gmail.com; helo=mail-oa1-x2a.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, 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-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:311420 Archived-At: I've driven myself into a self-imposed headache. I need to render an HTML table (Elisp representation of it, result of libxml-parse) in ASCII. Org-mode tables are notorious for their lack of support for spanned columns or rows. Yay, table.el can do it, it's nice for inserting a table and modifying the content interactively. However, it's not really suitable for filling out a table programmatically. There's a `table-insert-sequence` command in table.el that allows you to insert text into a selected cell while automatically adjusting the table, but it's agonizingly slow to call as a function. Sadly, table.el doesn't seem to have a function that could "adjust the table" the way how `org-ctrl-c-ctrl-c` does in org-mode (which, again, doesn't support spans). Like if I have something like this (that's a parsed example from the Wiktionary): '(table ((style . "background-color:#F0F0F0;width:100%") (class . "inflection-table")) (tbody nil (tr nil (th ((colspan . "2") (style . "background-color:#e2e4c0;")) "infinitive") " " (td ((colspan . "6") (style . "text-align:center;")) "conocer")) (tr nil (th ((colspan . "2") (style . "background-color:#e2e4c0;")) "gerundive") " " (td ((colspan . "6") (style . "text-align:center;")) (span ((class . "Latn") (lang . "ast")) (a ((href . "/wiki/conociendo#Asturian") (title . "conociendo")) "conociendo")) " ")) (tr...) (tr...) (tr...) (tr...))) What's fast and easy way to render it in ASCII?