emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Amit Patel <amitp@cs.stanford.edu>
To: emacs-orgmode@gnu.org
Subject: [bug] customizing org-journal file format breaks calendar integration
Date: Fri, 11 Apr 2014 08:44:47 -0700	[thread overview]
Message-ID: <CACGNkCO-FjWSn8OyJXEGfKKufQtVFQyNwdfbS84J0MKCYh1qbQ@mail.gmail.com> (raw)

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

Hi org-moders,

I just started using org-journal (with org-mode 8.2.5h) and went through
the customization options. I wanted my journal files to use YYYY-MM-DD
instead of YYYYMMDD, so I changed two variables:

org-journal-file-format to "%Y-%m-%d"
org-journal-file-pattern to "[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"

However, this breaks browsing journal entries with the calendar, as well
as org-journal-open-next-entry and org-journal-open-previous-entry. Poking
around, I found that those two functions, as well as org-journal-get-list,
hard-code the parsing of the filename into year, month, day components.
They assume YYYYMMDD.

That means there are /three/ ways in which the filename format is encoded:
(1) org-journal-file-format to create new entries, (2)
org-journal-file-pattern to find entries on disk and to set
auto-mode-alist, and (3) these three functions, which parse the filename.
All three need to be kept in sync for the calendar integration to work.

Unfortunately (3) is not user-customizable without copying those functions
and modifying them. That means customizing (1) and (2) breaks things. Maybe
org-journal-file-pattern could use explicitly numbered regexp groups to
mark the year, month, day. Or maybe everything can be somehow derived from
org-journal-file-format.

Cheers,
- Amit

[-- Attachment #2: Type: text/html, Size: 1563 bytes --]

             reply	other threads:[~2014-04-11 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 15:44 Amit Patel [this message]
2014-04-17 15:33 ` [bug] customizing org-journal file format breaks calendar integration Bastien

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACGNkCO-FjWSn8OyJXEGfKKufQtVFQyNwdfbS84J0MKCYh1qbQ@mail.gmail.com \
    --to=amitp@cs.stanford.edu \
    --cc=emacs-orgmode@gnu.org \
    /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 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).