column view

45 views
Skip to first unread message

SKempf

unread,
Jun 27, 2012, 10:21:38 AM6/27/12
to vimorg...@googlegroups.com

I am having trouble getting the column view to function properly. When I run ,m and "t" to toggle column view on, I get the error

Error detected while processing function OrgColumnsDashboard:
line   93:
E716: Key not present in Dictionary: org_columns_show_headings == 0
E15: Invalid expression: b:v.org_columns_show_headings == 0

Is there perhaps a plug I might not have installed that I need? I've tried setting the above variable in my .vimrc file with now luck.

I'm running the current package version of Vim on Ubuntu 12.04 (7.3.429) and I am using the latest version of vimorg from the github repository master branch "959eb2a". I also have vimoutliner plugin, but have moved it out of the way to debug this.

Thanks,
Severin

Herbert Sitz

unread,
Jun 27, 2012, 11:39:51 AM6/27/12
to vimorg...@googlegroups.com
On Wed, Jun 27, 2012 at 7:21 AM, SKempf <severi...@gmail.com> wrote:
>
> I am having trouble getting the column view to function properly. When I run
> ,m and "t" to toggle column view on, I get the error
>
> Error detected while processing function OrgColumnsDashboard:
> line   93:
> E716: Key not present in Dictionary: org_columns_show_headings == 0
> E15: Invalid expression: b:v.org_columns_show_headings == 0

Severin ---

Sorry for your problem, but I can't think of what the problem would
be. It should not be related to requiring any addon. The dictionary
key 'org_columns_show_heading' is created at the beginning of the
OrgColumnsDashboard function if it doesn't exist, and I can't figure
out how it could be gone later in the function.

When you press ',m' to show Column Dashboard, does it say 'on' or
'off' on line where it says 'Show column headers is currently:'?
That value is read from the org_columns_show_heading key so if you get
that it sounds like something must be happening after that, however I
can't imagine what.

I assume you're testing this in a way that keeps things simplest?: 1.
Start up Vim, 2. Open your org document, 3. Show columns
dashboard with ',m' and press 't'. In particular make sure no
windows are split and no other documents are open (those shouldn't
make any difference, but I'm just suggesting get everything else out
of equation to track down problem. )

Also, is this the entirety of the error message you receive?:
> Error detected while processing function OrgColumnsDashboard:
> line 93:
> E716: Key not present in Dictionary: org_columns_show_headings == 0
> E15: Invalid expression: b:v.org_columns_show_headings == 0

If there was something more it might help in tracking things down,
since I'm not seeing problem offhand from that error report.

-- Herb

SKempf

unread,
Jun 27, 2012, 3:18:48 PM6/27/12
to vimorg...@googlegroups.com, hes...@gmail.com
There are no other errors; at least that I can find (I am checking with the "messages" command).

I am a bit new to vimscript, but I gave a go at trying to narrow done where the problem is. Anytime ToggleColumnView is run from the dash board (e.g. with 't' or 'r' or '0'), when it splits the window for the ColHeadBuffer inside ColHeadWindow (around line 6523), it no longer has the "org_columns_show_headings" key in the b:v dictionary (OrgColumnsDashboard -> ToggleColumnView -> ColHeadWindow). So, as a simple test, I did:

...
+   let tmp = b:v.org_columns_show_headings
    1split ColHeadBuffer
    call s:ScratchBufSetup()
   
    execute "setlocal statusline=%#OrgColumnHeadings#%{<SNR>" . s:SID() . '_ColumnStatusLine()}'
    set winfixheight
    set winminheight=0
    let w:v = {'org_column_item_head': a:itemhead}
   
    wincmd j
+   let b:v.org_columns_show_headings = tmp
...
This makes the error go away; that is, no errors when I run the column dashboard. However, no tags ever show up. I have the straight bars on the right side with the line count, e.g. "  heading 1      |  1|".

My example outline looks like this (except for the numbers):
1
2* Outline
3** heading 1
4   :buy:work:
5** heading 2
6   :work:
7*** sub heading
8    :mytag:

Although not related, I saw you had a patch for 7.3.46 for color folding. That patch cannot be applied directly because there have been some changes in 7.3.429. I briefly browsed the patch list to see if perhaps something with buffers was changed, but nothing really popped out at me. (ref ftp://ftp.vim.org/pub/vim/patches/7.3/README).

Severin

Herbert Sitz

unread,
Jun 27, 2012, 3:56:15 PM6/27/12
to vimorg...@googlegroups.com
On Wed, Jun 27, 2012 at 12:18 PM, SKempf <severi...@gmail.com> wrote:
> I am a bit new to vimscript, but I gave a go at trying to narrow done where
> the problem is. Anytime ToggleColumnView is run from the dash board (e.g.
> with 't' or 'r' or '0'), when it splits the window for the ColHeadBuffer
> inside ColHeadWindow (around line 6523), it no longer has the
> "org_columns_show_headings" key in the b:v dictionary (OrgColumnsDashboard

I still have no idea what's causing this, haven't had this problem and
nobody else has reported it. If I can't reproduce it on my machine I
don't know how I can solve it. I tend to doubt that it's a Vim
version issue, more likely something in your vimrc or particular
setup.

As a longshot you might see what happens when you comment out the call
to s:ColHeadWindow in the ToggleColumnView function:
------------------------------------
else
call s:OrgSetColumnList(line('.'),a:master_head,a:col_spec)
"call s:ColHeadWindow(w:v.org_column_item_head)
let w:v.columnview = 1
endif
------------------------------------

>
> My example outline looks like this (except for the numbers):
> 1
> 2* Outline
> 3** heading 1
> 4   :buy:work:
> 5** heading 2
> 6   :work:
> 7*** sub heading
> 8    :mytag:

Looks fine, minus the numbers. And I assume all the folding,
highlighting, tag editing, and other VimOrg stuff work okay?

>
> Although not related, I saw you had a patch for 7.3.46 for color folding.
> That patch cannot be applied directly because there have been some changes
> in 7.3.429. I briefly browsed the patch list to see if perhaps something
> with buffers was changed, but nothing really popped out at me. (ref
> ftp://ftp.vim.org/pub/vim/patches/7.3/README).

Yeah, I don't think this is related. Someone just reported that most
recent patch works with the latest Vim version available at googlecode
(7.3.566). I think the patch utility does have some intelligence so
it can do proper patch even if some minor changes have been made.
Otherwise there are few enough lines that it's generally easy to
modify yourself.

-- Herb

SKempf

unread,
Jun 27, 2012, 5:38:45 PM6/27/12
to vimorg...@googlegroups.com, hes...@gmail.com
In any case, thanks for looking into it so quickly. Before I made any changes, I changed my .vimrc file to the example one in Vimorg, which had no effect. I had never used org before, but I really like vim. I am building the org stuff slowly. As far as I know everything else works, like agenda views, dates / calendar, outlining, exporting to PDF even (with the emacs server running).

I commented out the line you suggested and it works like I think it should, with the exception, I have to run it a few times to get the column headers to show up. (e.g. ",mt<CR>,mh<CR>,mh<CR>,mt<CR>"). I have to stop debugging right now, but here is kind of what is happening:
0. before anything -- Column view is off, show headers is off
1. press ,mt  -- folded headlines look right, column view is on, show headers is off
2. press ,mh -- folded headlines no longer have columns, column buffer exists with headings, column view is off, show headers is *off*
3. press ,mh -- view looks the same, column view is off, show headers is on
4. press ,mt -- view looks right with headers in column buffer and columns in org file, column view is on, show headers is on

Severin

Herbert Sitz

unread,
Jun 27, 2012, 5:52:55 PM6/27/12
to vimorg...@googlegroups.com
On Wed, Jun 27, 2012 at 2:38 PM, SKempf <severi...@gmail.com> wrote:
>
> I commented out the line you suggested and it works like I think it should,
> with the exception, I have to run it a few times to get the column headers
> to show up. (e.g. ",mt<CR>,mh<CR>,mh<CR>,mt<CR>").

Silly question: You aren't actually having to press <cr> are you?

> I have to stop debugging
> right now, but here is kind of what is happening:
> 0. before anything -- Column view is off, show headers is off
> 1. press ,mt  -- folded headlines look right, column view is on, show
> headers is off

This is same as what I have with that line commented out. Also a
question, when you say 'off' and 'on' those are the values you're
reading from top info lines of the Columns Dashboard, right?

> 2. press ,mh -- folded headlines no longer have columns, column buffer
> exists with headings, column view is off, show headers is *off*

Here I show column view on and show headers as on.

So major difference here that gets closer to main issue, I"m sure. I
could quickly track down problem on your system, but not sure how this
is happening.

-- Herb

SKempf

unread,
Jun 27, 2012, 11:12:07 PM6/27/12
to vimorg...@googlegroups.com, hes...@gmail.com

Well ... it is usually user error and so it is here.

First off, yes, the <CR> was literal. That is because I'm new to vimscript and wasn't sure how to debug, so I was littering the code with "echoe" messages with variables and positions and such. When it would get to a echoe statement, I would have to press enter to continue. What is the right (or better) way to do it?

I had tried out a lot of various scripts over the past year or so, so I started by just moving my .vim directory out of the way and starting fresh. It worked right off the bat. I spent some time narrowing in on what the actual problem was. It was a statement I commented out in the autoload/org.vim file, based on Daniel Walker's suggestion. I had done this while I was trying to debug a conflict between vimorg and vimoutliner.

As an aside, I tried the latest pull from NrrwRgn and there are potential conflicts there. I ended up with the latest release on vim.org, but I still had to add a "let s:opts = []" at the top of the autoload/nrrwrgn.vim file to get it to work.

Thanks for the quick replies. I like the org stuff so far.

Herbert Sitz

unread,
Jun 28, 2012, 1:32:23 AM6/28/12
to vimorg...@googlegroups.com
On Wed, Jun 27, 2012 at 8:12 PM, SKempf <severi...@gmail.com> wrote:
> First off, yes, the <CR> was literal. That is because I'm new to vimscript
> and wasn't sure how to debug, so I was littering the code with "echoe"
> messages with variables and positions and such. When it would get to a echoe
> statement, I would have to press enter to continue. What is the right (or
> better) way to do it?

Glad you seem to have gotten things sorted out. I do most of my
debugging using Vim's built in debugger. It's surprisingly flexible
and full-featured, but you can't see what's happening on screen as you
trace through (though you can issue echo commands at debugger command
line). See :h debug-mode for more info.

There are also some plugins that provide different kinds of debugging.
Decho is one I've used before. It lets you send echo output to
different window or even different Vim instance. It may have been
superseded by something else in last few years, I'm not up on current
state of debugging plugins:
http://www.vim.org/scripts/script.php?script_id=120

>
> Thanks for the quick replies. I like the org stuff so far.
>

No problem. I haven't done much work on this project lately but hope
to spend some time on it soon.

Regards,

Herb
Reply all
Reply to author
Forward
0 new messages