From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8EPGHqyjmmGjFQEAgWs5BA (envelope-from ) for ; Sun, 21 Nov 2021 20:53:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0E9SGqyjmmGDZAAAbx9fmQ (envelope-from ) for ; Sun, 21 Nov 2021 19:53:16 +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 27A1B31EA6 for ; Sun, 21 Nov 2021 20:53:16 +0100 (CET) Received: from localhost ([::1]:44394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mostn-0005DO-0K for larch@yhetil.org; Sun, 21 Nov 2021 14:53:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mossg-0005DD-68 for emacs-orgmode@gnu.org; Sun, 21 Nov 2021 14:52:06 -0500 Received: from [2607:f8b0:4864:20::529] (port=39515 helo=mail-pg1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mossd-0000TG-PM for emacs-orgmode@gnu.org; Sun, 21 Nov 2021 14:52:04 -0500 Received: by mail-pg1-x529.google.com with SMTP id r5so13426660pgi.6 for ; Sun, 21 Nov 2021 11:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=MIAfVMgM62zgaMUVWTaVrDD8bdyMz6uX51AtEcECNuI=; b=pSj9zTZv72hGrueJrFTRZzZS3ml3TlZHdHISosMO1ZTlXeHE1ltihn5omeqx5xXacc K1NOP45P+hkd5Pt5lXH8V9SBLxD5cQkacKMCbcS+44w41oBJ8bzz/5hzF90URHKU2gbQ q/KIud/xbVoAGhEehDyQisseApdCG+V4afsBPQMTy1cjpnUw1utbbDVHzpbafkuk5NnR OqKCxCoaK42gd+ARkw1ZE0S3rqWhToV9DghDfOE4ZvzMFWOTJXEc89l/KrxxhXPFVXmF f3K79K7/CubLs9O9z8HqzEHhgOxzHhoVBME1OKPo5Vk8g2BjPQ0XAhtBbdfD2x2lPVUe zH0g== 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:cc:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding; bh=MIAfVMgM62zgaMUVWTaVrDD8bdyMz6uX51AtEcECNuI=; b=mebhwQpW9igxAm4xBGr8HT2pmAM6QhK/H9VZBgrDvS58lw93GYY+bqOiZ12lLIO4t5 YB8yiScnSJHzJ2LTdDdPlwK8MVqMm4RU79FGkHu0734Vj5904t/+3pZtYNFPpzk8VvtT QohVgCfJhp04ZYZmGkR7MZSiSdW2zDYTEmqpQdLSRZkSb/NoFjARWhybBfaOxf8c6D6N s59PcDBS60SdW5asuu/H6zO7ojFr/MA4CRcIGLsxXGEvYfdI8rV+wdAz5nkWaYLaSE5A 8hM9Svt5kaoCA8GdzeWfw6f9+4pxTftAUR1KTyHkmIh7fCQe2BEaBSPK0VQxENwJWfPn xM7g== X-Gm-Message-State: AOAM531xwrt4xPkQxYEZ+mSKxUJA91ObC9IBLpowkTiHOAhhxKLUDGCy 0eGIVYNny44jxPOmO/NTbEymJjNjQg8= X-Google-Smtp-Source: ABdhPJyOK91CRZHYnkT9ZKBlDZrv2XHVNJEA0evqA8rx3WEPg5p1cc+tU3vaKukOrZ4JU/fHK4Md3w== X-Received: by 2002:a05:6a00:1308:b0:4a2:75cd:883a with SMTP id j8-20020a056a00130800b004a275cd883amr72254013pfu.84.1637524318955; Sun, 21 Nov 2021 11:51:58 -0800 (PST) Received: from ryzen3950 (c-208-82-98-189.rev.sailinternet.net. [208.82.98.189]) by smtp.gmail.com with ESMTPSA id t7sm16406634pjs.45.2021.11.21.11.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 11:51:58 -0800 (PST) From: Matt Huszagh To: Timothy Subject: Re: [PATCH] Fix regex for determining image width from attribute In-Reply-To: <87ilwl71gh.fsf@gmail.com> References: <87czmtuy0p.fsf@gmail.com> <87ilwl71gh.fsf@gmail.com> Date: Sun, 21 Nov 2021 11:51:57 -0800 Message-ID: <87a6hxuw0y.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::529 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=huszaghmatt@gmail.com; helo=mail-pg1-x529.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: , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637524396; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=MIAfVMgM62zgaMUVWTaVrDD8bdyMz6uX51AtEcECNuI=; b=Z0PEJ5JRKxg9Qr4NEooDN+GIwXCin5v4f8BNH8Y7MWfjxKEMYG9Et022EvJvpnF0cF8HWM QjkhGV/9s+bLRUxF0nmNEmWzTz6LgLosBrA1xKLm+fkeYw3aZT12UqInuo8g9DiXBHya2V AKG6LLWhkB0GWMYqp65F7EgX/vW3nGBn8gSc+Q3KgkxdJwl+q5XEqkHKjHYJwP/IfN+El8 /pqLnz/qcUCFmNTvgL7qbPr/+wZZPfqHOwWHIFv8a5/4PEa1P4s4/7QnIOghquPtfxtg2M ut7w84G1RUiaCDQ03D6VQ1fiSoayD2/iLYzfwRIm9LPINMQLIXCjCKs1jdDgTQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637524396; a=rsa-sha256; cv=none; b=dYXO2JEgBbDt7DkSWjRN699Y/UFfzEMCjcOkerwCtQolgti22Im+VnqrIIGgqhhuq4Pdhe P+0pHiRTUCZTOu7OpxJIx9eY/d8oXvg1mp66Ha/AtZrVNEqsXBmpTRoXJsJT2Xwn0GmqY8 g2v5tDx/IvMdjXBSGnnKOjY16ZTiFHvgFVUNkWVZqf8qIIIG27ZD/tjuo9BUwvZhriS4gP zB0d4jkbqKLE0VgsYSiVN0fJOs+m/akFjb7xUjkcVAZnIk7vdh7WD3zoXgGRTs9dp8+3fY LzkLuInCvmWRS0FXeEm6j1h78y26EVINYSFJUleTIl8RinfVXhZGsTzRvMUG8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pSj9zTZv; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.78 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pSj9zTZv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 27A1B31EA6 X-Spam-Score: -1.78 X-Migadu-Scanner: scn1.migadu.com X-TUID: TRI7bNcK1Khh Timothy writes: > Once again, thank you for the patch. The fact that the current regexp mat= ches > `#+attr_latex' and `#+attr_html' is in fact by design though*. This is be= cause I > consider it safe to assume that a `#+attr_*' which gives non-integer widt= h between > 0 and 2 can be safely assumed to be that proportion of the page width. e.= g. > `#+attr_latex: :width 0.7\linewidth' or `#+attr_html: :width 70%'. > This way, a good guess can be made without having do have both an > `#+attr_latex/html' /and/ an `#+attr_org' line for the width. Should this= assumption > be incorrect, a subsequent `#+attr_org' line will override the other `#+a= ttr_*'. > > Should there be edge-cases where this assumption doesn=E2=80=99t hold, I= =E2=80=99d be interested > in patches that improves the logic here. As long as this holds more often= than > not though, this should be a net positive for user experience as I see it. > > Do please let me know if there are any good examples of unintended / > counter-intuitive behaviour you=E2=80=99re aware of. Thanks for explaining the logic behind the current implementation. Unfortunately, I think this makes a valid use case impossible. Specifically, I like to be able to set an image width explicitly with #+attr_org (or some other attr_ for the corresponding export) and fall back to the actual image width when this isn't specified. This includes the ability to use the actual image width in an org buffer, but an explicitly-set image width for export. For example, for my blog I often have attr_html set, but I want the image to use its actual width when displayed in org. I don't see how this is possible with the current implementation. But, it works naturally with the implementation I have in mind (IIRC this is how it previously worked, but I could be mistaken). I do understand the desire to avoid specifying a whole bunch of redundant attr_ settings, but I don't think it should make fine-tuned use cases like the one above impossible. I also find the current implementation a bit counterintuitive, if less verbose. Maybe a solution to accomplish all goals would be to add an #+attr_fallback (or attr_default, attr_any, attr_all, etc.) that is used for any backend unless a specific setting is made for that backend. Matt