On Sun, Dec 16, 2012 at 6:13 AM, W. Bentley MacLeod <
wbma...@gmail.com> wrote:
> Hi Herb,
>
> I tried out your latest version from github and have the following problem
> when I run the agenda command (,ag a)
> E212 Undefined variable b:v
> E15 Invalid exploress "syntax match DONETODO,"
Bentley --
This could be a result of insufficient testing by me of latest bugifx.
I'll check it out.
>
> More generally, with the previous version, after I run the agenda command, I
> see all my org files, but folding, and adjustments to structure no longer
> works? The agenda mini-buffer seems to work as advertized. This bug is a
> serious issue for me since it means that I cannot edit org files after
> running the agenda command (I have to just open the files one by one).
Given your description I think what you're seeing may be the expected
behavior. See if my explanation below fits with what you're
experiencing. If after an agenda search folding still works in any
files you've opened directly but not in files that were opened
automatically by agenda search, then the explanation below is relevant
to your issue.
You are first person to bring this to my attention, perhaps because
not many people are seriously using VimOrganizer with many agenda
files (or because other people just (1) said nothing and gave up or
(2) naturally found navigation method that avoids the folding
problem).
If the explanation below is for something different from what you're
seeing, please let me know. I haven't documented this behavior very
well and it is helpful to know it for many use-cases of VimOrganizer,
so it wasn't wasted effort on my part even if your issue is something
else. I should get more info on this into the main help file. . . .
Anyway, hope this helps.
-- Herb
EXPLANATION FOR WHY FOLDING MAY BE OFF IN AN ORG BUFFER:
First, I should say that one issue with replicating Org in Vim is that
the folding in Vim is implemented differently from folding in Emacs.
One major difference is that in Vim when folding is initialized in a
file (e.g., generally when file is loaded into a Vim "window") it
takes some time to initialize, which with larger files can be
noticeable. On my slow machine I think it generally takes a second or
so for every two or three thousand lines in file. This is not
noticeable with a single small file but it can be come noticeable with
(1) a large file, and/or (2) agenda searches where many files are
being opened for first time.
Because agendas can include ten, twenty, or a hundred or more files, I
made decision to avoid initialization of folding when files are opened
by an agenda search. This means an agenda search -- even of hundreds
of files -- can run quickly, but has downside that the files opened by
the search will have folding disabled. To make this more palatable,
things are set up so that folding is automatically turned on in a file
if you navigate to it by an operation from the agenda. For example,
pressing <enter> on an entry in the agenda will focus the associated
org file AND turn folding on if it's not already. This generally
works fine, since even if you had 100 files in agenda your search went
fast, then you just have a possible fraction of a second delay for
each file you move to from agenda (the delays for initialization of
folding become spread out and not noticeable).
So one way to avoid problem with folding not being on is to navigate
to the document by using an operation from the agenda buffer. The
other way is to move between org files using the 'Goto' command from
the Agenda Files Dashboard. This is accessed by built-in keymap of
,afg , where ,af opens the dashboard and 'g' shows list of open
agenda files and allows single key access. (This method is not
optimal for agendas where there are scores of agenda files, since
currently list is useful only for some smaller number.)
Given the explanation above, you can understand why when moving
between some org documents by using mouse on tab headers, or by using
standard Vim commands, the folding will not get turned on
automatically. Let me emphasize that folding is initially off only
for files that were opened automatically in an agenda buffer search,
never for a file opened directly by you.
A related but different issue is that, in general, you will want to
keep your org documents open on different tab pages. Folding gets
initialized in a vim document whenever it is loaded into a "window".
Any command that changes the buffer that is viewed in the current
window "loads" the target buffer into the window (even if buffer was
already loaded in Vim) and folding will be initialized, or
reinitialized even if it's be initialized before. This means that
using standard buffer navigation to move between org documents in a
single window can have significant lag. The lag is completely avoided
if documents are kept in separate tabs, which effectively keeps them
in a "permanent" window (i.e., initializes folding only once).
All of the above is why VimOrganizer was designed to operate using
tabs for different org files, to not do so would have had unacceptable
performance problems. It becomes completely natural to observe the
"each org file in its own tab" rule and to not have problems with
folding being off once you know the rules. If you don't like
appearance of tabs the tab headings can be turned off so there is no
visual cue that tabs are being used rather than buffers (:set
showtabline=0) .