From: Leo Vivier <leo.vivier+dev@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-element.el: Fix properties being upcased by parser
Date: Mon, 08 Jun 2020 14:14:57 +0200 [thread overview]
Message-ID: <87d0693gam.fsf@hidden> (raw)
In-Reply-To: <87mu5d7opp.fsf@nicolasgoaziou.fr>
Hello,
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> This is unrelated to capitalization usage in Org buffers. Upcasing is
> used to tell the difference between, e.g., :value and :VALUE.
I understand, but I think the function is also used to modify
file-parameters like `#+title`. If you run `org-element-parse-buffer`
on a buffer with the following content:
--------------------------------[START]--------------------------------
#+title: Foo
---------------------------------[END]---------------------------------
Here’s what you get:
--------------------------------[START]--------------------------------
(org-data
nil
(section
(:begin 1
:end 14
:contents-begin 1
:contents-end 14
:post-blank 0
:post-affiliated 1
:parent #0)
(keyword
(:key "TITLE" ; <----------
:value "Foo"
:begin 1
:end 14
:post-blank 0
:post-affiliated 1
:parent #1))))
---------------------------------[END]---------------------------------
This caused us some head-scratching when we updated Org-roam to use
lower case file-parameters.
Here’s how my Edebug session went:
org-element-parse-buffer
-> org-element--parse-elements
-> org-element--current-element
--------------------------------[START]--------------------------------
((looking-at "\\+\\S-+:")
(beginning-of-line)
(org-element-keyword-parser limit affiliated))
---------------------------------[END]---------------------------------
Ultimately, it’s not changing anything for the users, but I did find it
a little counterintuitive.
HTH,
--
Leo Vivier
next prev parent reply other threads:[~2020-06-08 12:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d0693gam.fsf@hidden \
--to=leo.vivier+dev@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.