1

Putting (org-journal-new-entry) in the init file doesn't work, neither does setting the scratch buffer mode to journal-mode.

Kurt Hesselbart's answer works only halfway if there already is an entry for the day, instead of adding a new one it opens the last. As the function description says:

Giving the command a prefix arg will just open a today's file, without adding an entry

However it didn't work at all without a prefix arg.

Works not at all if there is no entry for the day already, starting emacs with the -debug-init option then gets the following backtrace:

Debugger entered--Lisp error: (error "before first heading")
  signal(error ("before first heading"))
  error("before first heading")
  outline-back-to-heading(t)
  show-entry()
  org-journal-new-entry((22041 37049 594411 222000))
  eval-buffer(#<buffer  *load*> nil "/home/anon/.emacs" nil t)  ; Reading at buffer position 7751
  load-with-code-conversion("/home/anon/.emacs" "/home/anon/.emacs" t t)
  load("~/.emacs" t t)
#[0 "\205\262
2

The org-journal-new-entry function has an obligatory and an optional argument. The first (and mandatory) argument tells the function whether or not to add a new entry, if there is already a journal file for this day.

The second (and optional) argument takes a value for inserting a specific time.

If called interactively, the value of the mandatory argument is given as prefix argument. If not called interactively, the value of the obligatory argument should be nil to be equivalent to be called without a prefix argument. Any non-nil value is equivalent to called interactively with a prefix argument.

The optional argument isn't necessary here, since it wasn't ask to insert a divergent time value.

Adding delete-other-window helps to have the journal being the only window.

(require 'org-journal)
(org-journal-new-entry nil)
(delete-other-windows)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.