Unknown Function EditAgendaFiles()

11 views
Skip to first unread message

Jostein Berntsen

unread,
Dec 8, 2012, 8:50:54 AM12/8/12
to vimorg...@googlegroups.com
I just installed VimOrganizer from git and have some problems running some of the functions like ":call EditAgendaFiles()". I get "E117: Unknown Function EditAgendaFiles". I have installed the plugin files into autoload, ftplugin and so on and have this in my .vimrc:

Anything I can check here?

Jostein

Herbert Sitz

unread,
Dec 8, 2012, 12:33:32 PM12/8/12
to vimorg...@googlegroups.com
Jostein --

Offhand I'm guessing the problem is that your calling EditAgendaFiles
before any org file has been opened. That function is in the org.vim
script that resides in the ftplugin directory, which means that script
and functions in it aren't loaded until a filetype of .org has been
opened.

I'm wondering why you want the EditAgendaFiles() call in your vimrc in
the first place. Unless you're trying to pick files randomly by eye
it's better to assign files (or groups of files or directories of
files) to the g:agenda_files varable directly.

For example, you can see how to set up for EditAgendaFiles() in the
sample vimrc in VimOrganizer download:
--------------------------------------------
" g:org_agenda_dirs specify directories that, along with
" their subtrees, are searched for list of .org files when
" accessing EditAgendaFiles(). Specify your own here, otherwise
" default will be for g:org_agenda_dirs to hold single
" directory which is directory of the first .org file opened
" in current Vim instance:
" Below is line I use in my Windows install:
" NOTE: case sensitive even on windows.
let g:org_agenda_select_dirs=["~/desktop/org_files"]
let g:org_agenda_files = split(glob("~/desktop/org_files/org-mod*.org"),"\n")
--------------------------------------------

That code above merely sets things up so EditAgendaFiles() will work
(once an org file is opened). However, if you wanted to actually
assign agenda files in vimrc you can do so directly in code by
assigning to the g:agenda_files variable (notice this is _not_
g:org_agenda_files):

let g:agenda_files = split(glob("~/desktop/org_files/org-mod*.org"),"\n")

Does this help? Or were you trying to do something different by
calling EditAgendaFiles() in vimrc?

-- Herb

Jostein Berntsen

unread,
Dec 10, 2012, 11:40:25 AM12/10/12
to vimorg...@googlegroups.com
Thanks, but I also get this error when I open an .org file and call the
function. ":call EditLink()" works as expected.

Jostein
>

Herbert Sitz

unread,
Dec 10, 2012, 12:13:45 PM12/10/12
to vimorg...@googlegroups.com
On Mon, Dec 10, 2012 at 8:40 AM, Jostein Berntsen <jbe...@broadpark.no> wrote:
>
> Thanks, but I also get this error when I open an .org file and call the
> function. ":call EditLink()" works as expected.
>
> Jostein

Whoops, sorry, EditAgendaFiles is a command, not a function, so you
don't use 'call' you just enter the command:

:EditAgendaFiles

If the call to EditLink() works the command 'EditAgendaFiles' should also.

-- Herb

Jostein Berntsen

unread,
Dec 10, 2012, 12:27:52 PM12/10/12
to vimorg...@googlegroups.com
Thanks, I cleaned up my code in vimrc now, and entered EditAgendaFiles as a
command and now it works.

Jostein

>
Reply all
Reply to author
Forward
0 new messages