Browse Source

Autoload org-datetree-find-create-date

Stephen Eglen writes

> Within the agenda buffer, if I type 'i j' to jump to the current date I
> get:
>
> Debugger entered--Lisp error: (void-function org-datetree-find-date-create)
>  org-datetree-find-date-create((1 20 2010))
>  org-agenda-diary-entry-in-org-file()
>  org-agenda-diary-entry()
>  call-interactively(org-agenda-diary-entry nil nil)
>
> If I then do M-x load-library org-datetree
>
> and repeat 'i j', it works.  Should this function be autoloaded?
Carsten Dominik 15 years ago
parent
commit
566dac98b3
3 changed files with 7 additions and 0 deletions
  1. 5 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-agenda.el
  3. 1 0
      lisp/org-datetree.el

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2010-01-20  Carsten Dominik  <carsten.dominik@gmail.com>
 2010-01-20  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure
+	org-datetree.el is loaded.
+
+	* org-datetree.el: autoload `org-datetree-find-day-create'
+
 	* org-latex.el (org-export-latex-hyperref-format): New option.
 	* org-latex.el (org-export-latex-hyperref-format): New option.
 	(org-export-latex-links): Use `org-export-latex-hyperref-format'.
 	(org-export-latex-links): Use `org-export-latex-hyperref-format'.
 
 

+ 1 - 0
lisp/org-agenda.el

@@ -6832,6 +6832,7 @@ The cursor may be at a date in the calendar, or in the Org agenda."
      ((equal char ?j)
      ((equal char ?j)
       (org-switch-to-buffer-other-window
       (org-switch-to-buffer-other-window
        (find-file-noselect org-agenda-diary-file))
        (find-file-noselect org-agenda-diary-file))
+      (require 'org-datetree)
       (org-datetree-find-date-create d1)
       (org-datetree-find-date-create d1)
       (org-reveal t))
       (org-reveal t))
      (t (error "Invalid selection character `%c'" char)))))
      (t (error "Invalid selection character `%c'" char)))))

+ 1 - 0
lisp/org-datetree.el

@@ -39,6 +39,7 @@ This is normally one, but if the buffer has an entry with a DATE_TREE
 property, the date tree will become a subtree under that entry, so the
 property, the date tree will become a subtree under that entry, so the
 base level will be properly adjusted.")
 base level will be properly adjusted.")
 
 
+;;;###autoload
 (defun org-datetree-find-date-create (date &optional keep-restriction)
 (defun org-datetree-find-date-create (date &optional keep-restriction)
   "Find or create an entry for DATE.
   "Find or create an entry for DATE.
 If KEEP-RESTRICTION is non-nil, do not widen the buffer.
 If KEEP-RESTRICTION is non-nil, do not widen the buffer.