emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Achim Gratz <Stromeko@nexgo.de>, Lawrence Mitchell <wence@gmx.li>
Cc: emacs-orgmode@gnu.org
Subject: Re: [Orgmode] Re: [Feature Request] Cross headings in tables
Date: Tue, 31 May 2011 09:21:33 +0200	[thread overview]
Message-ID: <B46D3431-0FCD-4258-95D6-0104E253D0DD@gmail.com> (raw)
In-Reply-To: <87zkm3yk96.fsf@Rainer.invalid>

Hi Achim,

On 30.5.2011, at 23:02, Achim Gratz wrote:

> Hi Carsten,
> 
> Carsten Dominik <carsten.dominik@gmail.com> 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
> 
> 

  reply	other threads:[~2011-05-31  7:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 17:46 Quoting formula "cookies" in table? Achim Gratz
2010-10-05  1:25 ` Carsten Dominik
2010-10-05 17:10   ` Achim Gratz
2010-10-05 17:24     ` Carsten Dominik
2010-10-06 17:37       ` Achim Gratz
2010-10-05 17:54 ` [Feature Request] Cross headings in tables Achim Gratz
2011-01-16 18:44   ` Achim Gratz
2011-02-02 12:30     ` Lawrence Mitchell
2011-02-02 20:49       ` Achim Gratz
2011-02-08 21:52         ` Achim Gratz
2011-03-20  9:16           ` Achim Gratz
2011-05-29 18:18           ` [Orgmode] " Carsten Dominik
2011-05-30 21:02             ` Achim Gratz
2011-05-31  7:21               ` Carsten Dominik [this message]
2011-05-31  8:07                 ` Lawrence Mitchell
2011-05-31 18:01                 ` Achim Gratz
2011-05-31 18:44                   ` Jambunathan K
2011-06-02 16:12                   ` Carsten Dominik
2011-06-07 19:42                 ` Achim Gratz
2013-02-16 19:21                   ` Achim Gratz
2013-02-17  8:35                     ` Nicolas Goaziou
2013-02-17 19:41                       ` Achim Gratz
2013-02-17 21:06                         ` Achim Gratz
2013-02-22 12:31                       ` Carsten Dominik
2013-02-22 20:33                         ` Achim Gratz
2013-02-22 20:59                           ` Carsten Dominik
2013-02-23  8:10                           ` Bastien
2013-02-23 12:26                       ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B46D3431-0FCD-4258-95D6-0104E253D0DD@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=wence@gmx.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).