David Cao <da...@cao.sh> writes:

> I was looking at `org-element-timestamp-parser` and I was wondering if I
> should add the timezone parsing to `org-parse-time-string` or just to
> `org-element-timestamp-parser`, since the former seems to return a
> structure with timezone information (as of now unused).

The Org mode code is currently using a mix of org-element parser and
`org-parse-time-string'/regexp to parse the timestamps.

The general direction we are moving into is using org-element's parser
everywhere instead of regexps. So, first and foremost, you should add
timezone parsing to `org-element-timestamp-parser'. Then, you should
probably rewrite `org-parse-time-string' to use org-element. You will
also need to check other instances of Org functions using timestamp
regexps directly. This last task will be the hard one.

As I stated earlier, I recommend starting from
org-element-timestamp-parser alone first + writing tests. It will be an
easier task exactly because of the complications with a lot of legacy
Org code parsing timestamps directly, via regexps.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to