emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] customizing org-journal file format breaks calendar integration
@ 2014-04-11 15:44 Amit Patel
  2014-04-17 15:33 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Amit Patel @ 2014-04-11 15:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug] customizing org-journal file format breaks calendar integration
  2014-04-11 15:44 [bug] customizing org-journal file format breaks calendar integration Amit Patel
@ 2014-04-17 15:33 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2014-04-17 15:33 UTC (permalink / raw)
  To: Amit Patel; +Cc: emacs-orgmode

Hi Amit,

Amit Patel <amitp@cs.stanford.edu> writes:

> 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.

I'm not sure org-journal's developer is reading the list.

Maybe you'll get a better answer by filling an issue here:
https://github.com/bastibe/org-journal/issues

Hope this helps,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-17 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11 15:44 [bug] customizing org-journal file format breaks calendar integration Amit Patel
2014-04-17 15:33 ` Bastien

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).