From: Timothy <tecosaur@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: [PATCH] (minor) Use lower case keywords in ox-org
Date: Tue, 28 Sep 2021 22:58:35 +0800 [thread overview]
Message-ID: <87ilykd9hf.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
Hello,
Just a little thing, if it’s of interest. A while ago I remember upper/lower
case keywords being discussed and the conclusion being that upper case keywords
were only to be used in the manual. Since `ox-org' isn’t the manual, I’ve gone and
lowered the case of all the keywords used there.
All the best,
Timothy
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-org-Use-lower-case-keywords.patch --]
[-- Type: text/x-patch, Size: 2556 bytes --]
From d5c0cb92198d315031a5e4539e227b22a1f0b98b Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Tue, 28 Sep 2021 22:45:55 +0800
Subject: [PATCH] ox-org: Use lower case keywords
* lisp/ox-org.el (org-org-identity, org-org-template): As it has
previously been clarified on the mailing list that upper-case keywords
are only intended for the manual[1], an Org export of an Org file should
use lower-case keywords.
[1]: https://list.orgmode.org/87tuuw3n15.fsf@nicolasgoaziou.fr/
---
lisp/ox-org.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/ox-org.el b/lisp/ox-org.el
index c2b85473c..0c4290ebf 100644
--- a/lisp/ox-org.el
+++ b/lisp/ox-org.el
@@ -141,7 +141,7 @@ (defun org-org-identity (blob contents _info)
CONTENTS is its contents, as a string or nil. INFO is ignored."
(let ((case-fold-search t))
(replace-regexp-in-string
- "^[ \t]*#\\+ATTR_[-_A-Za-z0-9]+:\\(?: .*\\)?\n" ""
+ "^[ \t]*#\\+attr_[-_a-za-z0-9]+:\\(?: .*\\)?\n" ""
(org-export-expand blob contents t))))
(defun org-org-headline (headline contents info)
@@ -185,26 +185,26 @@ (defun org-org-template (contents info)
(org-element-map (plist-get info :parse-tree) 'keyword
(lambda (k)
(and (string-equal (org-element-property :key k) "OPTIONS")
- (concat "#+OPTIONS: "
+ (concat "#+options: "
(org-element-property :value k)))))
"\n"))
(and (plist-get info :with-title)
- (format "#+TITLE: %s\n" (org-export-data (plist-get info :title) info)))
+ (format "#+title: %s\n" (org-export-data (plist-get info :title) info)))
(and (plist-get info :with-date)
(let ((date (org-export-data (org-export-get-date info) info)))
(and (org-string-nw-p date)
- (format "#+DATE: %s\n" date))))
+ (format "#+date: %s\n" date))))
(and (plist-get info :with-author)
(let ((author (org-export-data (plist-get info :author) info)))
(and (org-string-nw-p author)
- (format "#+AUTHOR: %s\n" author))))
+ (format "#+author: %s\n" author))))
(and (plist-get info :with-email)
(let ((email (org-export-data (plist-get info :email) info)))
(and (org-string-nw-p email)
- (format "#+EMAIL: %s\n" email))))
+ (format "#+email: %s\n" email))))
(and (plist-get info :with-creator)
(org-string-nw-p (plist-get info :creator))
- (format "#+CREATOR: %s\n" (plist-get info :creator)))
+ (format "#+creator: %s\n" (plist-get info :creator)))
contents))
(defun org-org-timestamp (timestamp _contents _info)
--
2.33.0
next reply other threads:[~2021-09-28 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 14:58 Timothy [this message]
2021-09-28 15:28 ` [PATCH] (minor) Use lower case keywords in ox-org Bastien
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=87ilykd9hf.fsf@gmail.com \
--to=tecosaur@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).