emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [Orgmode] Re: [Feature Request] Cross headings in tables


From: Achim Gratz
Subject: Re: [O] [Orgmode] Re: [Feature Request] Cross headings in tables
Date: Mon, 30 May 2011 23:02:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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.

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

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

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.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]