org-mode has a very useful command, org-time-stamp, which helps you insert
dates from a calendar. So you can quickly type C-c . RET to insert
<2015-10-05 Mon>, for instance. These time-stamps are used by Org in a variety
of ways, so they are wrapped in <> to make them easy to parse. The downside
being that they look less than optimal when exported.
I was bit by this again today while updating the post on donations, and I
finally decided to look for a way to fix it. Of course, org-mode is nothing if
not configurable, so the answer wasn’t very far away.
The loyal readers might notice how similar this is to the second lambda we
used for exporting Youtube links. Org is quite consistent in its use of export
filters.
The above is enough to remove the surrounding <>, but we can still make it
better. The YYYY-MM-DD weekday format isn’t commonly used in prose, so let’s
switch that as well.
As a bonus, this format will also be used to display time-stamps in your
org-mode buffers. If don’t want that, you can let-bind the
org-display-custom-times variable when calling the export function, instead of
setting it globally.
If any of this doesn’t work for you, you might need to update your Org
package. Fortunately, Org is on GElpa, so anyone can do that with M-xlist-packages.
Better time-stamps in org-export
05 Oct 2015, by Artur Malabarba.org-mode
has a very useful command,org-time-stamp
, which helps you insert dates from a calendar. So you can quickly type C-c . RET to insert<2015-10-05 Mon>
, for instance. These time-stamps are used by Org in a variety of ways, so they are wrapped in<>
to make them easy to parse. The downside being that they look less than optimal when exported.I was bit by this again today while updating the post on donations, and I finally decided to look for a way to fix it. Of course,
org-mode
is nothing if not configurable, so the answer wasn’t very far away.The loyal readers might notice how similar this is to the second
lambda
we used for exporting Youtube links. Org is quite consistent in its use of export filters.The above is enough to remove the surrounding
<>
, but we can still make it better. TheYYYY-MM-DD weekday
format isn’t commonly used in prose, so let’s switch that as well.As a bonus, this format will also be used to display time-stamps in your
org-mode
buffers. If don’t want that, you can let-bind theorg-display-custom-times
variable when calling the export function, instead of setting it globally.If any of this doesn’t work for you, you might need to update your Org package. Fortunately, Org is on GElpa, so anyone can do that with M-x
list-packages
.Tags: org-mode, init.el, emacs,
Multiple Cursors keybinds »
« Predicting the future with M-n
Related Posts
Define context-aware keys in Emacs in org-mode
Changing the org-mode ellipsis in org-mode
Org-mode subtrees and file-local variables in org-mode
Content © 2019, All rights reserved. Icons under CC3.0.