emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-element.el: Fix properties being upcased by parser
@ 2020-06-08 10:32 Leo Vivier
  2020-06-08 11:59 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Vivier @ 2020-06-08 10:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

Hi there,

I’ve noticed that `org-element-parser` upcases the keywords, even though
the standard established in 13424336a6f30c50952d291e7a82906c1210daf0 is
to ‘Prefer lower case letters for blocks and keywords’.

I’ve changed it to `downcase` to maintain consistency.  This might cause
problems with some hard-coded upper case letters in the codebase, but
I haven’t run into any issue so far.

HTH,

-- 
Leo Vivier

[-- Attachment #2: 0001-org-element.el-Fix-properties-being-upcased-by-parse.patch --]
[-- Type: text/x-patch, Size: 1309 bytes --]

From 574549a1ab07fd1500111a25d3f1caec4aa40bfb Mon Sep 17 00:00:00 2001
From: Leo Vivier <leo.vivier+dev@gmail.com>
Date: Mon, 8 Jun 2020 12:14:55 +0200
Subject: [PATCH] org-element.el: Fix properties being upcased by parser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* org-element.el (org-element-keyword-parser): Downcase properties
instead of upcasing them.

This is to follow the standard established by
13424336a6f30c50952d291e7a82906c1210daf0 to ‘Prefer lower case letters
for blocks and keywords’.

TINY CHANGE
---
 lisp/org-element.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index ac41b7650..e73b37b2b 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2184,7 +2184,7 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and
     (let ((begin (or (car affiliated) (point)))
 	  (post-affiliated (point))
 	  (key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):")
-		      (upcase (match-string-no-properties 1))))
+		      (downcase (match-string-no-properties 1))))
 	  (value (org-trim (buffer-substring-no-properties
 			    (match-end 0) (point-at-eol))))
 	  (pos-before-blank (progn (forward-line) (point)))
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-13 15:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-08 10:32 [PATCH] org-element.el: Fix properties being upcased by parser Leo Vivier
2020-06-08 11:59 ` Nicolas Goaziou
2020-06-08 12:14   ` Leo Vivier
2020-06-08 19:43     ` Nicolas Goaziou
2020-06-08 19:46       ` Leo Vivier
2020-06-08 20:36         ` Nicolas Goaziou
2020-06-12  4:48           ` Leo Vivier
2020-06-13 15:32             ` Nicolas Goaziou

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