[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [Orgmode] Re: [Feature Request] Cross headings in tables
From: |
Carsten Dominik |
Subject: |
Re: [O] [Orgmode] Re: [Feature Request] Cross headings in tables |
Date: |
Tue, 31 May 2011 09:21:33 +0200 |
Hi Achim,
On 30.5.2011, at 23:02, Achim Gratz wrote:
> Hi Carsten,
>
> Carsten Dominik <address@hidden> writes:
>> this looks pretty good. One thing I found missing is that
>> header lines should be exempted from column formulas being
>> applied. This works for the headlines at the top of the
>> table, but not in the middle.
>
> thank you for having a look. You are right, but this looks like
> something that goes a bit deeper than my current understanding, I'm
> afraid.
>
> Header lines don't appear to be marked in any way, but simply skipped
> over before starting the formula calculation. Consequently, the column
> formula is evaluated for any header line when doing a C-c * directly in
> the header, which might be considered a bug. I won't touched this
> aspect of the code since it will probably have farther reaching
> consequences if changed. I quickly hacked in some extra stuff that
> looks for cross headers and skips them while the full table is updated —
> but I'm not sure this is the right thing to do and the way the program
> logic works requires me to check certain pathological cases twice, which
> is a bit ugly. I've just rebased against current master and pushed
> everything back to the repo.
I think a better strategy would be to find these additional
header lines right before this section of the recalculate function:
;; Now evaluate the column formulas, but skip fields covered by
;; field formulas
and mark those extra header lines with the org-untouchable text property.
Then you can let the column formulas do their game, and fields marked
by this property will automatically exempted......
>
>> Also documentation in the manual is missing - one
>> or two sentences in the right place should be enough.
>
> Sure, but I'd like to get it working correctly first. :-)
Fair enough.
> I'm using this code at work and things have gone smoothly, but I only
> use the HTML backend and certainly don't exercise the full breadth of
> the table functionality (obviously no column formulas were used by me,
> for instance).
Another part which might need a look to support this
would be `orgtbl-to-generic'.
> While testing I stumbled upon this: if a buffer has no undo information
> associated, org-self-insert-command produces an error while trying to
> edit the formula. This code path may need to be protected against this
> (admittedly rare) case, I've been triggering it while testing your
> example directly in the gnus article buffer.
This issue is fixed, thanks for the report.
Finally: this patch goes clearly beyond the TINYCHANGE
limits. What is yours, and Lawrence's copyright status with the FSF?
- Carsten
>
> Debugger entered--Lisp error: (wrong-type-argument listp t)
> cadr(t)
> (not (cadr buffer-undo-list))
> (and (> org-self-insert-command-undo-counter 0) buffer-undo-list (not (cadr
> buffer-undo-list)) (setcdr buffer-undo-list (cddr buffer-undo-list)))
> (if (>= org-self-insert-command-undo-counter 20) (setq
> org-self-insert-command-undo-counter 1) (and (>
> org-self-insert-command-undo-counter 0) buffer-undo-list (not ...) (setcdr
> buffer-undo-list ...)) (setq org-self-insert-command-undo-counter (1+
> org-self-insert-command-undo-counter)))
> (if (not (eq last-command ...)) (setq org-self-insert-command-undo-counter 1)
> (if (>= org-self-insert-command-undo-counter 20) (setq
> org-self-insert-command-undo-counter 1) (and ... buffer-undo-list ... ...)
> (setq org-self-insert-command-undo-counter ...)))
> (if org-self-insert-cluster-for-undo (if (not ...) (setq
> org-self-insert-command-undo-counter 1) (if ... ... ... ...)))
> (cond ((and org-use-speed-commands ...) (cond ... ... ... ...)) ((and ... ...
> ... ...) (let ... ... ... ... ...)) (t (setq org-table-may-need-update t)
> (self-insert-command N) (org-fix-tags-on-the-fly) (if
> org-self-insert-cluster-for-undo ...)))
> org-self-insert-command(1)
>
>
> Regards
> Achim.
> --
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
>
> Factory and User Sound Singles for Waldorf Blofeld:
> http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
>
>