emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library?
@ 2011-02-20 19:57 Urs Rau (UK)
  2011-03-19 13:51 ` Matt Lundin
  0 siblings, 1 reply; 3+ messages in thread
From: Urs Rau (UK) @ 2011-02-20 19:57 UTC (permalink / raw)
  To: Org Mode

On latest git version release_7.4-419-g68114f, [Org-mode version 7.4 (release_7.4.419.g68114f)] , I am trying to archive to a date-tree and get the error: 

Symbol's function definition is void: org-datetree-find-year-create

I found that if I '(load "org-datetree.el")' in the scratch buffer, it then succeeds. 

Does org-datetree not get auto-loaded?

Also I have searched the *.el files to find the definition of "org-datetree-find-year-create" and found inconsistent use of the "keep-restriction" check, sometimes it is all lower case, sometimes it is all uppercase, I guess lisp is not case sensitive?

$ find ./ -type f -exec grep -i "keep-restriction" {} /dev/null \; 
./lisp/org-agenda.el:		  (date &optional keep-restriction))
./lisp/org-capture.el:		  (DATE &optional KEEP-RESTRICTION))
./lisp/org-datetree.el:(defun org-datetree-find-date-create (date &optional keep-restriction)
./lisp/org-datetree.el:If KEEP-RESTRICTION is non-nil, do not widen the buffer.
./lisp/org-datetree.el:    (or keep-restriction (widen))

Regards,

-- 
Urs Rau

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

* Re: Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library?
  2011-02-20 19:57 Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library? Urs Rau (UK)
@ 2011-03-19 13:51 ` Matt Lundin
  2011-03-19 13:53   ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Lundin @ 2011-03-19 13:51 UTC (permalink / raw)
  To: Urs Rau (UK); +Cc: Org Mode

"Urs Rau (UK)" <urs.rau@om.org> writes:

> On latest git version release_7.4-419-g68114f, [Org-mode version 7.4
> (release_7.4.419.g68114f)] , I am trying to archive to a date-tree and
> get the error:
>
> Symbol's function definition is void: org-datetree-find-year-create
>
> I found that if I '(load "org-datetree.el")' in the scratch buffer, it then succeeds. 
>
> Does org-datetree not get auto-loaded?

I mentioned this in a previous email, but I'll elaborate a bit here.
Only one function from org-datetree is autoloaded:
org-datetree-find-date-create. None of the other functions is loaded
until this function is called *or* until you evaluate (require
'org-datetree). 

To solve the problem, you could either rewrite the defadvice to use
org-datetree-find-date-create or add (require 'org-datetree) to your
emacs.

To change the advice, simply replace the following lines

--8<---------------cut here---------------start------------->8---
          (org-datetree-find-year-create y)
          (org-datetree-find-month-create y m)
          (org-datetree-find-day-create y m d)
--8<---------------cut here---------------end--------------->8---

with 

--8<---------------cut here---------------start------------->8---
          (org-datetree-find-date-create `(,m ,d ,y))
--8<---------------cut here---------------end--------------->8---

> Also I have searched the *.el files to find the definition of
> "org-datetree-find-year-create" and found inconsistent use of the
> "keep-restriction" check, sometimes it is all lower case, sometimes it
> is all uppercase, I guess lisp is not case sensitive?
>
> $ find ./ -type f -exec grep -i "keep-restriction" {} /dev/null \; 
> ./lisp/org-agenda.el:		  (date &optional keep-restriction))
> ./lisp/org-capture.el:		  (DATE &optional KEEP-RESTRICTION))
> ./lisp/org-datetree.el:(defun org-datetree-find-date-create (date &optional keep-restriction)
> ./lisp/org-datetree.el:If KEEP-RESTRICTION is non-nil, do not widen the buffer.
> ./lisp/org-datetree.el:    (or keep-restriction (widen))

Look at the context in which the uppercase occurs (e.g., a docstring).

Best,
Matt

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

* Re: Re: Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library?
  2011-03-19 13:51 ` Matt Lundin
@ 2011-03-19 13:53   ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2011-03-19 13:53 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode, Urs Rau (UK)


On 19.3.2011, at 14:51, Matt Lundin wrote:

> "Urs Rau (UK)" <urs.rau@om.org> writes:
> 
>> On latest git version release_7.4-419-g68114f, [Org-mode version 7.4
>> (release_7.4.419.g68114f)] , I am trying to archive to a date-tree and
>> get the error:
>> 
>> Symbol's function definition is void: org-datetree-find-year-create
>> 
>> I found that if I '(load "org-datetree.el")' in the scratch buffer, it then succeeds. 
>> 
>> Does org-datetree not get auto-loaded?
> 
> I mentioned this in a previous email, but I'll elaborate a bit here.
> Only one function from org-datetree is autoloaded:
> org-datetree-find-date-create. None of the other functions is loaded
> until this function is called *or* until you evaluate (require
> 'org-datetree). 
> 
> To solve the problem, you could either rewrite the defadvice to use
> org-datetree-find-date-create or add (require 'org-datetree) to your
> emacs.

A third possibility it to wrap the defadvice form into 

(eval-after-load "org-datetree"
   '(defadvice......
  )

This will wait for the time when org-datetree is loaded.

Cheers

- Carsten

> 
> To change the advice, simply replace the following lines
> 
> --8<---------------cut here---------------start------------->8---
>          (org-datetree-find-year-create y)
>          (org-datetree-find-month-create y m)
>          (org-datetree-find-day-create y m d)
> --8<---------------cut here---------------end--------------->8---
> 
> with 
> 
> --8<---------------cut here---------------start------------->8---
>          (org-datetree-find-date-create `(,m ,d ,y))
> --8<---------------cut here---------------end--------------->8---
> 
>> Also I have searched the *.el files to find the definition of
>> "org-datetree-find-year-create" and found inconsistent use of the
>> "keep-restriction" check, sometimes it is all lower case, sometimes it
>> is all uppercase, I guess lisp is not case sensitive?
>> 
>> $ find ./ -type f -exec grep -i "keep-restriction" {} /dev/null \; 
>> ./lisp/org-agenda.el:		  (date &optional keep-restriction))
>> ./lisp/org-capture.el:		  (DATE &optional KEEP-RESTRICTION))
>> ./lisp/org-datetree.el:(defun org-datetree-find-date-create (date &optional keep-restriction)
>> ./lisp/org-datetree.el:If KEEP-RESTRICTION is non-nil, do not widen the buffer.
>> ./lisp/org-datetree.el:    (or keep-restriction (widen))
> 
> Look at the context in which the uppercase occurs (e.g., a docstring).
> 
> Best,
> Matt
> 

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

end of thread, other threads:[~2011-03-19 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-20 19:57 Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library? Urs Rau (UK)
2011-03-19 13:51 ` Matt Lundin
2011-03-19 13:53   ` Carsten Dominik

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