From unknown Fri Jun 20 07:09:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55333 <55333@debbugs.gnu.org> To: bug#55333 <55333@debbugs.gnu.org> Subject: Status: [PATCH] Choose latex environment for table.el export Reply-To: bug#55333 <55333@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:47 +0000 retitle 55333 [PATCH] Choose latex environment for table.el export reassign 55333 emacs submitter 55333 Vladimir Nikishkin severity 55333 normal tag 55333 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 03:04:52 2022 Received: (at submit) by debbugs.gnu.org; 9 May 2022 07:04:52 +0000 Received: from localhost ([127.0.0.1]:55841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnxRr-0004ez-SC for submit@debbugs.gnu.org; Mon, 09 May 2022 03:04:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:59634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nntJb-0003t0-Uc for submit@debbugs.gnu.org; Sun, 08 May 2022 22:40:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nntJb-0001HT-Nl for bug-gnu-emacs@gnu.org; Sun, 08 May 2022 22:40:03 -0400 Received: from public.lockywolf.net ([46.23.90.181]:24645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nntJZ-0002fW-TP for bug-gnu-emacs@gnu.org; Sun, 08 May 2022 22:40:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2021-05-20; bh=LodlYusJV K1dZraC5ODlgKs+ZeMPrPUF15UQKaB9kaE=; h=date:subject:to:from; d=lockywolf.net; b=14Yq6imUfu4fCCCDF9HYvtVOxNJL4FLhDNGGYIYSH7jK5k5WNlU ZFaHOuiAkT6O49Lo+UgH052klCqhP4uSkAeiiiRg5ILxyuglx6LV9X+ikoAer9WA/7q/JV dwJuqjwqlsJ2v9cgolEn5nMB3wIJwXW9g0CLZccysv42TzIGfk= Received: from laptop.lockywolf.net ( [2001:470:24:315::102]) by public.lockywolf.net (OpenSMTPD) with ESMTPSA id 2ec1a2e7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 9 May 2022 04:39:56 +0200 (CEST) User-agent: mu4e 1.6.3; emacs 29.0.50 From: Vladimir Nikishkin To: bug-gnu-emacs@gnu.org Subject: [PATCH] Choose latex environment for table.el export Date: Mon, 09 May 2022 10:30:57 +0800 Message-ID: <87ee13wi72.fsf@laptop.lockywolf.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=46.23.90.181; envelope-from=for.emacs-table.el-environment-patch_2022-05-09@lockywolf.net; helo=public.lockywolf.net 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 09 May 2022 03:04:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Dear Emacs Developers, Please, consider this patch for inclusion. This patch slightly generalises the way Emacs' table.el handles latex export. Currently, the export always uses the "tabular" environment. This patch adds a customize option to select a different one, and adds one built-in suggestion of "longtable", which should be perfectly compatible with "tabular". The patch creates 1 new customize variable: 1. table-latex-environment And changes the following 2 functions: 1. table--generate-source-epilogue 2. table--generate-source-prologue #+begin_src patch diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 2175900194..eafa3e7b3c 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -753,6 +753,18 @@ table-html-cell-attribute :type 'string :group 'table) +(defcustom table-latex-environment "tabular" + "Which tabular-compatible environment to use when generating latex. +tabular and longtable are known to work." + :tag "Latex environment used to export tables" + :type '(choice + (const :tag "tabular" "tabular") + (const :tag "longtable" "longtable") + string) + :group 'table + :local t) + (defcustom table-cals-thead-rows 1 "Number of top rows to become header rows in CALS table." :tag "CALS Header Rows" @@ -3025,7 +3037,7 @@ table--generate-source-prologue ""))) ((eq language 'latex) (insert (format "%% This LaTeX table template is generated by emacs %s\n" emacs-version) - "\\begin{tabular}{|" (apply #'concat (make-list (length col-list) "l|")) "}\n" + "\\begin{" table-latex-environment "}{|" (apply #'concat (make-list (length col-list) "l|")) "}\n" "\\hline\n")) ((eq language 'cals) (insert (format "\n" emacs-version) @@ -3051,7 +3063,7 @@ table--generate-source-epilogue ((eq language 'html) (insert "\n")) ((eq language 'latex) - (insert "\\end{tabular}\n")) + (insert "\\end{" table-latex-environment "}\n")) ((eq language 'cals) (set-marker-insertion-type (table-get-source-info 'colspec-marker) t) ;; insert before (save-excursion #+end_patch The copyright disclaimer has been signed by me and submitted to FSF last August. -- Your sincerely, Vladimir Nikishkin (MiEr, lockywolf) (Laptop) From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 06:05:15 2022 Received: (at 55333) by debbugs.gnu.org; 9 May 2022 10:05:15 +0000 Received: from localhost ([127.0.0.1]:56212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0GR-0007tg-MP for submit@debbugs.gnu.org; Mon, 09 May 2022 06:05:15 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0GQ-0007tS-Ic for 55333@debbugs.gnu.org; Mon, 09 May 2022 06:05:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ITrDIPm8jon4PENI4XEWC/NvQm/lh2qNpzdvCj9qYpE=; b=hhGL5Zv/obwH/c82hnCVkgrhk+ 7DhyZoJynbW6vsXjVir1qQzbwnazgycXDMC/GIfNVK0rUfcY+ekS14Gs39QK3W9kEaGbdhP5zfGVm 2gGFU8X2TR3JJLUh1Q3VhsziwfOF+7JF+A42DYpWe4msQRVvixcfsi9zqCnLAJLjdXYg=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no0GH-0004O5-Rb; Mon, 09 May 2022 12:05:08 +0200 From: Lars Ingebrigtsen To: Vladimir Nikishkin Subject: Re: bug#55333: [PATCH] Choose latex environment for table.el export References: <87ee13wi72.fsf@laptop.lockywolf.net> X-Now-Playing: Blaine L. Reininger's _Broken Fingers_: "Uptown" Date: Mon, 09 May 2022 12:05:05 +0200 In-Reply-To: <87ee13wi72.fsf@laptop.lockywolf.net> (Vladimir Nikishkin's message of "Mon, 09 May 2022 10:30:57 +0800") Message-ID: <878rrbauni.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Vladimir Nikishkin writes: > Please, consider this patch for inclusion. > This patch slightly generalises the way Emacs' table.el handles > latex export. > Currently, the export always uses the "tabular" environment. > This pat [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55333 Cc: 55333@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Vladimir Nikishkin writes: > Please, consider this patch for inclusion. > This patch slightly generalises the way Emacs' table.el handles > latex export. > Currently, the export always uses the "tabular" environment. > This patch adds a customize option to select a different one, and > adds one built-in suggestion of "longtable", which should be > perfectly compatible with "tabular". Thanks; makes sense to me, so I've pushed it to Emacs 29 (with some small changes). By the way, the patch didn't apply directly, so it seems like something had mangled it in transmission. For future patches, it's probably better to include patches as attachments. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 06:05:26 2022 Received: (at control) by debbugs.gnu.org; 9 May 2022 10:05:26 +0000 Received: from localhost ([127.0.0.1]:56215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0Gb-0007uB-UH for submit@debbugs.gnu.org; Mon, 09 May 2022 06:05:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0Ga-0007tr-2p for control@debbugs.gnu.org; Mon, 09 May 2022 06:05:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+YWaHdUVsXYBN1DDBth7p8ccbiiVphz0cFWBh16BHMs=; b=oApVPHYZSJOpOC3YDWHZno/Vfj IESwd0HvHdLwTtT1R8LTKmpJH9M/ThZkWHsnSgFDUqC7z/4P12BBNor8aZ8tJoMxG2K0wCs5LNgQE tXRENapm5Gjo7gvDaTefbE9D+S9+Eox6o/1PBHV/OPgJRe4rnAkM3S5GIPbjxWY5qEME=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no0GS-0004OE-7G for control@debbugs.gnu.org; Mon, 09 May 2022 12:05:18 +0200 Date: Mon, 09 May 2022 12:05:14 +0200 Message-Id: <877d6vaun9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #55333 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 55333 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 55333 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 06:14:03 2022 Received: (at control) by debbugs.gnu.org; 9 May 2022 10:14:03 +0000 Received: from localhost ([127.0.0.1]:56257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0Ox-0008AB-LD for submit@debbugs.gnu.org; Mon, 09 May 2022 06:14:03 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0Ow-00089X-7U for control@debbugs.gnu.org; Mon, 09 May 2022 06:14:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ymM9csSlHmQOQxDFXmB0fWzOjg61dL4c27vL5Jvi4Sw=; b=CWo4GJm5VmWFhG2RkYMWzoO3Gh qkti0QqJq5PcWlZ33n3fK8590Ck0OJDxkalO8oaVYH8Enef5fzSpjP0bwmfURtGFj9RHvYI7WMfUY HqtujIN2b7ZSlMrguwIveKS+nsTNgu5X8Atr0A9QfAS/lhl2Wgjvg0RTtKkzuRGIp2qM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no0Oo-0004Uy-Tm for control@debbugs.gnu.org; Mon, 09 May 2022 12:13:56 +0200 Date: Mon, 09 May 2022 12:13:54 +0200 Message-Id: <87v8uf9fod.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #55329 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: forcemerge 55329 55333 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) forcemerge 55329 55333 quit From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 08:25:51 2022 Received: (at control) by debbugs.gnu.org; 9 May 2022 12:25:51 +0000 Received: from localhost ([127.0.0.1]:56496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no2SV-0004C1-32 for submit@debbugs.gnu.org; Mon, 09 May 2022 08:25:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no2ST-0004Bm-Ch for control@debbugs.gnu.org; Mon, 09 May 2022 08:25:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+YWaHdUVsXYBN1DDBth7p8ccbiiVphz0cFWBh16BHMs=; b=qM74bxEKhNQng/32mSAszCKdJA ygEocCQ2OnQm/ZSpgIgbo2DexVCR1woSFYV31gWGOwt9Epn3vREBFoLUqxCCr3Na80AACMhr5jY+n nv5zogqe4A9gVjqVYBVr7Qcl5Iww5XY01Pl9w54d9Q2FEYZNay0phob3p6X2yNJ8XFEE=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no2SL-0005hM-3U for control@debbugs.gnu.org; Mon, 09 May 2022 14:25:43 +0200 Date: Mon, 09 May 2022 14:25:40 +0200 Message-Id: <87k0au7v0b.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #55333 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 55333 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 55333 29.1 quit From unknown Fri Jun 20 07:09:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 07 Jun 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator