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 uPJRNVQUkGDbPAAAgWs5BA (envelope-from ) for ; Mon, 03 May 2021 17:18:44 +0200 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 sIPcMFQUkGDDYQAAbx9fmQ (envelope-from ) for ; Mon, 03 May 2021 15:18:44 +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 502831CF26 for ; Mon, 3 May 2021 17:18:44 +0200 (CEST) Received: from localhost ([::1]:40104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldaLL-0002qe-GC for larch@yhetil.org; Mon, 03 May 2021 11:18:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldaCU-0004US-O7 for emacs-orgmode@gnu.org; Mon, 03 May 2021 11:09:34 -0400 Received: from mail.postale.io ([5.135.179.34]:35580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldaCS-0004aW-O5 for emacs-orgmode@gnu.org; Mon, 03 May 2021 11:09:34 -0400 From: Mingkai Dong To: emacs-orgmode@gnu.org Subject: [PATCH] lisp/ox-html.el: Move the space after exported section number Date: Mon, 3 May 2021 23:07:45 +0800 Message-Id: <20210503150745.72871-1-mk@dong.mk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received: from localhost (Unknown [127.0.0.1]) by mail.postale.io (Haraka/2.8.27) with ESMTPSA id 5CD559DE-6460-4795-A452-CADF4936E8B4.1 envelope-from (authenticated bits=0) (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256); Mon, 03 May 2021 15:09:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; bh=oDH+ylXA3EjZEGDFpHTdLPcV+V8/gmkWqKdXSY4a/PE=; c=relaxed/simple; d=dong.mk; h=from:subject:date:message-id:to:cc:mime-version; s=s20200610414; b=hS6bz0VYRHxKzk/cg+xG4aRhZKldd8396n7hInuG1hURkiXGzxRnWhphGMWbpqtpLyGKSblfQo157Zz+H42W/7q1GDwb8Z6nWqsGdDr6KMYMoeQHuMbUOJhx/NJQuT8Ol48M94F+izqJEBXw72CFwoCKKrnmXL3wPr1TtqNibWU= Received-SPF: pass client-ip=5.135.179.34; envelope-from=mk@dong.mk; helo=mail.postale.io 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, MSGID_FROM_MTA_HEADER=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 03 May 2021 11:17:56 -0400 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: Mingkai Dong 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=1620055124; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=GEAbnLwytFNeHc5W9vHIUA1d9eNBmL2Bie0KEgd4ov4=; b=F6Wv7VPWnYt3fk0y0QHyxUFeZ093Ffm9Cdt4OGw3JQtNbKhvzvIX7QVxdTokGVG8ATAj3Y 8lmPzQ1pnbRODbZ+obmzuuh7oPr1N0QA5Ba60GtxWsVvP3RgCY19i0j8EBVAt8141aUqXN 9j6C7G7klYRbV6nkrXbzHgA66mV7ObohOd9c+dSDzAb1vS2uLa4MqczUtjHWsoxZkvrx0v CXEIlyRd+tZWffMXecgvxfejPM2gouM3YNjXRkQiDaIACIa7Q+LDU6xNAmYu7j5OSpy6m1 RhVpeiS+8A37625c6AShD/8JTng8HRKube0KsfUO0HHD77bfNDBf4cdh8H6YqA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620055124; a=rsa-sha256; cv=none; b=O6+HKUbe6iJCKzr7H23E5fSK4tAutfqLeH1NMugZ+1AenqZ4Inj5SSap65K5kmkaXoJusJ o9Pd69ww5UdQfi3UC8NAQ/gdLgD7D4WXMVxuMT+nCtPjyj7cv0RyeSbf2BJcdguGE1X4ol Ns42vYe3LqqQLJs2+rH5HswzjP4ClgzsOaSIgqoCi3vG6darmT6jp1Mjmy4gwK3FYArKF2 KHh58pzB0xsIdPFqs5RvrbIR0kp9TSXiW34nbNEjeG/G+Lkoe3KxWNSdnbX4ktLcrWMfTa NhtfsnAbKKTVu+xK2+9IAoSVcchmTv5P+2VqsIevx5/C6zziw7mKjGce6kUswg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dong.mk header.s=s20200610414 header.b=hS6bz0VY; 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: 3.64 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dong.mk header.s=s20200610414 header.b=hS6bz0VY; dmarc=fail reason="SPF not aligned (relaxed)" header.from=dong.mk (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: 502831CF26 X-Spam-Score: 3.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: hrSlh5S2lYCS * ox-html.el (org-html-headline, org-html-format-headline-default-function): delete the space after the section number span format and add it back in org-html-format-headline-default-function. The requirement is well described in the reddit post https://www.reddit.com/r/emacs/comments/bv8rli/org_mode_export_section_numbering/ which can be solved by setting the org-html-format-headline-function variable to a custom function that adds the "." before the section title. However, this results in something like "1 . Fist-Section-Title", rather than "1. First-Section-Title", because of the extra space after the format. Moving the space to org-html-format-headline-default-function preserves existing export behavior while allowing the users to better control the format. --- lisp/ox-html.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 89da823e8..f2ce71f68 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2676,7 +2676,7 @@ holding contextual information." (concat (and numberedp (format - "%s " + "%s" level (mapconcat #'number-to-string numbers "."))) formatted-text) @@ -2696,7 +2696,8 @@ See `org-html-format-headline-function' for details." (let ((todo (org-html--todo todo info)) (priority (org-html--priority priority info)) (tags (org-html--tags tags info))) - (concat todo (and todo " ") + (concat " " + todo (and todo " ") priority (and priority " ") text (and tags "   ") tags))) -- 2.31.1