From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [Orgmode] Re: [Feature Request] Cross headings in tables Date: Mon, 30 May 2011 23:02:45 +0200 Message-ID: <87zkm3yk96.fsf@Rainer.invalid> References: <87ocb96ebn.fsf@Rainer.invalid> <87eic4le49.fsf@Rainer.invalid> <87d3nwzo22.fsf@Rainer.invalid> <87ei7qxiuf.fsf@Rainer.invalid> <87wrlakxcv.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR9c7-0005EM-9d for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QR9c6-00039P-3D for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:03:03 -0400 Received: from lo.gmane.org ([80.91.229.12]:37254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR9c5-000398-PY for emacs-orgmode@gnu.org; Mon, 30 May 2011 17:03:02 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QR9c4-0001ql-OB for emacs-orgmode@gnu.org; Mon, 30 May 2011 23:03:00 +0200 Received: from p57aadea9.dip.t-dialin.net ([87.170.222.169]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 May 2011 23:03:00 +0200 Received: from Stromeko by p57aadea9.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 May 2011 23:03:00 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Carsten, Carsten Dominik 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