From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uCcjKtLEdmZKFwAAqHPOHw:P1 (envelope-from ) for ; Sat, 22 Jun 2024 12:34:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uCcjKtLEdmZKFwAAqHPOHw (envelope-from ) for ; Sat, 22 Jun 2024 14:34:26 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Rddzujcu; 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=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719059666; 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=8nhR7R0kWcl79JKTU6+wmTN31K0DI8qcpdSNA6RqvmE=; b=Tz544xVZiR7/PfHgUcAXRDtQaZ34as3q6VIAKvq+rVEznEc803JoseOoTUo4L9KEmOcG7E JMq+CDPg2anZM5tBEixqBws6ECgeBp0MbgqmTDBT/XKZ/oRS6RDqNUva+Yn08jfI1BLhqb 4ReXQRPw5/cCtkVBnTgGtXJ0iGTyK/ytdaYLM09C+zDnYZKY3fEu/RwcRr/JpK4RpV6Lvz pqlGeNFUS+1tdF0ixBIwR1tintionIf3BkLmnNEJXqhqRsDgXBVkZFd5tdSzEDJrx5vIHa m1p29yMBZa2pTE5MhxL7dydvPkQW+FXMSWlPqkyq8eaqN3fsswFG0BLk3ExACA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Rddzujcu; 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=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719059666; a=rsa-sha256; cv=none; b=WIAqZAaDcbwSJfJ39QfRtkEU1BH2/TloCzPkQvYEzhHRZIns7ns0bPTNHaAWXILwhq2OB4 9t9jYeDVY8tEVO08hsqh+tsjicIL9X8/ikdhnW4RHtMD3IOrFsLGAyMKKJj3rgPH9RHU02 y3Tpk9sFr6G/8ICtnsMubcf3yVHdujZN7PwBMyiXHIXmI29BImlqBMYwYsE1n/E6/t2cpk 3Dg+ht3DHAqFWFrOlJUYcDskfe1jBjBo46nSs/NtLmLgPd1xktKgsO6Uu4bg5Sn9hN3QKD LvpYa5GcgzUXokeX/f5EuZ4ldj+ZjFKt3+GJC0BifBk72Jr+U6TFxFYUvvsb6Q== 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 2CC54DE6E for ; Sat, 22 Jun 2024 14:34:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKzw8-0007iY-G0; Sat, 22 Jun 2024 08:33:44 -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 1sKzw7-0007iP-If for emacs-orgmode@gnu.org; Sat, 22 Jun 2024 08:33:43 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKzw5-0004Up-Br for emacs-orgmode@gnu.org; Sat, 22 Jun 2024 08:33:43 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2CA6A240109 for ; Sat, 22 Jun 2024 14:33:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719059618; bh=fFd7F9fEduXuu0zaET/gzjHmIgXeoV+4wfdBIqC1XYI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=RddzujcuLEOP/EOB7auqBsr8JzGu64OpiSjCFMjmLpO//HAD065T8gJL3Nvymy3bl +JzZcxgr3rr6LUhhAvi9KyWMUJSe12vloNLn0/L/TZfypi+fU8BvtFO6bAVPOrJwjl wKauNbj6R35IydSo3N+qyRnSgovG/vSn6PCJ/uwGyrVEcZDq0tYC8Adsv1n5pQlxcR RCEvKSBZZ6kbsRA24jRHGnNoRsadZnS9FOajNuwoageR3KJDLw0uIQsljwr1zUbkDn 9IZBG3XMAqrsMElDHQyiLFaJYt0wIxjXIs9KbXIXoki01M3IVZJqA9eTTFU2M/KYwE 9yXZX514UFOZw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W5ttl70zbz6tvx; Sat, 22 Jun 2024 14:33:35 +0200 (CEST) From: Ihor Radchenko To: Nathan Nichols Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Ability to specify :html-head as a function In-Reply-To: References: <87zfstenxc.fsf@localhost> <87zfriscml.fsf@localhost> <87v824904a.fsf@localhost> <87bk3v78zq.fsf@localhost> <87jziiptoh.fsf@localhost> Date: Sat, 22 Jun 2024 12:35:19 +0000 Message-ID: <87a5jdi29k.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Spam-Score: -9.58 X-Migadu-Queue-Id: 2CC54DE6E X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.58 X-TUID: +wVujxTLgYGD Nathan Nichols writes: >> 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. Thanks! > +(defun org-html-normalize-str-or-fn (input &rest trailing) > + "If INPUT is a string, it is passed to `org-element-normalize-string'. Ideally, the first line of the docstring should fully describe what function does. Maybe you can add something like Normalize INPUT function or string. Return a string or nil. > +If INPUT is a function, it is applied to arguments TRAILING, and the result is > +passed to `org-element-normalize-string'." > + (let ((s (if (functionp input) (format "%s" (apply input trailing)) input))) > + (org-element-normalize-str s))) ^org-element-normalize-string TRAILING name is confusing because it is not what one expects to be a name of function arguments. Maybe (defun org-html-normalize-str-or-fn (input &rest args) Also, you need to update docstrings and type definitions for `org-html-head' and `org-html-head-extra', update the Org manual, and announce the new allowed values in etc/ORG-NEWS. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at