emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: TEC <tecosaur@gmail.com>
Cc: Jens Lechtenboerger <lechten@wi.uni-muenster.de>,
	org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Enhance org-html--build-meta-info
Date: Mon, 14 Dec 2020 08:20:38 +0100	[thread overview]
Message-ID: <87k0tkam61.fsf@bzg.fr> (raw)
In-Reply-To: <871rfs6fl0.fsf@gmail.com> (TEC's message of "Mon, 14 Dec 2020 14:34:28 +0800")

Hi Timothy,

TEC <tecosaur@gmail.com> writes:

>> 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)).

Can we approach this with two patches, one with the refactoring and
one with the added functionality?

> 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.

This sounds useful.

>> 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.

I think "Org Export" as the default is counter-intuitive, let's stick
to the empty string.  (Also, this kind of "small" changes should be
made with consideration of all exporters.)

> 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.

Yes, this is better.

>>> +(defun org-html--build-meta-entry (label identity &optional content-format &rest content-formatters)
>>> +  "Construct <meta> 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.

Nope, the first line of a docstring should be a sentence.  You'll have
to reformulate the beginning of the docstring...

Thanks!

-- 
 Bastien


  reply	other threads:[~2020-12-14  7:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 13:50 [PATCH] Enhance org-html--build-meta-info TEC
2020-09-17 14:21 ` TEC
2020-09-17 15:53 ` Jens Lechtenboerger
2020-09-17 16:14   ` TEC
2020-09-18  8:11     ` Jens Lechtenboerger
2020-09-25 17:48       ` TEC
2020-09-27 15:17         ` Jens Lechtenboerger
2020-09-27 17:39           ` TEC
2020-09-27 18:00             ` Jens Lechtenboerger
2020-09-27 18:35               ` TEC
2020-09-28  8:17                 ` Jens Lechtenboerger
2020-12-13 16:12                   ` TEC
2020-12-14  6:04                     ` Bastien
2020-12-14  6:34                       ` TEC
2020-12-14  7:20                         ` Bastien [this message]
2020-12-14  7:27                           ` TEC
2020-12-14  8:11                             ` Bastien
2020-12-14 10:01                               ` TEC
2020-12-14  9:49                       ` Jens Lechtenboerger
2020-12-15 11:39                         ` TEC
2020-12-16  4:13                           ` Tom Gillespie
2020-12-16  5:04                             ` Timothy E Chapman
2020-12-16  6:45                               ` Tom Gillespie
2020-12-16  6:55                           ` Jens Lechtenboerger
2020-12-16  7:22                             ` TEC
2020-12-16  8:37                               ` Jens Lechtenboerger
2020-12-20  5:08                                 ` TEC
2020-12-20 17:59                                   ` Jens Lechtenboerger
2021-01-02 18:51                                     ` TEC
2021-01-03 13:26                                       ` Jens Lechtenboerger
2021-01-03 14:48                                         ` TEC
2021-01-03 15:41                                           ` Jens Lechtenboerger
2021-01-03 17:17                                             ` TEC
2021-01-04  7:11                                               ` Jens Lechtenboerger
2021-01-10 15:52                                                 ` TEC
2021-01-10 17:02                                                   ` Jens Lechtenboerger
2021-01-10 20:36                                                     ` TEC
2021-01-14 10:36                                                       ` TEC
2021-01-14 15:59                                                         ` Jens Lechtenboerger
2021-01-14 16:02                                                           ` Ready to merge! " TEC
2021-01-21  4:05                                                         ` Kyle Meyer
2021-01-21  5:55                                                           ` TEC
2020-12-20  5:08                                 ` TEC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0tkam61.fsf@bzg.fr \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=lechten@wi.uni-muenster.de \
    --cc=tecosaur@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).