emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-element.el: Fix properties being upcased by parser


From: Leo Vivier
Subject: Re: [PATCH] org-element.el: Fix properties being upcased by parser
Date: Mon, 08 Jun 2020 14:14:57 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]