From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MBrQDW3afGLQ2AAAbAwnHQ (envelope-from ) for ; Thu, 12 May 2022 11:59:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CHrVDG3afGL+7wAAG6o9tA (envelope-from ) for ; Thu, 12 May 2022 11:59:09 +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 7D2B710903 for ; Thu, 12 May 2022 11:59:08 +0200 (CEST) Received: from localhost ([::1]:52980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1np5b9-0006mm-NB for larch@yhetil.org; Thu, 12 May 2022 05:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np584-0007qN-OP for emacs-orgmode@gnu.org; Thu, 12 May 2022 05:29:06 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:43611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1np583-0006tl-7A for emacs-orgmode@gnu.org; Thu, 12 May 2022 05:29:04 -0400 Received: by mail-pl1-x634.google.com with SMTP id i17so4316819pla.10 for ; Thu, 12 May 2022 02:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=+G+cyUO7b3u1Kw4GmeCA8gR4EIke3YGOA4ztp7NdoYU=; b=PuN271Zp9v+THbHgNds2m+ytqA73Ju0c7iGRVOhq3LCuY27vlPnIjDOd+BPUuoRBYI sGwcM43G/Tl4knNf6iKDzIZieDhSf44EsEMfAvO+/l2Ynv48w4eYxJWHQV1x/vdg8viY ln18ttDRK63a6z6k9w9Qnm/HSkNm4+2CCjz2C5zH41mxG1iuqKVWAjLTgi1ibMNu0Q0m EMZ0jnSGWabVoQLt97tu9c4LKwEeoXt0DKxz2FfcCIpX6sjKJnAtUTcXHtKOO5UWZZEN 4kBkfM2P7l3274jnH+d/pNvfQPffHH0CFR1UupUdW3F/RmSRjkHL7wD5dyzGUWpgVYjo 3WYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=+G+cyUO7b3u1Kw4GmeCA8gR4EIke3YGOA4ztp7NdoYU=; b=cj7uI1wv3oNuS6nZbJoTV0xw6//ec4KOYihAYRvWJF1C0z7Do7lKbFgG4fhSbCvxOi tWre2YH7NzNrH/+v6xn8LBnf4qgHciEUmcryuIIJ+awEmey6tm0qovUGCIrGXsfOkp+e dlQSc2GnwquoBr8Y5isKvom86TtLcMUM7DVNpXsf1bh1lx+1EQ8BAs6oXYgEdCrM1iVg rJcHQTtarUYmPAsWOZ1TZw+wFtDbHRcgg8plMjE0s4QRDZ0AFJSG6XcmG435FPjQIT/I F4EL91riWonecuVlaItoDBcvVBw/jx8o75vVXPga1Pp/5RjItsIMFnoZ1CiSFy/eX/MQ NfvQ== X-Gm-Message-State: AOAM531oj8RV+n0g1odxl6Ji0UqlujZrAADFsNFtI6FpsOoZ3pQp0/67 AqwYa36/QPosMaN6XXEyie0= X-Google-Smtp-Source: ABdhPJx6KVY5+yIATbY3GI4u7dY+0LunWwUK3DSPIKo5cKSeSW5dAFjoctkVFwWEX7Zqy0IkVXzwTQ== X-Received: by 2002:a17:903:292:b0:15f:171:e794 with SMTP id j18-20020a170903029200b0015f0171e794mr22275027plr.107.1652347741906; Thu, 12 May 2022 02:29:01 -0700 (PDT) Received: from localhost ([37.120.210.2]) by smtp.gmail.com with ESMTPSA id l7-20020a170902f68700b0015e8d4eb2e9sm3567560plg.307.2022.05.12.02.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 02:29:01 -0700 (PDT) From: Ihor Radchenko To: Pride Allman Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] lisp/org-table.el: Use booktabs on org-table-export In-Reply-To: References: <87a6bojm73.fsf@localhost> Date: Thu, 12 May 2022 17:29:46 +0800 Message-ID: <87ilqbhzed.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=yantar92@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652349548; 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=+G+cyUO7b3u1Kw4GmeCA8gR4EIke3YGOA4ztp7NdoYU=; b=bRofoV3RxYjqQiWyEnFYrDqPUk/iuJa8ZTLUQ3kL4kUI2EwVlWsZQWOZhLwAgKqWpZVyEd Cx4D99t2FZPnPlWbVxgu8S59g3fDlsWiq89quQbTaBbhfFDX+8LN+CZqQCAlCKjF8sTIKp ydlg3u6+78+CJ4RoSBrz1A40IYgwsOD7DHFxFPJJfQHj8Msfb574NI3xGa7MTWBkAPvsc0 QAm9pE/BBOqPM6/N/5XukKJmhc/WRGGiyp5CywxMT9o9S9dS3fay8YuZ9HFPEJ6ZUsQZZy p/LzRpU2VXIfBEnCnPRW34NupQ+r8Tun6OCmw8zes6Lsic1i1PS0Ct5ak6Zc8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652349548; a=rsa-sha256; cv=none; b=CLAiiEcRmZfwoom0/ja2FQts4GheLY7IBDwCGgGQ2hvTrekmwXjMVMr7uwmJdcyDFqzK1c 1QArFJLsLGlTEPhwWEwxX23N7fOdZIfI1drqq2STwIkOjpdS1PehrBY+3GE79hAAvGwD6S BQDWQ7B3FawqkcMvLDQm9Wn3N2nAxCG9jb2e3pRo+nkHtymuKgGumQcJjjS3zlpvaaKm5B 4kOpFIQ5lPjRcJbC4d3avNIN2c30MMWeek5StQ5I24wZoZt3hMeyokR8DYP7MoBPJZFmGe tkF24sKv1rqsFHiAIyMg+qbecog4Sff1snonk4tyvEbU8DbWy/EvKoovKQpmSQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PuN271Zp; dmarc=pass (policy=none) header.from=gmail.com; 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.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PuN271Zp; dmarc=pass (policy=none) header.from=gmail.com; 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: 7D2B710903 X-Spam-Score: -2.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: /YXbgoGTB8ba Pride Allman writes: > So basically, the export function is doing the overwrite for user options > but to reduce the number of inconsistency we can't use this patch for only > one such option. > > Now you explained it I can't think of a way to solve it without rewriting > the whole thing. Or maybe I need to read the source code more deeply. > Would it be too much to hope for it to be integrated on the basis that > things like this can be added for other options in other export backend > too? Or somehow introduce the global settings there. As an option, the override arguments can be factored out into defcustoms. Then, you would have an option to deal with the problem you encountered. Another possibility comes from the fact that the overrides are mostly copying the defaults or trying to transfer alternative option names into export options: (list :backend 'latex :latex-default-table-mode 'table ;; <- this is default :latex-tables-centered nil <- this is _not_ default. The current default is t :latex-tables-booktabs (plist-get params :booktabs) <- default is nil :latex-table-scientific-notation nil <- this is also default :latex-default-table-environment <- default is "tabular" but :environment is transferred (or (plist-get params :environment) "tabular")) Then, we can: 1. Remove options directly overriding the defaults 2. Do not assign :latex-tables-booktabs and :latex-default-table-environment unless :booktabs and :environment options are actually provided. Currently, when the latter options are not set by user (via #+attr_latex), they are treated as if the user force-set them to nil (because plist-get does not distinguish (:property nil) and complete absence of :property). I like the second possibility better because it will make table export consistent with the rest of export customisation. The downside is that we can break the existing workflows relying on current behaviour (which is not too much of a big deal though - we can always document this change in ORG-NEWS). The first possibility, on the other hand, will not break the current behaviour. However, it will only help people who manage to find this new customisation. We already have too many customisations. > And considering the answer is no for the previous question; is there a > workaround for this? Something people use? Because having to manually edit > the table everytime I export is a bit too much for me. Yes, there should be a workaround. org-table functions only override global export settings, not file-local and element-local. That is you should be able to set #+bind: org-latex-tables-booktabs org-latex-tables-booktabs. Or #+attr_latex: :booktabs t Of course, it is not very intuitive and relies on internal knowledge of the code. Best, Ihor