Giter Club home page Giter Club logo

org-journal's Introduction

https://github.com/bastibe/org-journal/actions/workflows/test.yml/badge.svg?branch=master https://elpa.nongnu.org/nongnu/org-journal.svg http://melpa.org/packages/org-journal-badge.svg http://stable.melpa.org/packages/org-journal-badge.svg https://img.shields.io/github/contributors/bastibe/org-journal.svg https://img.shields.io/github/license/bastibe/org-journal.svg

./org-journal.svg

org-journal

Adapted from https://www.emacswiki.org/emacs/PersonalDiary

Functions to maintain a simple personal diary / journal using in Emacs.

Feel free to use, modify and improve the code! — mtvoid, bastibe

https://img.shields.io/github/issues/bastibe/org-journal.svg https://img.shields.io/github/issues-closed/bastibe/org-journal.svg https://img.shields.io/github/issues-pr/bastibe/org-journal.svg https://img.shields.io/github/issues-pr-closed/bastibe/org-journal.svg

Synopsis

org-journal maintains a set of files, depending on the value of org-journal-file-type, a file represents a day, week, month or year. When org-journal-file-type is set to =’daily=, each file represent a day. In case org-journal-file-type is set to =’weekly=, a file represents a week, etc. Convenient bindings allow the creation of journal records in the current daily, weekly, monthly or yearly file and search within all records or specified time intervals. All records can be browsed and searched from the Emacs Calendar for convenience. All entries in a specified TODO state will be carried over to the next day, see org-journal-carryover-items. Optionally, the journal entry can be encrypted, so can the file, see org-journal-enable-encryption and org-journal-encrypt-journal, respectively.

Every journal entry must have a CREATED property when using yearly, monthly and weekly journal files. This property is added by org-journal-new-entry automatically.

An example of a daily file (it will actually look a lot nicer, depending on your org-mode settings):

* Tuesday, 06/04/13
** 10:28 Company meeting
Endless discussions about projects. Not much progress

** 11:33 Work on org-journal
For the longest time, I wanted to have a cool diary app on my
computer. However, I simply lacked the right tool for that job. After
many hours of searching, I finally found PersonalDiary on EmacsWiki.
PersonalDiary is a very simple diary system based on the emacs
calendar. It works pretty well, but I don't really like that it only
uses unstructured text.

Thus, I spent the last two hours making that diary use org-mode
and represent every entry as an org-mode headline. Very cool!

** 15:33 Work on org-journal
Now my journal automatically creates the right headlines (adds the
current time stamp if on the current day, does not add a time stamp
for any other day). Additionally, it automatically collapses the
headlines in the org-file to the right level (shows everything if in
view mode, shows only headlines in new-entry-mode). Emacs and elisp
are really cool!

** 16:40 Work on org-journal
I uploaded my journal mode to marmalade and Github! Awesome!

** TODO teach org-journal how to brew coffee

An example of a weekly/monthly/yearly journal file, see also org-journal-file-type.

* Tuesday, 06/04/13
  :PROPERTIES:
  :CREATED:  20130604
  :END:
** 10:28 Company meeting
...

** 11:33 Work on org-journal
...

** 15:33 Work on org-journal
...

** 16:40 Work on org-journal
...

* Wednesday, 06/05/13
  :PROPERTIES:
  :CREATED:  20130605
  :END:
** 10:28 A new day
...

** 11:33 Work is almost over
...

** TODO teach org-journal how to brew coffee

Installation

org-journal is available through NonGNU ELPA, MELPA and MELPA Stable. So installation should be trivial:

M-x package-install org-journal

Then add (require 'org-journal) to your .emacs.

Note! If you are using org-mode version 9.6 consider customizing the variable org-element-use-cache and setting it to nil to workaround an issue where journal items are not properly carried over to the next day

Quickstart

Doing M-x org-journal-new-entry will immediately create a journal directory in the default path (customized using the org-journal-dir variable), open or create a file in org-journal-mode, and insert a template for a new journal entry.

The same command with a prefix argument (C-u M-x org-journal-new-entry) will do everything mentioned while skipping entry creation, which is useful for looking at the current journal file.

Basic Usage

Bindings available in org-journal-mode:

  • C-c C-f - go to the next journal file.
  • C-c C-b - go to the previous journal file.
  • C-c C-j - insert a new entry into the current journal file (creates the file if not present).
  • C-c C-s - search the journal for a string.

All journal entries are registered in the Emacs Calendar. To see available journal entries do M-x calendar. Bindings available in the calendar-mode:

  • j m - mark entries in calendar
  • j r - view an entry in a new buffer.
  • j d - view an entry but do not switch to it.
  • j n - add a new entry into the day’s file (creates the file if not present).
  • j s w - search in all entries of the current week.
  • j s m - search in all entries of the current month.
  • j s y - search in all entries of the current year.
  • j s f - search in all entries of all time.
  • j s F - search in all entries in the future.
  • [ - go to previous day with journal entries.
  • ] - go to next day with journal entries.

Setup and customization

The following variables can be customized through M-x customize, or configured programmatically in your .init.el.

See below for an example.

Journal Directory and Files

Customization options related to journal directory and files:

  • org-journal-dir - the journal path.
  • org-journal-file-format - format string for journal file names (may contain directories relative to org-journal-dir).
  • org-journal-find-file - a function to use when opening a journal file. By default it opens a window using find-file-other-window. Set this to find-file if you don’t want org-journal to split your window.
  • org-extend-today-until - a number that indicates the hour of your end of the day. If you create a new entry with org-journal-new-entry earlier than this time, the journal entry will go into the previous day’s journal.
  • org-journal-file-type - the journal file type either ‘daily (default), ‘weekly, ‘monthly or ‘yearly. Also see the customizable variables org-journal-start-on-weekday for changing the start of the week for weekly journals (defaults to Monday). Keep in mind changing org-journal-start-on-weekday won’t work for existing weekly journal files.

Journal File Content

Customization options related to the journal file contents:

  • org-journal-date-format - date format org-journal uses when showing a date within a journal and search results page. It can also be a function, which return value will than be inserted.
  • org-journal-date-prefix - this string will prefix the date at the top of a journal file.
  • org-journal-time-format - a timestamp format that will prefix every entry within a daily journal file.
  • org-journal-time-prefix - a string that will prefix every entry within a daily journal file.
  • org-journal-file-header - a string that will be inserted at the top of every new journal file. If a string, it will be passed to `format-time-string` along the time value of the new journal entry. It can also be a function expecting a time value.
    (defun org-journal-file-header-func (time)
      "Custom function to create journal header."
      (concat
        (pcase org-journal-file-type
          (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything")
          (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded")
          (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded")
          (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded"))))
    
    (setq org-journal-file-header 'org-journal-file-header-func)
        
  • org-journal-hide-entries-p - a boolean (defaults to true) that will hide previous journal entries if true. Can be set to nil to show previous entries.

org-journal behavior

Customization options related to org-journal itself:

  • org-journal-mode-hook - List of functions to run when org-journal-mode is loaded. By default this is set to =’(turn-on-visual-line-mode org-journal-default-enable-encryption)=.

An example setup

A very basic example of customization.

(setq org-journal-dir "~/org/journal/")
(setq org-journal-date-format "%A, %d %B %Y")
(require 'org-journal)

For users of use-package, this setup could look like the following:

(use-package org-journal
  :ensure t
  :defer t
  :init
  ;; Change default prefix key; needs to be set before loading org-journal
  (setq org-journal-prefix-key "C-c j ")
  :config
  (setq org-journal-dir "~/org/journal/"
        org-journal-date-format "%A, %d %B %Y"))

Advanced Usage

Searching the Journal

org-journal has two searching options: the usual org-mode agenda search and the built-in plain text search. The former can become slow with bigger journals, so the built-in search is a recommended option.

To use the agenda search, you can add all journal entries to your org-agenda by adding org-journal-dir to org-agenda-files and setting org-agenda-file-regexp to include files matching your org-journal-file-pattern.

;; When =org-journal-file-pattern= has the default value, this would be the regex.
(setq org-agenda-file-regexp "\\`\\\([^.].*\\.org\\\|[0-9]\\\{8\\\}\\\(\\.gpg\\\)?\\\)\\'")
(add-to-list 'org-agenda-files org-journal-dir)

However, this can become very slow if you have many journal entries. As a compromize, you can set org-journal-enable-agenda-integration to t, which automatically adds the current and all future journal entries to the agenda. This is enough to get an overview over current and future tasks.

The built-in search is available through the following function: org-journal-search (C-c C-s in org-journal-mode). By default, it will ask for the time interval to search within (accepting the org-read-date format such as “-1y” or “-1m”) and the string to search for. Given a prefix argument (C-u org-journal-search), it will go through the whole journal.

The order of the search results (ascending or descending by date) can be customized using the org-journal-search-results-order-by variable.

Search is also available through the Emacs Calendar as described in “Basic Usage”.

Carry Over

By default, org-journal will try to carry over previous day TODO-marked items whenever a new journal file is created. The older journal entry will be inserted to the current day’s file.

This feature is controlled through the org-journal-carryover-items variable. To disable this feature set org-journal-carryover-items to an empty string =”“=. Any agenda tags view match string, tags, properties, and todo states are allowed. By default this is TODO=”TODO”. Which will match TODO items.

The old carryover items in the previous day’s journal are processed by the function assigned to org-journal-handle-old-carryover variable. Default is to remove all of them. You can change this behavior by assigning a custom fuction to the variable. Your function has to take one argument, which is a list of old carryover entries. The list is in form of ((START_POINT (END_POINT . “TEXT”)) … (START_POINT (END_POINT . “TEXT”))); and in ascending order of START_POINT.

For example, you can choose putting a tag on the old carryover entries intead of removing them:

(defun my-old-carryover (old_carryover)
  (save-excursion
    (let ((matcher (cdr (org-make-tags-matcher org-journal-carryover-items))))
      (dolist (entry (reverse old_carryover))
        (save-restriction
          (narrow-to-region (car entry) (cadr entry))
          (goto-char (point-min))
          (org-scan-tags '(lambda ()
                            (org-set-tags ":carried:"))
                         matcher org--matcher-tags-todo-only))))))

(setq org-journal-handle-old-carryover 'my-old-carryover)

You can also skip carry over of Drawers through the org-journal-skip-carryover-drawers variable. This is specifically useful when you want to skip carry over of previous days clocked entries when it is under the drawer LOGBOOK. The variable accepts a list of drawers names which will be skipped on carry over. Sample configuration for skipping LOGBOOK drawer:

(setq org-journal-skip-carryover-drawers (list "LOGBOOK"))

Encryption

The journal entry can be encrypted using org-crypt, to enable it set org-journal-enable-encryption to t.

You can also encrypt the journal files itself by setting the variable org-journal-encrypt-journal to t. org-journal will always search for journal files with the .gpg extension, and highlights them in the calendar, etc., regardless of the value of org-journal-encrypt-journal. See the info page (info "(epa)Encrypting/decrypting gpg files") for more information about gpg encryption in Emacs.

Agenda and Scheduling

An easy way of keeping track of appointments or future TODOs is to simply create a journal entry in the future. Such entries will automatically get a timestamp and show up in the current day’s journal entry once you reach that day.

  • if org-journal-enable-agenda-integration is t, org-journal will automatically add the current and all future journal entries to org-agenda-files.

There are a few helper functions to deal with such scheduled entries:

  • org-journal-new-scheduled-entry - prompts for a date, and creates a new journal entry on that date with its timestamp set to the date. By default, this is a TODO entry. Set the prefix to avoid the TODO.
  • org-journal-schedule-view - creates a read-only overview of scheduled entries.

iCalendar export

You can export your scheduled entries to an iCalendar file, and subscribe to that file in your calendar application. You need to enable the agenda integration for this to work. I also recommend you set the following values before exporting:

(setq org-journal-enable-agenda-integration t
      org-icalendar-store-UID t
      org-icalendar-include-todo "all"
      org-icalendar-combined-agenda-file "~/path/to/org-journal.ics")

With this done, you can export your agenda, including your scheduled entries, with (org-icalendar-combine-agenda-files).

Journal Capture Template

You can configure a capture template in order to integrate org-journal with org-capture, as in the following example for a daily journal:

(defun org-journal-find-location ()
  ;; Open today's journal, but specify a non-nil prefix argument in order to
  ;; inhibit inserting the heading; org-capture will insert the heading.
  (org-journal-new-entry t)
  (unless (eq org-journal-file-type 'daily)
    (org-narrow-to-subtree))
  (goto-char (point-max)))

(setq org-capture-templates '(("j" "Journal entry" plain (function org-journal-find-location)
                               "** %(format-time-string org-journal-time-format)%^{Title}\n%i%?"
                               :jump-to-captured t :immediate-finish t)))

If you want to do the same to schedule a task for a future date, you can use the following:

(defvar org-journal--date-location-scheduled-time nil)

(defun org-journal-date-location (&optional scheduled-time)
  (let ((scheduled-time (or scheduled-time (org-read-date nil nil nil "Date:"))))
    (setq org-journal--date-location-scheduled-time scheduled-time)
    (org-journal-new-entry t (org-time-string-to-time scheduled-time))
    (unless (eq org-journal-file-type 'daily)
      (org-narrow-to-subtree))
    (goto-char (point-max))))

(setq org-capture-templates '(("j" "Journal entry" plain (function org-journal-date-location)
                               "** TODO %?\n <%(princ org-journal--date-location-scheduled-time)>\n"
                               :jump-to-captured t))

Caching of journal dates

Since version 2.0.0 a cache has been added to speed up calendar operations. This should drastically improve the performance when using encrypted journal files, see org-journal-encrypt-journal.

The caching functionality can be enabled by settings org-journal-enable-cache to t. The cache can be reset by calling org-journal-invalidate-cache.

FAQ

Can I use weekly/monthly/yearly journal entries instead of daily ones?

Yes, see org-journal-file-type.

Can I have multiple journals?

At the moment, this is not possible. But it should be possible to switch the value of org-journal-directory using a custom function or directory local variables.

Can I use org-journal with Spacemacs?

Yes you can!

  • To use org-journal with Spacemacs from the master branch, you must do this:
    1. git clone https://github.com/borgnix/spacemacs-journal.git ~/.emacs.d/private/journal
    2. add it to your ~/.spacemacs. You will need to add journal to the existing dotspacemacs-configuration-layers list in this file.

    The manual of the journal layer can be found at https://github.com/borgnix/spacemacs-journal

  • If you use Spacemacs from the develop branch you can enable org-journal by setting org-enable-org-journal-support to t, see Spacemacs org-journal support.

Some key-bindings in org-journal conflict with org-mode key bindings

Minor modes are supposed to only use key bindings of the form C-c C-?, where ? can be any letter, and to not overwrite major mode bindings. With org-mode already using most interesting keys, collisions are inevitable. This means that some org-journal key bindings will not work as expected in an org-mode buffer, and also that some org-mode key bindings will not work as expected in an org-journal buffer.

When working in an org-mode buffer the following org-journal key bindings are overwritten:

  • C-c C-s (org-journal-search) with org-schedule
  • C-c C-f (org-journal-open-next-entry) with org-forward-heading-same-level
  • C-c C-b (org-journal-open-previous-entry) with org-backward-heading-same-level
  • C-c C-j (org-journal-new-entry) with org-goto

To workaround this, you can use user bindings of the form C-c ?, where ? can be any letter, to call the org-journal functions. This allows you to have a set of keybindings that work the same in org-mode and org-journal buffers. However, this is Emacs, and if you don’t like a key binding, change it!

Opening journal entries from the calendar are not editable

Old entries are opened in view-mode, which has convenient key bindings for browsing files. Most notably, you can quickly close view-mode buffers with q, scroll them with the SPC and DEL, or quit view-mode with e.

Can I insert some text on a newly created journal file?

Yes, you can write a custom function and assign it org-journal-date-format.

Can I do more powerful things on a newly created journal entry?

Yes, there are two hooks that are run when a journal entry is created. Each (org-journal-new-entry) will call org-journal-after-entry-create-hook, and org-journal-after-header-create-hook is called each time the date (the parent headline of each entry) is generated.

Convenient org-journal Snippet Extensions

Kill journal buffer after saving buffer (By @dhruvparamhans)

(defun org-journal-save-entry-and-exit()
  "Simple convenience function.
  Saves the buffer of the current day's entry and kills the window
  Similar to org-capture like behavior"
  (interactive)
  (save-buffer)
  (kill-buffer-and-window))
(define-key org-journal-mode-map (kbd "C-x C-s") 'org-journal-save-entry-and-exit)

Contributors

See CONTRIBUTORS.

Contributing to org-journal

We format the code using common-lisp-indent-function rather than the default lisp-indent-function. Please set the variable lisp-indent-function to common-lisp-indent-function, and format the code before creating a PR.

(setq lisp-indent-function 'common-lisp-indent-function)
;; Markt the whole buffer: C-x h
;; Call indent-region: C-M-\

Changelog

See CHANGELOG.

org-journal's People

Contributors

ajchemist avatar akirak avatar aragaer avatar bastibe avatar bigeye avatar brabalan avatar casch-at avatar celeritascelery avatar chadmcauley avatar cofi avatar drfiresign avatar efls avatar jaidetree avatar jmay avatar june3474 avatar keelerm84 avatar miciah avatar namdnguyen avatar ndw avatar psibi avatar punchagan avatar quantumgc avatar ramllama avatar rgrinberg avatar ruibinx avatar skangas avatar sqrtminusone avatar tinarussell avatar vkazanov avatar xeruf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org-journal's Issues

Emacs 25.1 issue

Getting the following in my compile-log:

Leaving directory ‘~/’

Compiling file /Users/Simon/.emacs.d/elpa/org-journal-20160907.621/org-journal.el at Sun Oct 16 13:31:28 2016
Entering directory ‘/Users/Simon/.emacs.d/elpa/org-journal-20160907.621/’

Compiling no file at Sun Oct 16 13:31:29 2016
Warning (bytecomp): ‘hide-sublevels’ is an obsolete function (as of 25.1); use ‘outline-hide-sublevels’ instead.
Warning (bytecomp): ‘show-all’ is an obsolete function (as of 25.1); use ‘outline-show-all’ instead.
Warning (bytecomp): ‘show-entry’ is an obsolete function (as of 25.1); use ‘outline-show-entry’ instead.
Warning (bytecomp): ‘show-all’ is an obsolete function (as of 25.1); use ‘outline-show-all’ instead.

Journal-wide search facilities

At some point I realized that basic calendar intergration is not enough for the journal - manually searching dozens of files just does not scale very well. Agenda-based search does not scale to dozens of files too.

One option is to use generic Emacs tools, but this does not allow for smart queries such as "journal entries with the tag 'tag' during the previous week".

So, I am working on specialized search system for the org-journal. Currently my code is mostly tag-based (queries like "find entries with the following tags" are possible).

I am considering other, more powerful, means of searching (such as "find entries with a given text over a given period").

The question is: what do you, the creator of the package, use for searching and categorizing journal entries? This would help to adapt my code to your needs too.

Calendar summary (f-w) dead-loops if empty string is searched

I wanted to list all items of a week, so I naively entered "return" at the "search:" prompt.

Emacs started to eat all my computer's CPU resources and had to be killed in the end.

I wondered how it is possible to get the full list of entries for a time period
(I work around it now with a search for "**" as it begins each entry...)

just stopped working on emacs 25.2

I can no longer make new journal entries

Debugger entered--Lisp error: (void-function org-journal-new-entry) (org-journal-new-entry) debugger-may-continue = t inhibit-redisplay = nil inhibit-debugger = t inhibit-changing-match-data = nil eval((org-journal-new-entry) nil) [no locals] eval-expression((org-journal-new-entry)) debug-on-error = t

I get these warnings if I byte-compile the .el
`Compiling file /Users/AbuDavid/personal/dotFiles/privatEmacsLayrs/org-journal/org-journal.el at Sun Oct 2 01:59:57 2016

In org-journal-new-entry:
org-journal.el:286:12:Warning: ‘hide-sublevels’ is an obsolete function (as of
25.1); use ‘outline-hide-sublevels’ instead.
org-journal.el:287:10:Warning: ‘show-all’ is an obsolete function (as of
25.1); use ‘outline-show-all’ instead.
org-journal.el:291:10:Warning: ‘show-entry’ is an obsolete function (as of
25.1); use ‘outline-show-entry’ instead.

In org-journal-search-follow-link-action:
org-journal.el:706:6:Warning: ‘show-all’ is an obsolete function (as of 25.1);
use ‘outline-show-all’ instead.
`

Org-journal requires cl?

Somewhat minor, but org-journal (requires 'cl) to be able to open a journal entry from the calendar. Without it, from calendar view if I select a day with an associated journal entry, I get the following error in Backtrace

Debugger entered--Lisp error: (void-function caddr)
(caddr calendar-date)
(encode-time 0 0 0 (cadr calendar-date) (car calendar-date) (caddr calendar-date))
org-journal-calendar-date->time((1 27 2014))
(let* ((time (org-journal-calendar-date->time (calendar-cursor-to-date t event))) (org-journal-file (concat org-journal-dir (format-time-string org-journal-file-format time)))) (if (file-exists-p org-journal-file) (progn (view-file-other-window org-journal-file) (set (make-local-variable (quote org-hide-emphasis-markers)) t) (org-show-subtree)) (message "No journal entry for this date.")))
org-journal-read-entry(nil 106)
call-interactively(org-journal-read-entry nil nil)

Error when org-journal-time-prefix is empty

When my config contains the setting:

(setq org-journal-time-prefix "")

I get the error:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  hide-sublevels(nil)
  org-journal-new-entry(nil)
  call-interactively(org-journal-new-entry nil nil)
  command-execute(org-journal-new-entry)

This occurs with emacs -Q and my normal config. This seems like a bug, but I might be missing something. This is with Emacs 24.5.1 on El Capitan and org-journal 20160427.618 on Melpa.

If the directory org-journal-dir does not exist (is not mounted), I'm no longer able to use the calendar.

The reason for this is that org-journal calls

(add-hook 'calendar-today-visible-hook 'org-journal-mark-entries)
(add-hook 'calendar-today-invisible-hook 'org-journal-mark-entries)

when it is loaded.

Then org-journal-mark-entries calls (indirectly) org-journal-dir-check-or-create, which asks me if I want to create the directory. Since I don't want (it's loaded when I need it only), then the whole call to calendar fails.

My workaround is to have my own function which calls

(remove-hook 'calendar-today-visible-hook 'org-journal-mark-entries)
(remove-hook 'calendar-today-invisible-hook 'org-journal-mark-entries)

when I don't have the org-journal-dir loaded, but it would be nice if org-journal would not overwrite my preferences regarding the calendar hooks.

What would be necessary to work with more than one journal?

Hi. I appreciate org-journal and have been using it on a regular bases for about 6 months now. Very good package. I would like to have separate journals, one for my personal stuff and another for work stuff. What would be necessary to make it happen?

Can't use org-agenda before opening a journal file

I followed the instructions to add all those calendar/journal files to org-agenda. But for some reason I need to have previously have opened one. If I call org-agenda as soon as I start emacs I get the message
org-agenda-get-day-entries: Agenda file /home/oscar/Dropbox/org/journal/20150819 is not in org-mode'`

New entry from an org-mode buffer

I can't enter a new entry from a org-mode buffer, as in org-mode C-c-C-j is bind to org-goto. Defining (global-set-key (kbd "C-c-C-j") 'org-journal-new-entry) in my .emacs file does not work.
(I might missing something as I am an emacs newbie...)

append .txt

Is it possible to append a .txt file format at the end of each journal file? How do one go about doing that?

Filename format not fully customizable

I just started using org-journal (with org-mode 8.2.5h, org-journal 1.4.8) 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
  3. the three functions that 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.

Structured searches

Oh, BTW, do you use the search feature? At some point I realised I use it as a way to build reports on things done, not done etc, but it's a bit lacking here.

So, I started wondering if some kind of a reporting framework might be interesting, similar to the org-mode agenda, but concentrating on the journal side of things.
@vkazanov #70 (comment)

I do use the search feature, though mostly for full-text searches in the entry bodies, e.g. for keywords like accounting references or database logins.

It would be interesting to be able to do structured searches. Maybe to include/exclude certain tags or flags or only search in headlines. Also, more structured results would be interesting. Search results could include complete subtrees instead of individual lines, kind of like the carry-over feature moves whole subtrees to new entries.

However, the reason the current searches are fast (and the agenda is slower) is that the agenda parses every file in org-mode, while our search searches through the files in fundamental-mode. I fear that true org-aware searches could be significantly slower. Then again, maybe this is not important as long as searches can be restricted to certain months or years.

insert new line in org-journal-date-prefix

How do I insert a new line in org-journal-date-prefix? I tried %n and ~n but one of them only works in org-journal-date-format. I would like to have following structure in my journal files:

#+TITLE: (blank for no title)
#+OPTIONS: num:nil toc:nil

* Sat, 06/06/2015

Integrate with org-capture

Is it possible to make an org-capture template that matches the settings of org-journal?

There seems to be some feature overlap between both packages, but I'm not enough of an elisper to tackle that…

Fix view-mode for next and previous entry

When viewing an entry using j in the calendar, the entry is opened in view-mode. You can view the previous/next entry from there using C-c b and C-c f. view-mode is supposed to stay active when doing that. However, C-c b/C-c f only stays in view-mode once or twice. After one or two C-c f/b, view-mode turns off.

C-c f/b call the functions org-journal-open-next-entry, org-journal-open-previous-entry.

Those functions have this code in there:

(if view-mode
    (view-file filename)
  (find-file filename))

I suppose this fails after two iterations for some reason.

Deeper folder structure

Org Journal File Format: %Y/%m/%d.org

When I try to save my journal entry: No such directory.

😿

Cursor position after new entry

When I hit C-c C-j to create a new entry on my journal, the first thing I always have to do, is to skip to the end of the line before I start writing. I know, not a big issue but I would prefer the cursor position right after the time so I can skip C-e.

Calendar search (f-w) brings the daily entries in *reverse* order

This is annoying because the days are in the right, chronological order, see example:

Monday, 04.05.2015 ** 16:30 2️⃣⬇️
Monday, 04.05.2015 ** 10:00
Monday, 04.05.2015 ** 08:07 1️⃣⬆️
Tuesday, 05.05.2015 ** 14:00 3️⃣⬇️
Tuesday, 05.05.2015 ** 12:08
Tuesday, 05.05.2015 ** 09:00
Tuesday, 05.05.2015 ** 08:30 2️⃣⬆️
Wednesday, 06.05.2015 ** 14:45 4️⃣⬇️
Wednesday, 06.05.2015 ** 14:30
Wednesday, 06.05.2015 ** 07:39 3️⃣⬆️
Thursday, 07.05.2015 ** 15:00 5️⃣⬇️
Thursday, 07.05.2015 ** 14:00
Thursday, 07.05.2015 ** 11:30
Thursday, 07.05.2015 ** 10:00
Thursday, 07.05.2015 ** 08:09 4️⃣⬆️

Follow the numbers and arrows and you'll see what I mean...

It would be much nicer if each day's first entry would follow the previous day's last entry.

Reorganise README

I've been using org-journal for quite a long time now. Recently I realised that it has a fancy new feature I really missed ("carry over", to be precise) mostly because current README is a bit messy.

How about cleaning things up a bit? I can do it myself in a PR if @bastibe agrees here with me.

How can I set journal location via variable instead of modifying source code

Whenever org-journal updates, it breaks my ability to schedule tasks until I modify the source code. I understand that it may be possible to use customize, but I really hate the way it just haphazardly dumps random crap into my init file (I have a nicely organized, literate init file and customize just shits on it). Would it be possible to either name the set function or is there some way I can call the unnamed set function?

Emacs version

There was a recent question on stackexchange about an error with org-journal.
I suspect that it does not work with emacs version 23.1.
Can you confirm this?

installation warnings

Just installed on a new machine, org journal works but got some warnings during installation from elpa:

In org-journal-update-auto-mode-alist:
org-journal.el:62:27:Warning: reference to free variable
    `org-journal-file-pattern'

In org-journal-read-or-display-entry:
org-journal.el:412:23:Warning: assignment to free variable `view-exit-action'

Agenda file x is not in `org-mode'

When I type C-c a a, this message appear in minibuffer:
Agenda file /mnt/hgfs/iemacs/journal/20140707 is not in `org-mode'

There are some files like:20140707 20140708 20140709... In journal directory .
When I change file name to 20140707.org,the message show 20140708 is not in org-mode'.When I change file name to 20140708.org,the message show 20140709 is not inorg-mode'...seem org-journal do not know file type.

orgmode assumes scheduled/deadline time from headline

I use org-journal mostly as my first point when I need to write down something out of my mind. So I don't need to care about first, I can always refile the stuff later. A lot of my entries I make over the day are TODO items:

* Monday, 13. Jul 2015

** 08:15 some thoughts...
** TODO 10:23 something i have todo
SCHEDULED: <2015-07-17 Fri>

Now all of them start with a time which is exactly what I want but when I take a look in my agenda, this time is used as the timestamp for scheduled. Same happens, if I would define a deadline before.

Friday 17 July 2015
JOURNAL:        10:23......... Scheduled: TODO something i have todo

I don't like this behaviour, because this is wrong. Just because I started a journal entry on 10:23 and scheduled the task some days later, doesn't mean this is the time I'm gonna work on this task. I schedule a lot of tasks this way, without an exact time, this is just how my workflow looks. I don't need always a time for my tasks. The only workaround so far is, to remove the timestamp from the beginning of the journal entry or define a timestamp for the scheduled/deadline date as well.

Idk, maybe this is the default behaviour how orgmode works or is there something wrong with org-journal? Thanks for help! 😽

Option to move TODOs from previous days to the current day

This could be implemented as

  • an automatic function of org-journal-new-entry
  • a separate interactive function invokable on arbitrary headlines

Personally, I lean towards the first proposition. If a customizable option is set, move TODOs from the previous day to the current day on when creating the current day's entry.

org-journal default path conflicting with user set path on update

Hi,

Just noticed after last melpa update that the org-journal default path overrides the user set path after update. I am not sure this is an issue to post here (never interacted like this before) - I thought I'd signal about it; it would be nice if somehow an update would not require ulterior user interaction regarding custom path settings - if possible.

Customize file name and structure of the journal

Hi bastide,

Very useful mode for me. Thanks.

Would be very cool if it was possible to customize the file format (for instance YYYY-MM-DD.txt) and the structure of the journal (but I'm not able to programm anything). For instance, I would prefer a structure like that:

 #+TITLE: 06/04/13
 * 10:28 Company meeting

journal format

Following samspo suggestions in issue #2, I added

(setq org-journal-file-format "%Y%m%d.txt")
(setq org-journal-file-pattern "201[0-9][0-9][0-9][0-9][0-9].txt")

to my .emacs but encounters problems when calendar is called. First, it won't allow you to visit future dates when "]" is pressed. The error message is " There was no year zero". Secondly, when I set journal directory to a folder in my dropbox, only "Fundamental mode" is used and not the "org-mode", however, if I use the default directory (~/Documents/journal/), org-mode as a major mode is used. Interestingly, if I change the directory options directly within the org-journal.el file to point to where I would like it to be in dropbox, org-major mode is used.

Thirdly, is it possible to activate the calendar the moment "C-c j" is pressed? Lastly, when in calendar mode, and you have the cursor anywhere (not on any date) and you try to navigate the journal list with "[" or "]", you'll get an error message "Wrong type argument: number, nil"

Option to make TODOs carry over from the previous day?

I know org mode has a global todo list, but that's kind of messy*. Is there a way to get new journal entries to carry over TODOs from the previous day? IE, when a new journal entry is created, it checks the last journal entry, and copies any headers marked TODO. Because it only checks the previous day, marking the entry as done or removing it on the current day would prevent it from being carried over.

I'm having trouble with the (`[^.]..org'|[0-9]+) regex example mentioned on the wiki. It keeps finding my autosaves and thus listing every TODO entry twice.

Ability to ask me how my day was on end of the day/week?

Hi bastibe! Thanks for sharing this awesome plugin!

However, there is one thing that I still miss. I loved the Oh life. What Oh Life was doing, is asking me via mail at the end of every week (or at the end of every day, if you want that) how my week was going. I reply it with the mail, and then on the site I see a log sorted on date where I could look up how I experiened my week on week 27 in 2014 for example. It gave me so much insight.

So I'm wondering if it's something that Emacs could ask in the input buffer, when it's the end of the week and there is no log yet?

It would be so great!

Thanks in advance for your answer.

Option to keep weekly or monthly diaries instead of just daily?

I want my journal to be formatted something like this, with a single file for each week.

* Monday, 01/04/16
** 10:28 Company meeting
Endless discussions about projects. Not much progress
* Tuesday, 01/05/16
** 10:30 Another company meeting
Same as yesterday.

I have tried adding (setq org-journal-file-format "%Y%m%U"). This way, on the second day onwards until the next weeks starts, new entries go to the same file (20160101), which is almost what I want. But this does not automatically give me a new date heading. So unless I add it manually, I end up with this:

* Monday, 01/04/16
** 10:28 Company meeting
Endless discussions about projects. Not much progress
** 10:30 Another company meeting
Same as yesterday.

I guess this is a feature request, unless you can suggest other settings to try?

Create new entry on current journal buffer

Thank you for this great extension!

I really like it so far, but there is a problem I dont know how to solve.

I would like to add another entry in my current open journal file. But C-c C-j will not work then, instead org-goto will open. The only way to add a new entry then, is to change the buffer to another file and hit C-c C-j again.

Any workaround or is this the supposed way of org-journal?

Thanks a lot!

"Symbol's function definition is void: org-agenda-diary-entry" error in calendar date selector

In fact, I am getting different errors based on my org version.

Version 8.2.5

  1. Enable org-journal-mode.
  2. Open the calendar date selector via C->.
  3. Select any date.
  4. press "i" and the error message appears: "Symbol's function definition is void: org-agenda-diary-entry".

Version 7.9.3f

  1. Enable org-journal-mode.
  2. Open the calendar date selector via C->.
  3. Select any date.
  4. press "i" (msg with "Diary entry day anniversary block" etc. appears, I assume this is normal)
  5. press "j" and the error message appears: "Buffer is read-only: #" and in the big main buffer a file list (of the current working directory?)

Any ideas?

Encryption doesn't work with default settings.

If you enable encryption and use the default journal filename format then Emacs will throw an error because the journal buffer doesn't have org mode enabled and it uses org-set-tags-to here. org-set-tags-to relies on org buffer-local variable which since org-mode is not on is not initialized properly.

I suppose the best fix would be to enable org-mode when opening/creating/operating on journal files. Currently I fixed it by changing org-journal-file-format to %Y-%m-%d.org (I wanted that anyway so it's fine for me).

Please reserve C-c j for user keybindings

Hi! Thanks for working on org-journal. I noticed that you bind C-c f, C-c b, and C-c j by default. Since C-c keybindings are reserved for the user, would you consider converting these to suggested keybindings in the documentation, or define something like a (defun org-journal-setup () ...) that people can call if they want? Thank you!

Allow org-journal to use .org suffix

As opposed to altering org-agenda-file-regexp (which seems more likely to have side effects and be error prone in installation) I would like to have the option of simply defining an org-journal-file-suffix to be ".org". The current behavior could be achieved by leaving it undefined.

new journal entry buffer ignores .dir-locals.el

I am using org-journal-mode. I have created .dir-locals.el in my ~/Documents/journal directory and it gets correctly applied if I open a file the usual way. However, if I hit the C-xC-j to add a new entry and the entry is in a new day, the opened buffer does not have the modifications I apply through .dir-locals.el.

Can I make it recognize and process .dir-locals.el for new day journal entry buffers?

My .dir-locals.el:

((nil
  (fill-column . 79)
  (indent-tabs-mode)
  (show-trailing-whitespace . t)
  (whitespace-style face trailing lines-tail space-before-tab indentation empty)
  (whitespace-newline . t))
 (org-journal-mode
  (typo-language . "Czech")
  (typo-mode . t)
  (ispell-local-dictionary . "czech")
  (flyspell-mode . t)
  (whitespace-action warn-read-only auto-cleanup)))

(cf. http://emacs.stackexchange.com/questions/14247/org-journal-mode-new-entry-ignores-dir-locals-el)

Issues when in auctex mode and a suggestion

The C-c C-j command does not bring up journal in all major modes. When using latex, for example, this key binding does not bring up journal for entry. Is there a way to force this key bind to work in all (major/minor) mode?

Also I know that in org-capture, the key binding C-c C-c closes the capture buffer. Is it possible to implement the idea in org-journal? I know this key bind is used to assign tags but that only happens when at a heading (, *,***, etc) line. You can implement it to the effect that when not at a heading line and the C-c C-c key is pressed, the journal closes.

Encryption still not working when not using default config

Encryption still not working . Here is my configuration:

(setq org-journal-dir "~/wb/journal")
(setq org-journal-file-format "%Y%m%d.org") 
(setq org-journal-enable-encryption t)    

If I just added

(setq org-journal-enable-encryption t) 

and do not change other settings , Encryption worked well.
Version Info:

GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0)  
Org-mode version 8.2.10 (release_8.2.10 @ /opt/local/share/emacs/24.5/lisp/org/)
Mac OSX 10.10.3  with gnupg (gpg) command installed

Starting emacs with a journal.

Right now when I use C-c C-j the journal opens up in a new split window. The ability to get a journal entry with one keystroke is convenient, but I don't really need a new window, and honestly it would be even more convenient if emacs opened straight into a journal instead of displaying the scratch buffer.

Is this feature supported, and if not, how would I go about adding it?

Provide sample config file

Hey there, me again! 😺

Would be nice to see a sample configuration in the readme. Most of us dont even know how to write elisp but still want to use the power of emacs and orgmode. This would be really helpful so I just can go here and c/p and change what i want. Maybe from defaults.

Happy easter! 🐰

Add a way to disable global binding

It would be nice to add a way to disable globally binding C-c C-j in case the user wants to use those keys for something else, say, switching to line mode in term-mode.

void function org-journal-get-list

I have just started to get this error on an Ubuntu Trusty machine. My Arch computers work fine. I can trigger the error by trying to schedule a date in an org file (Ctrl-S). Backtrace appended:

Debugger entered--Lisp error: (void-function org-journal-get-list)
org-journal-get-list()
run-hooks(calendar-initial-window-hook)
calendar-basic-setup(nil)
calendar()
org-read-date(nil to-time nil nil nil nil)
byte-code("�\306>\203L \203� ;\203L\307\310 "\203L\212\311\312!\210\212\313 \210)\314��\315�\316=\203/\f\2020 �\312#\203K\317\320!�\321\322\323\n!\"�3\n\205I\324\n!�4+�\203t ;\203d\321\322\325 �3\326�3!#\"\202s \206s\327\314\330\314\211�3�4&��\212\214~\210\311\312!\210\314y\210n\204\206\331c\210�5\312�6\332�!)\262�\203*�\333\314w\210�\203\243��7B\202\245�7\314�8\211�9\203&��9@�8\212\315\334\335�8\336\"\203\303�:\202\340\335�8\337\"\203\317 \202\340\335�8\316\"\203\333\f\202\340\340\341�8\"P\342 \312#\203��\343\344!\210\332\345!\203\366\343\344!\210�\204���8\336=\203��\212\346 \210\332\347!\203��\350\351!|\210))\332\352!\203��\343\344!\210�9A\211�9\204\256_\202H��\2046�\353\354\314"\210\202H�\355\331!\210\356u\210�;\203H�\357\360 T!\210�\205\233�\335�\336"\203X��<\202t�\335�\337"\203d��=\202t�\335�\316"\203p��>\202t�\340\341�"\361\261�\210\362 �?\206\207��\336=\205\207��@�\336=\314\211�AC&��l\204\231�\361c\210\n)_\207" [what time ts end org-scheduled-time-regexp org-deadline-time-regexp (scheduled deadline) string-match "^[-+]+[0-9]" org-back-to-heading t outline-next-heading nil re-search-forward scheduled match-string 1 apply encode-time org-parse-time-string org-get-compact-tod org-read-date-analyze decode-time org-read-date to-time "\n" looking-at " " " " eql closed deadline error "Invalid planning type: %s" line-end-position replace-match "" "--+<[^>]+>" beginning-of-line "[ ]$" line-beginning-position 2 "[ ]+" throw exit insert-before-markers -1 org-indent-to-column org-outline-level " " ...] 8)
org-add-planning-info(scheduled nil closed)
org-schedule(nil)
call-interactively(org-schedule nil nil)

org-journal-mode files not in 'org-mode'

I'm trying to pull To-do's from my agenda files which included my journal directory, but I'm getting the error "Agenda file /home/will/Journal/20131223 is not in `org-mode' When I scroll through the journal files that are loaded into buffers, I see that all of them are in fundamental mode rather than Journal mode for some reason.

Relevant part of emacs config:

    (require 'cl)
    (require 'org-journal)
    (add-to-list 'org-agenda-files (expand-file-name "~/Journal"))
    (setq org-agenda-file-regexp "\\`[^.].*\\.org\\'\\|[0-9]+")

I manually added the change that ramLlama authored to org-journal.el and now when I try to get a full agenda, all of the journal files are correctly loaded in Journal mode, but I still get the error that they're not in `org-mode'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.