From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UApcHPvSdWZdKwEAe85BDQ:P1 (envelope-from ) for ; Fri, 21 Jun 2024 19:22:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UApcHPvSdWZdKwEAe85BDQ (envelope-from ) for ; Fri, 21 Jun 2024 21:22:35 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=BwFtX1Wx; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718997755; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=uCbq+T24lf9Gu3ODk9RaG9lsR96lkHXol09bkFNr1MQ=; b=uEZsvzCZ/iOXitzFZffQKQ1ogednBUmNmg+4sL5K106r7j0CS132hRgoGw9zAeoF9gGa1u 9BbnvFkUsS+sJshrh3lpIWhYLn/HXIhgULN8S1QVIjtjXm6o+vEhFirBrq7WGWxpb46eJV cOQejwJIlk0a8OfakuEPd0iW0SWqfCrADrOW50cmXrG0ukETxvF2KnCzki3v176VF8Q9Ou DZO9wJymc1yc87V4E2XmmyOJeKjqk2M+wfwbIfoc0QKQq5upAKUKCyTs3dEuVRINGbVQYv V4tZuT1l1LUs7xZvPu9q/f++na8ghJRUxA0T8yKPIocgDzZzxEneY+i7cdN2aA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=BwFtX1Wx; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718997755; a=rsa-sha256; cv=none; b=jOC6amNj86fvyubI6GnvPTuKbjeH1s4jrPS4CX3wJ23sMeUltQqEjSfObok362kojca3lZ dXXcS/lRj966ntIN7RccDfShpE0ICsC+yOKbrT741HifgFxh7eqwoXzJyKOdO/ifde3qyF mIq6cAea7nFzlsB3WhRAsVTOOT0RAwyDEMPnNscHtxZQxK73D3RAEtQUKnvT+EEeR5dYyF DrNkkzLq8xQ6doStTVXJz+S23hAStqnxTifIp/MfWOH6UfRkwLMocJEYyAjmcFpWjwGcwB 2Ri/VMFxncFJfKhN4VQPBRD2RRozmj1LJwTvmGNOvjIwKqXpszBbd2g+5GNzsA== 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 28DA450137 for ; Fri, 21 Jun 2024 21:22:35 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKjp7-0003UO-MK; Fri, 21 Jun 2024 15:21:25 -0400 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 1sKjp5-0003Tr-Ap for emacs-orgmode@gnu.org; Fri, 21 Jun 2024 15:21:23 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKjp2-0002N3-JN for emacs-orgmode@gnu.org; Fri, 21 Jun 2024 15:21:23 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-710437d0affso1792501a12.3 for ; Fri, 21 Jun 2024 12:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718997677; x=1719602477; darn=gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=td4m76sfxC4MX7vf5IiMIaXHW+iA3XYnDBSLGgdUp2U=; b=BwFtX1Wxhk2GbEi+XQ9y7Gry6uepUNDaxFqkuIuHqMEFzBIsZfXF0r8kMBs/YHXGTF bjmbtyDlbxSgkBw8YXC4tHQXRs7Xim/S7kXDs42WZ9zAb8AEeX18xpPVW0yKWkPwE4dK raKr4G1Cu+zeNyzULpOHzgNmD+Gp7tF0QY9AzTWk1pll0wW24USHDMpmBBsUMiiTRvDI smr3p5dfkIqg2/KojJvff9RGj+NomY4gD0T/PeA2gE8QolT8DFsWb8nK/tY5KVQH1Bby MQmBE7aUeYHdgQOgSyfYRRyEYttnCamut5pB3O7nW5FrKAIBj0MLyZH0jl78YvUK8X29 DqXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718997677; x=1719602477; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=td4m76sfxC4MX7vf5IiMIaXHW+iA3XYnDBSLGgdUp2U=; b=c1mebhFgQLM5ccyA7650kVdeUBP2MRfaWycP2Q//abYkScGLcbRaYLQrP2ws7QVwC6 zlwrgSWsfNx3dT9XmiDBrfXKVYNYamyYTG7giiEUQCkgxoRt9ZkKp7OO+a55lAw+9TXr DP4Q6A7/XFSivBQV+f9kDaXpKslUeLLcWjiJDNXcLZRAIkrStr6E38G87x6JX0swBQbT amzn6DaFo3eynvD52Ge7OCPCXBwvx5XHux5SUaT/4h7pA/IwoPnF4Dz+w2SecC0xpJHH pAQ9+/DHxsWWBh8viyRBJA70bgam4NEdzesSdCmBHuOc2xyKQ7uabJg8bTvWY0PeRcDp zxmg== X-Forwarded-Encrypted: i=1; AJvYcCWBG1IGs+dlNUOR7R5odXk/lJLIXqCGuWVkvDhdXixieX6ykRS2itlEV+1LlNJTb1l7DDjSOwJmC5h5Zpbe6sS6ZI42gHI= X-Gm-Message-State: AOJu0YyyRjK/xPRM3oXrZhe0p5MZJUwfokrBfmpw8dh6PfzxxU9snV8j 1TxwUlzO/WxeZYs7uWxqBvjjKoc7N+SY56z/lDa86X5QWo6ImbHhaagIMVjbeTVn//61jBkTBvo pzzBwTzp/3BBQNL8zNIn2KplGlIg= X-Google-Smtp-Source: AGHT+IERgAx39rSa4kjTrXnSchdkd6VlpKXZyKJH+r9czMSe7teY9jEJfHnAAAcQSyNxk/NpfYI+WM+/PCrPXqkrOXs= X-Received: by 2002:a17:90a:8c10:b0:2c7:dd1a:da3f with SMTP id 98e67ed59e1d1-2c7dd1adcbfmr6783532a91.11.1718997677257; Fri, 21 Jun 2024 12:21:17 -0700 (PDT) MIME-Version: 1.0 References: <87zfstenxc.fsf@localhost> <87zfriscml.fsf@localhost> <87v824904a.fsf@localhost> <87bk3v78zq.fsf@localhost> <87jziiptoh.fsf@localhost> In-Reply-To: <87jziiptoh.fsf@localhost> From: Nathan Nichols Date: Fri, 21 Jun 2024 15:21:05 -0400 Message-ID: Subject: Re: [PATCH] Ability to specify :html-head as a function To: Ihor Radchenko , emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000ec522f061b6b554a" Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=nathannichols454@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 28DA450137 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.16 X-Spam-Score: -4.16 X-TUID: //vv7SOTtVJH --000000000000ec522f061b6b554a Content-Type: multipart/alternative; boundary="000000000000ec522e061b6b5548" --000000000000ec522e061b6b5548 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > This looks like a copy-paste of `org-element-normalize-string'. > Why not simply calling `org-element-normalize-string'? I changed it at one point, but then changed it back and didn't realize that it was ultimately unchanged. Here's a patch that uses `org-element-normalize-string` instead. > Also, may we move this discussion to Org mailing list? I prefer the > discussions and development to be public (it helps future maintainers). Yes, of course. I think I just forgot to hit "reply all". On Fri, Jun 21, 2024 at 4:47=E2=80=AFAM Ihor Radchenko wrote: > Nathan Nichols writes: > > > Subject: [PATCH] Added ability to specify :html-head as a string or > function > > ... > > +(defun org-html-normalize-str (s) > > + "Return S, or evaluate to a string ending with a single newline > character. > > +If S isn't a string or a function, return it unchanged. If S is the > empty > > +string, return it. Otherwise, return a new string with a single > > +newline character at its end." > > + (cond > > + ((not (stringp s)) s) > > + ((string=3D "" s) "") > > + (t (and (string-match "\\(\n[ \t]*\\)*\\'" s) > > + (replace-match "\n" nil nil s))))) > > This looks like a copy-paste of `org-element-normalize-string'. > Why not simply calling `org-element-normalize-string'? > > Also, may we move this discussion to Org mailing list? I prefer the > discussions and development to be public (it helps future maintainers). > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000ec522e061b6b5548 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> This looks like a copy-paste of `org-element-nor= malize-string'.
> Why not simply calling `org-element-normalize-s= tring'?

I changed it at one point, but then cha= nged it back and didn't realize that it was ultimately unchanged.=C2=A0=
Here's a patch that uses `org-element-normalize-string` instead.

> Also, may we move this discussion to Org m= ailing list? I prefer the
> discussions and development to be public = (it helps future maintainers).

Yes, of course. I t= hink I just forgot to hit "reply all".

On Fri, Jun 21, 2024= at 4:47=E2=80=AFAM Ihor Radchenko <yantar92@posteo.net> wrote:
Nathan Nichols <nathannichols454@gmail.com> writes:
> Subject: [PATCH] Added ability to specify :html-head as a string or fu= nction
> ...
> +(defun org-html-normalize-str (s)
> +=C2=A0 "Return S, or evaluate to a string ending with a single n= ewline character.
> +If S isn't a string or a function, return it unchanged.=C2=A0 If = S is the empty
> +string, return it.=C2=A0 Otherwise, return a new string with a single=
> +newline character at its end."
> +=C2=A0 (cond
> +=C2=A0 =C2=A0((not (stringp s)) s)
> +=C2=A0 =C2=A0((string=3D "" s) "")
> +=C2=A0 =C2=A0(t (and (string-match "\\(\n[ \t]*\\)*\\'"= s)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-match "\n" nil nil s))= )))

This looks like a copy-paste of `org-element-normalize-string'.
Why not simply calling `org-element-normalize-string'?

Also, may we move this discussion to Org mailing list? I prefer the
discussions and development to be public (it helps future maintainers).

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>
--000000000000ec522e061b6b5548-- --000000000000ec522f061b6b554a Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Added-ability-to-specify-html-head-as-a-string-or-fu.patch" Content-Disposition: attachment; filename="0001-Added-ability-to-specify-html-head-as-a-string-or-fu.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lxp2tq3v0 RnJvbSA0ZjRmNWM3NmE0OTBlYWFiODZkNzIxYTEzMzFkY2VlNTMwNzY4N2QwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBOYXRlIE5pY2hvbHMgPG5hdGhhbm5pY2hvbHM0NTRAZ21haWwu Y29tPgpEYXRlOiBUaHUsIDIwIEp1biAyMDI0IDE0OjI1OjM1IC0wNDAwClN1YmplY3Q6IFtQQVRD SF0gQWRkZWQgYWJpbGl0eSB0byBzcGVjaWZ5IDpodG1sLWhlYWQgYXMgYSBzdHJpbmcgb3IgZnVu Y3Rpb24KCi0tLQogbGlzcC9veC1odG1sLmVsICAgICAgICAgICAgICB8IDEzICsrKysrKysrKyst LS0KIHRlc3RpbmcvbGlzcC90ZXN0LW94LWh0bWwuZWwgfCAgNiArKysrKysKIDIgZmlsZXMgY2hh bmdlZCwgMTYgaW5zZXJ0aW9ucygrKSwgMyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNw L294LWh0bWwuZWwgYi9saXNwL294LWh0bWwuZWwKaW5kZXggZDE2ODdjZjVhLi4wMTM5YWE4OGMg MTAwNjQ0Ci0tLSBhL2xpc3Avb3gtaHRtbC5lbAorKysgYi9saXNwL294LWh0bWwuZWwKQEAgLTIw MDEsMTUgKzIwMDEsMjIgQEAgSU5GTyBpcyBhIHBsaXN0IHVzZWQgYXMgYSBjb21tdW5pY2F0aW9u IGNoYW5uZWwuIgogCQkgIG9yZy1odG1sLW1ldGE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