From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iOAmLwIEp2GiZgEAgWs5BA (envelope-from ) for ; Wed, 01 Dec 2021 06:11:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2LCrKgIEp2GYDQAAbx9fmQ (envelope-from ) for ; Wed, 01 Dec 2021 05:11:30 +0000 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 3B1171A5AE for ; Wed, 1 Dec 2021 06:11:30 +0100 (CET) Received: from localhost ([::1]:34912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msHtw-0001Gp-HJ for larch@yhetil.org; Wed, 01 Dec 2021 00:11:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msHtD-0001Fx-48 for emacs-orgmode@gnu.org; Wed, 01 Dec 2021 00:10:43 -0500 Received: from [2607:f8b0:4864:20::102e] (port=42664 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msHt2-000205-07 for emacs-orgmode@gnu.org; Wed, 01 Dec 2021 00:10:42 -0500 Received: by mail-pj1-x102e.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so358090pjb.1 for ; Tue, 30 Nov 2021 21:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=QdDUdeez9xZNq/6qFEJG5/lEZytDLB52byBR4cW+HJQ=; b=i5Fjlwx5YXBauVRcVjUv1DF6ppeUcSM7FdpmEEQRkviuBC/qNUa7aryQz/StjrSBUe Fz6PYncijxfPSS0fHqEWXh/Yt0bGU3zBjfajkXxWV2ME1Z14roF6mYNmDBuGp2dIaOvQ 4FIQSlDQBErsxBPY6ABXHn08TTMn2+DLHy2swzWmkN4+RsfL6dDx5j8LHdMrUKwKNkOB u+DDTYFMaWXaQl+0idUhVMK0HLuDR5gnuwW0/1GIVfeG9wBwHD6nA+oAPZLr0pXySYB2 lMlU3r+ZPGvZQSWAt0PBaVmrzlQlrzVOnzD0ayu6gZwMYderyepC1doeN5tIMlfGCk9M J5dQ== 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:date:references:user-agent :in-reply-to:message-id:mime-version; bh=QdDUdeez9xZNq/6qFEJG5/lEZytDLB52byBR4cW+HJQ=; b=hU5sIcRqwVqnl63Z2HX3EAsnTe4zUNf5KZHQzUmaQ0c4qKkwub3FBhTelVjiS1+XD3 VWY5lgZRlGPFs+dyOPtR4PuOp3BBAti+UEOryuxDLc+GSGze35qMhKAhUPI6lVBQrq2Q ltatZccArOmGjhrJl4vP3z070dBBvOiF4/wZ8deyMVvfD36SvRe+nry76xSr/WobSKbL yW0xijA/RkZ5P03qqWtf+i7qka/wCT0L6RZ4azFO2qrG5jCwd3vrEko9XWavKHVSDKHa T3YKBYzKgtypWBDUS4d0VC0UevgsyfRnfJLbgX4KlO7oRzez+sW4EcCWRk0lUY7DSMRl GiaA== X-Gm-Message-State: AOAM533FYFvQxq3r09C53M+CARBmQa4x8sY7zuEnMUBzJYEXPiT3rQuS 7OIIDxx0RPx3wIqfDYiFD18= X-Google-Smtp-Source: ABdhPJxcpGiPt9Ew0St0n/isOOHPhTL472z+enT115yKKVJu1ryzP6T+evkvvJKnRjDGfUXrCqUH+w== X-Received: by 2002:a17:90b:50c:: with SMTP id r12mr4624219pjz.71.1638335430501; Tue, 30 Nov 2021 21:10:30 -0800 (PST) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id c5sm4080369pjm.52.2021.11.30.21.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 21:10:29 -0800 (PST) From: Timothy To: Matt Huszagh Subject: Re: [PATCH] Fix regex for determining image width from attribute Date: Wed, 01 Dec 2021 12:54:27 +0800 References: <87czmtuy0p.fsf@gmail.com> <87ilwl71gh.fsf@gmail.com> <87a6hxuw0y.fsf@gmail.com> <877dd07fnb.fsf@gmail.com> <8735noqig0.fsf@gmail.com> <87wnl05ag6.fsf@gmail.com> <87y25fq5d2.fsf@gmail.com> <8735nnlaef.fsf@gmail.com> <87v90jph1w.fsf@gmail.com> <871r37l96a.fsf@gmail.com> <87k0gzpb5s.fsf@gmail.com> <87h7c2pb6w.fsf@gmail.com> <87ee75pmsn.fsf@gmail.com> <87czmjajyx.fsf@gmail.com> <87k0grk0ge.fsf@gmail.com> <87ee6x3t39.fsf@gmail.com> User-agent: mu4e 1.6.9; emacs 28.0.50 In-reply-to: <87ee6x3t39.fsf@gmail.com> Message-ID: <87zgpkq5a5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Max Nikulin , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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=1638335490; 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=QdDUdeez9xZNq/6qFEJG5/lEZytDLB52byBR4cW+HJQ=; b=hTIRwL8ojOhS68/J9tQNuou2kcClkw8kfO/UNqXnpqfdoAMtbsFpxp/foFgj1s1rh4ebtN 8xbaZRru8F5NpQuvG585byC5pUAmJEPHZK0Vb1DbK/wRZcsm2jllSf6FkO6cd3BkT/yDQi LK/1hRB+yiGtphhY2SMMyQL4iTk33IB+uGKg3UU1hdWNV9y38BKbjxHeQ9ENS5NPE/RxJP J9VcFs5DeFymx/tb/W3k1wcqaZ88pzz+rY6mpS5IYNsSMZVVfNOBcdpfh6aVop8OwPLGGQ k9NL8CafxWsFMbMLsSvG44WbvlbJwnTzlp9rbmEvT6Xm/fSI8Dy442xUStfS9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638335490; a=rsa-sha256; cv=none; b=Tq6dfctOw9PtSwF34gTGIoEhvKxTU+UBwyClP2O6dBFmE8N21E4k83bixdbAqGutBEZ4e1 w+KOg24zpmVeIGFZdrlWcBjfdQ+EGvzvOwSLpHx79d/sRD9VkqqP1Q83YiovLX9qAnvscV FDVpiHaBFFAQwn5vSQ7f0fNwjromRi7EzuxyHMKB8c41OvVFx0TeD4bRpqQKh5evh5dXoY h4efmbtRBD6LKVSsm0QcyBtj+rjbfcxIRRmDZiEsCTatUBODsadHa8qmntt8GLHAfeMUlz DdZ+EQdfYffmwul3yInIFBFW+TyfJFCWQswW7xpRX9MTsBLt/2LKh0GvmPFpCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i5Fjlwx5; 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: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i5Fjlwx5; 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: 3B1171A5AE X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: WO2dMWGda/Yq --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Matt, Thanks for your thoughtful deliberation on this. > I think the essential disagreement is whether org should take an action i= f not > explicitly told to do so. I think org should only perform some action if = given > a clear directive. In this context, I feel that org is guessing what the = user > wants and taking an action based on that guess. I broadly agree with this, but I think this is provided by the four forms t= hat `org-image-actual-width' can take: =E2=81=83 `t', in which case the actual image width is always used =E2=81=83 an integer, in which case that will always be used as the width =E2=81=83 `nil', which produces the guessing behaviour we=E2=80=99re discus= sing =E2=81=83 `(val)', which guesses, falling back on `val' > Ok, back to the fact that there are multiple considerations here. The > first issue is whether specifying a width for a backend reflects an > intention to have that same width in the org buffer. As I previously > stated, I don=E2=80=99t agree that one implies the other. But, as also > previously discussed, this was a decision that was made almost 10 years > ago, so changing it would be a breaking change, etc. Because of that, > I=E2=80=99m not totally sure what org should do, and I expect a lot of pe= ople > won=E2=80=99t want to change this. I=E2=80=99m not opposed to /expanding/ the behaviour (with due consideratio= n), which could resolve some of your concerns, but I don=E2=80=99t think it would be good t= o prevent the current behaviour, which at this point seems well-established. > The other consideration is if we take the first point as a given (that > org should use width directives for other backends), should it also > attempt to interpret directives that are ambiguous? In this case, do we > interpret 1.2 as 1.2? If could only be , > I=E2=80=99d be inclined to agree that this is logical. I also understand = the > case for , though this is slightly less clear. But, what if > someone used 1.2? Seems a bit unusual I know, but maybe > someone would want this. Again, I don=E2=80=99t think we should guess if = there=E2=80=99s > a chance we could be wrong. I feel this very much depends on how bad =E2=80=9Cguessing wrong=E2=80=9D i= s, and as previously discussed, since it=E2=80=99s rather easy to correct or set `org-image-actu= al-width' to prevent this, I=E2=80=99m not sure it warrants being terribly concerned abo= ut. > I totally agree with you that we don=E2=80=99t want to implement a pseudo= latex > parser here. But I feel like all this complexity is easily resolved by > just requiring that people be explicit about their intentions (i.e., > specify #+attr_org: :width). That would avoid all the complex behavior > and surprises that could result from making intelligent guesses about > what the user wants. I think prioritising `#+attr_org: :width' makes a lot of sense, but I feel = quite reluctant to /require/ it. > Anyway, let me know what you want in terms of the patch. I still think > prioritizing attr_org should be its own patch and changing the regex and > all the other behavior should be a separate issue. But, if you=E2=80=99d = like me > to perform the change I mentioned in my last email, I can take the time > to write that up and include it in the same patch. Thanks for continuing with this. Moving forward, I think it would be best t= o: =E2=81=83 Make a patch just for prioritising `#+attr_org' =E2=81=83 Make a patch just improving the regex (before or after the `#+att= r_org' patch) =E2=81=83 Discuss changing the behaviour of image previews separately later= / in another thread, linking to this thread when doing so. How does that sound? Lastly, a comment on your documentation patch from earlier. I like the chan= ges to `org-image-actual-width', however I think you=E2=80=99ve been over-eager= with scrapping the current docstring for `org-display-inline-image--width'. Since the beha= viour is implemented there, I think it should at a minimum be documented there. The docstring for a function referring to a variable=E2=80=99s documentatio= n for how it=E2=80=99s handled by the function seems a bit weird. All the best, Timothy --=-=-=--