From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pranshu Newsgroups: gmane.emacs.bugs Subject: bug#71364: Fix Table.el export Date: Tue, 09 Jul 2024 17:05:08 +1000 Message-ID: <87ttgznizf.fsf@gmail.com> References: <8734ptj6lj.fsf@gmail.com> <86r0dagv7v.fsf@gnu.org> <87frtpqltu.fsf@gmail.com> <86jzj1f2fb.fsf@gnu.org> <87h6e4jiav.fsf@gmail.com> <86le3gdjm3.fsf@gnu.org> <8634pnemgn.fsf@gnu.org> <861q57el7i.fsf@gnu.org> <87plsqlopz.fsf@gmail.com> <86a5jubkg4.fsf@gnu.org> <86cyo9iadt.fsf@gnu.org> <86cynr55ps.fsf@gnu.org> <87plrqy39e.fsf@laptop.lockywolf.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28440"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 71364@debbugs.gnu.org, rrt@sc3d.org To: Lockywolf Laptop Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 09 09:07:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sR4wc-0007CF-EG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Jul 2024 09:07:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR4wF-00052T-2N; Tue, 09 Jul 2024 03:06:59 -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 1sR4wD-0004vT-8U for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 03:06:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sR4wD-0008CU-0L for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 03:06:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sR4wI-0001Kw-9K for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 03:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pranshu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2024 07:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71364 X-GNU-PR-Package: emacs Original-Received: via spool by 71364-submit@debbugs.gnu.org id=B71364.17205087875088 (code B ref 71364); Tue, 09 Jul 2024 07:07:02 +0000 Original-Received: (at 71364) by debbugs.gnu.org; 9 Jul 2024 07:06:27 +0000 Original-Received: from localhost ([127.0.0.1]:52028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR4vi-0001K0-R2 for submit@debbugs.gnu.org; Tue, 09 Jul 2024 03:06:27 -0400 Original-Received: from mail-pl1-f180.google.com ([209.85.214.180]:42074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR4vg-0001Jl-Ku for 71364@debbugs.gnu.org; Tue, 09 Jul 2024 03:06:25 -0400 Original-Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1fb0d88fd25so31141075ad.0 for <71364@debbugs.gnu.org>; Tue, 09 Jul 2024 00:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720508713; x=1721113513; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jcouLXIaj/INYX9UTNJppW/U+Ep5WM6t6Cg9HzYyMxo=; b=l6YCZ3LdfRyRwBmiEdUFp7Y+YHBXys0wYX70H1LDjF5cY1rt4VC/1YQlBTuFQuHn+n Otw+SaapiHOzKQEHsHcJ9G5N+Mu0+5jqFvzJpxCK5z2FnDnLBsj+me4ugAAj6Wnc6o0S wYPsjYbssOWr9DHbgQKplsYxutVHMUUF3RdnszZSb+Sch4KK+JJdPmAxSmPlisAWZlhF yS68OKQPr4Fituft0c7H74uO7+BbPxsh8oKDJehH74Lvja3YjwTOmVxyeFOW8BQG73vt 8kYOnxYTMck2fYhtribR6gNTPzEvWv2qal/OldYkI57BOYqHZPZBi/qRLyNVgoCYzxqT o4Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720508713; x=1721113513; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jcouLXIaj/INYX9UTNJppW/U+Ep5WM6t6Cg9HzYyMxo=; b=kNUe8F8yaps263sLgXogiCf1r7L6547SeVcyZ0EdELi5SqKSMTvSWFn3C9aqgpmOkj snyxH57rb76ITRyTvqyihBEbkGvnTlc4FfMPWcjMe9HcElxIA/3p1GFut8vR+M0xocdN q4g97FpsatBUX5/BRAYuTgEn1hRbS8WbnlLHOA6Jq9yEeaxyDSxmRWgKSrMRWfsiJUNT /FQVA71nRu/AVs8m+8/2E3sr4gadJLeZh6KuXpBskYSkwhz9O1OIiqF1/mAoNUjtcS4x IvF99XyaOwBZy69T6HqtuTkgIToqJJXssC2trUxIMiTb+dGi4e3oRstlaM5etJoGmkah 937w== X-Forwarded-Encrypted: i=1; AJvYcCWcV97wWCgWgyghPE8zB3QmAtUMLXk1hdGlR9M4/nTFw4nUQ4gTLAOJO9ZOY44OTZBLxU35Q8zndbsLRtv7lrcEvEYzWzk= X-Gm-Message-State: AOJu0YyevqQQVGVurD7kLDXLyXvrQA0+Ney+Fm4+7l6zFN43XF5Shoam EOQkstKEm33vAgqPSsRZri/9fEx4PJ/GJfPntd+rFxc4tuK/UAss X-Google-Smtp-Source: AGHT+IF0oau+7G1mlWQFg++EaHnpdMGgxyc3Z/LHt8GTTxeg95FwcZ5Hdiotl/utXM1CxU0pmyqbCA== X-Received: by 2002:a17:903:1ca:b0:1fb:15ff:8499 with SMTP id d9443c01a7336-1fbb7f3c2d0mr20184445ad.4.1720508713216; Tue, 09 Jul 2024 00:05:13 -0700 (PDT) Original-Received: from pebl ([2001:8003:7816:8300:7f15:5962:16a0:6470]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ad5172sm9098305ad.285.2024.07.09.00.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 00:05:12 -0700 (PDT) In-Reply-To: <87plrqy39e.fsf@laptop.lockywolf.net> (Lockywolf Laptop's message of "Sat, 06 Jul 2024 22:00:45 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288621 Archived-At: Hello Vladimir Lockywolf Laptop writes: >>should or should not expect LaTeX markup > > How much of LaTeX markup? > What if you add some mysterious \makeatletter there? > My idea was that the default should still be that all latex specific charecters are escaped by default, and the variable is customized by those who know what the specific function or markup does. > > If I may, I would ask Mr Pranshu to spend a bit more work on this patch, > and do some straightforward, albeit a little tedious work to make this > patch more pleasant. May I? > Yeah sure, but not rn. I am kind of busy for 2 weeks, then I will be able to do it. > 1. Add a check to table--generate-source-scan-lines, which would > actually check that the variable _language equals to latex, and bail out > if it is not. Silently doing export to latex if html output is requested > is even worse than politely refusing. Is that really neccasary, because all that the function does it latex specific. Why not just rename the function to something latex specific, eg table--generate-source-scan-lines-latex. > 2. Implement a defcustom table-el-cell-export-function-latex, which would be > called on each cell. > 3. Implement a default value for this function, which should basically > amount to factoring out the code already in > table--generate-source-scan-lines. This way nothing will break. > This function maybe called table-el-cell-export-latex-default > 3. Implement a copy of this function, with support for additional > escaping tricks needed by Mr Pranshu. It can be called > table-el-cell-export-latex. I do not think that a special defcustom > for the regexp is needed, because such export functions can be expected > to be written by people who need them necessarily in an ad-hoc way, and > customisations might not be well described by just a regexp. > > It is a bit of work, but at least it will add some necessary extension > points. And org-mode, when exporting to table.el used in org files, > could override that cell export function to its own benefit. > > (By the way, I haven't checked, but probably org-mode already has some > additional support for exporting table.el? I remember successfully > exporting org-files with table.el tables into html, which is seemingly > not supported in table.el itself.) I haven't really played with the html org export, but as of now table.el does have an html export. All org mode does is calles the appropiate export, so it does no sort checking text inside the table. For example you cannot do org itallics, citing, and any of that stuff inside the table. To change this I think table.el would need a major rewrite that allows for something like your idea of having a function called to all of the text inside the table. Instead of just improving the latex export and leaving the others in the dust, how about we do what you suggested, but instead of having seperate functions for each export, we make the exports a list. All of the table exports basiclly do the same thing: - Add some header text - Replace column and row delimeters - add end text - optional: escape text Honestly I think table.el is due for a rewrite, if you have used it before yk what I mean, on average it's about half a second latency to type one charecter. Personally I think that instead of having a table.el version of every basic command, eg self insert, kill line, it would be better to add a post command hook and do damage control depending on the last command. Kind Regards, Pranshu