From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [Orgmode] Re: [Feature Request] Cross headings in tables Date: Tue, 31 May 2011 09:21:33 +0200 Message-ID: References: <87ocb96ebn.fsf@Rainer.invalid> <87eic4le49.fsf@Rainer.invalid> <87d3nwzo22.fsf@Rainer.invalid> <87ei7qxiuf.fsf@Rainer.invalid> <87wrlakxcv.fsf@Rainer.invalid> <87zkm3yk96.fsf@Rainer.invalid> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRJJI-0001QB-LZ for emacs-orgmode@gnu.org; Tue, 31 May 2011 03:24:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRJJH-0003I0-2w for emacs-orgmode@gnu.org; Tue, 31 May 2011 03:24:16 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:56502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRJJG-0003Hg-PZ for emacs-orgmode@gnu.org; Tue, 31 May 2011 03:24:15 -0400 Received: by ewy9 with SMTP id 9so1681798ewy.0 for ; Tue, 31 May 2011 00:24:13 -0700 (PDT) In-Reply-To: <87zkm3yk96.fsf@Rainer.invalid> 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: Achim Gratz , Lawrence Mitchell Cc: emacs-orgmode@gnu.org Hi Achim, On 30.5.2011, at 23:02, Achim Gratz wrote: > Hi Carsten, >=20 > 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. >=20 > 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. >=20 > 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 = =97 > 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...... >=20 >> Also documentation in the manual is missing - one >> or two sentences in the right place should be enough. >=20 > 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 >=20 > 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 (>=3D 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 (>=3D = 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) >=20 >=20 > Regards > Achim. > --=20 > +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ >=20 > Factory and User Sound Singles for Waldorf Blofeld: > http://Synth.Stromeko.net/Downloads.html#WaldorfSounds >=20 >=20