From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WIPVJtIM11/nTwAA0tVLHw (envelope-from ) for ; Mon, 14 Dec 2020 06:57:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kDWzItIM11/wAgAA1q6Kng (envelope-from ) for ; Mon, 14 Dec 2020 06:57:22 +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 2360B9402A9 for ; Mon, 14 Dec 2020 06:57:22 +0000 (UTC) Received: from localhost ([::1]:55402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kohnN-0002Bi-3x for larch@yhetil.org; Mon, 14 Dec 2020 01:57:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kohmd-0001yP-WA for emacs-orgmode@gnu.org; Mon, 14 Dec 2020 01:56:36 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:38257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kohmb-0001Bz-Ka; Mon, 14 Dec 2020 01:56:35 -0500 Received: by mail-pf1-x441.google.com with SMTP id d2so11472509pfq.5; Sun, 13 Dec 2020 22:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=qegtWm7dKZZLhn1qeRFvUlexPcY9bGleGJiZ2XLnP+s=; b=bfspr0tfIU33ZNc6QS7p/F1T7LFDczkBrCa9crecDdo02u313/hV6HXIPWk8koGc18 GJ6S8HG+F+MGIk2ZCJtwGu/2an6G9PXjUxMcWeERf5cyhtP2CX51NCSHIz35HZE4FMwQ YHucTbY2F9C9xkG5tsC0XQpoec1wvQqGSew4xiM6+pgqDaDYfv8WvRXnjwl5ZDSmujMJ fGtNO6UGIQMzjzJtmSJxfzf6sB+ouY9LntmXAUkdtC/EjBuNT8JDXFj+N2//y5RMUjqB /GfF/1tJS09/9sRWbDOTa16R9EuONMk3OdNDIskWmpDDZulrYEwPrxN/0vLoF0v3YEwi U7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=qegtWm7dKZZLhn1qeRFvUlexPcY9bGleGJiZ2XLnP+s=; b=Kk5iROLH3/AjJT3B6QHBfG5u49wfy+E4BOetqNrhahKETHZQNHCoSLQlbyZh/Ms+J/ Jkm+0ujwqPnT8J9/LYdECZsLhj07EUWToDYrcr05QwvrG4NBbqwquCaDE+hk2Af0bgD+ yC4pg/7AgSE79hhQre02TAsg1+X4jVoKxZyIReOlOWBNOnUvfA8v4iOnOE5FKR1Vcm1n Vq8SVTVvOjFkmnfGJtyFMCqP4f2O6m99lwC7pqjxP2CeHU/X2pk/EYJ+LScQ783ofo5Y J+KFqGvGDQpTbcxmPUNafrUsofRRh1V8lzRjAhFaEAULhROlwdZJqTNlavHRVYOSdSjV bQjw== X-Gm-Message-State: AOAM532MBSM3mvylWkp8E2L33T4gdiAv9XvVOnR1+EvbRmT/ZJR1XU1d et77YU/j31EKYnRTRU+kNzynHhEr85U= X-Google-Smtp-Source: ABdhPJyXGDWaRKPcpA1Or89RCILjhxPP8JHjcJzKA4NVW8SC+wDX51HB/6cnrSRnNTbG6jAkWISaEg== X-Received: by 2002:aa7:9087:0:b029:197:daff:a9a8 with SMTP id i7-20020aa790870000b0290197daffa9a8mr22436380pfa.26.1607928991502; Sun, 13 Dec 2020 22:56:31 -0800 (PST) Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id y23sm19112140pfc.178.2020.12.13.22.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 22:56:31 -0800 (PST) References: <87pn6kfr19.fsf@gmail.com> <87v9gcz9ge.fsf@wi.uni-muenster.de> <87lfh8fkj1.fsf@gmail.com> <87zh5n1p3s.fsf@wi.uni-muenster.de> <87tuvl3fyc.fsf@gmail.com> <878scvs0z7.fsf@wi.uni-muenster.de> <87wo0fktjs.fsf@gmail.com> <874knjrtg9.fsf@wi.uni-muenster.de> <87tuvjkqzl.fsf@gmail.com> <87sgb28gd8.fsf@wi.uni-muenster.de> <87blexel9f.fsf@gmail.com> <87im94ordh.fsf@gnu.org> User-agent: mu4e 1.4.13; emacs 27.1 From: TEC To: Bastien Subject: Re: [PATCH] Enhance org-html--build-meta-info Date: Mon, 14 Dec 2020 14:34:28 +0800 In-reply-to: <87im94ordh.fsf@gnu.org> Message-ID: <871rfs6fl0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=tecosaur@gmail.com; helo=mail-pf1-x441.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Lechtenboerger , org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=bfspr0tf; dmarc=pass (policy=none) header.from=gmail.com; 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: 2360B9402A9 X-Spam-Score: -3.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: 16icN7sCPHUh Bastien writes: > Let's wait for Jens feedback on this patch, since he took care of > testing it so far. Assuming Jens responds as he usually has (relatively promptly), this sounds good to me :) > In a nutshell, can you restate what problem is this patch fixing? There are two things I intend to achieve with this patch: 1. DRY* out the existing code. The existing code is quite repetitive in structure, and easily lends itself to being extracted to a function. This is easier to read, and work with IMO. 2. Make use of the DRYer code in (1) to provide a make the meta building function more versatile, and then add in the ability for user customisation at low-cost (again, thanks to (1)). *DRY is an acronym for "Don't Repeat Yourself", in case there's a french equivalent you're more familiar with. > Is a new option really necessary here? Necessary? Not really, I mean the export /works/ without it. I'd argue that it's desirable though, as it provides an easy way for a user (such as myself) to add useful meta tags not included by default. For example I currently make use of this to add information that parsed by a large number of services/apps to create rich embeds for exported Org files I link to (see https://tecosaur.github.io/emacs-config/config.html#extra-header-content,code--2 ). Furthermore, I consider it to be very low cost, since it's basically just taking advantage of the restructuring already performed for code QOL reasons. I expect most users not to have any reason to touch this, but for some to find it handy. > Are there backward compatibility considerations we should take care of? None AFAIK. Barring this errors that Jens raised, and now have hopefully been addressed, this should function /exactly/ as the current implementation does, with a minor (beneficial) caveat, mentioned below. Just with nicer-to-work-with code and a bit more versatility (IMO, of course). These are the two changes to be mentioned: 1. The (or {title} "Org Export") bit I added. I believe the current behaviour when no #+title is given is to have a blank one (""). I think "Org Export" is preferable, as it's more informative than ... nothing. 2. Using org-html-encode-plain-text for formatting the content of the meta tags. From Jens, I take it that the current org-export-data can cause nested HTML tags, which are invalid in this context. Plain text should be safer. >> +(defun org-html--build-meta-entry (label identity &optional content-format &rest content-formatters) >> + "Construct tag with LABEL=\"IDENTITY\" and content from CONTENT-FORMAT and CONTENT-FORMATTER." > > The first line of this defun is too long. You can try M-x checkdoc > RET on your elisp files to catch those issues. > > Thanks, I see, I'm guessing I'll just need to add a line break. I hope that clarifies things! Timothy