emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Cc: Carsten Dominik <carsten.dominik@gmail.com>
Subject: dynamic block for columnview: indent and TBLFM
Date: Wed, 2 Nov 2011 18:06:44 +0100	[thread overview]
Message-ID: <CALn3zohgqUs=C0Dqx=JuA5hYjn21ZpPBNOY92h_y8cRNYnjD8A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2392 bytes --]

Hi all

There are some issues with dynamic block for columnview. Attached are
four minimal and complete example test files indent*_tbl*.org (remove
.txt) with different wrong behaviors dependent on if the dynamic block
is indented and if there is already a table from a previous update or
not. The test is always C-c C-c on the dynamic block header for
columnview with emacs -q, 23.3.

I searched related changes with git bisect to see if by chance I would
be able to resolve the issues by myself, but this seems too
complicated to me. If they might be interesting, from present to past:

- release_7.7-508-ga081581 (2011-11-02):

  still the same test results as release_6.30d-851-g74a59c0, see next

- commit 74a59c0c008e1123a0cadfa9933001bfc773ee85
  Author: Carsten Dominik <carsten.dominik@gmail.com>
  Date:   Fri Sep 18 09:12:26 2009 +0100

      Allow indented dynamic blocks

  - test results after change, release_6.30d-851-g74a59c0:

    | indent0_tbl0.org | nok | Lisp error, see attached backtrace |
    | indent0_tbl4.org | ok  | works as expected                  |
    | indent2_tbl0.org | nok | TBLFM deleted                      |
    | indent2_tbl4.org | nok | TBLFM deleted                      |

  - test results before change, release_6.30d-850-g60bf447:

    | indent0_tbl0.org | nok | Lisp error, see attached backtrace |
    | indent0_tbl4.org | ok  | works as expected                  |
    | indent2_tbl0.org | nok | misread as Local setup             |
    | indent2_tbl4.org | nok | misread as Local setup             |

- commit 3f1062a15d81aae2f1b10ea540f0d797711b492c
  Author: Carsten Dominik <carsten.dominik@gmail.com>
  Date:   Mon Sep 8 09:43:41 2008 +0200

      Save and restore formulas for column view capture.

  - test results after change, release_6.06b-53-g3f1062a:

    | indent0_tbl0.org | nok | Lisp error, see attached backtrace |
    | indent0_tbl4.org | ok  | works as expected                  |
    | indent2_tbl0.org | -   | indentation not supported          |
    | indent2_tbl4.org | -   | indentation not supported          |

  - test results before change, release_6.06b-52-g4aa23cf:

    | indent0_tbl0.org | nok | TBLFM deleted             |
    | indent0_tbl4.org | nok | TBLFM deleted             |
    | indent2_tbl0.org | -   | indentation not supported |
    | indent2_tbl4.org | -   | indentation not supported |

Michael

[-- Attachment #2: backtrace.txt --]
[-- Type: text/plain, Size: 4377 bytes --]

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^#" nil)
  (while (string-match "^#" (car content-lines)) (insert (pop content-lines) "\n"))
  (progn (while (string-match "^#" ...) (insert ... "\n")))
  (if content-lines (progn (while ... ...)))
  (when content-lines (while (string-match "^#" ...) (insert ... "\n")))
  (progn (when (plist-get params :hlines) (setq tmp nil) (while tbl ...) (setq tbl ...)) (when vlines (setq tbl ...) (setq tbl ...)) (setq pos (point)) (when content-lines (while ... ...)) (insert (org-listtable-to-string tbl)) (when (plist-get params :width) (insert "\n|" ...)) (while (setq line ...) (when ... ... ...)) (if recalc (progn ... ...) (goto-char pos) (org-table-align)))
  (if tbl (progn (when ... ... ... ...) (when vlines ... ...) (setq pos ...) (when content-lines ...) (insert ...) (when ... ...) (while ... ...) (if recalc ... ... ...)))
  (when tbl (when (plist-get params :hlines) (setq tmp nil) (while tbl ...) (setq tbl ...)) (when vlines (setq tbl ...) (setq tbl ...)) (setq pos (point)) (when content-lines (while ... ...)) (insert (org-listtable-to-string tbl)) (when (plist-get params :width) (insert "\n|" ...)) (while (setq line ...) (when ... ... ...)) (if recalc (progn ... ...) (goto-char pos) (org-table-align)))
  (let ((pos ...) (hlines ...) (vlines ...) (maxlevel ...) (content-lines ...) (skip-empty-rows ...) tbl id idpos nfields tmp recalc line id-as-string view-file view-pos) (when (setq id ...) (setq id-as-string ...) (cond ... ... ... ... ... ... ...)) (with-current-buffer (if view-file ... ...) (save-excursion ...)) (goto-char pos) (move-marker pos nil) (when tbl (when ... ... ... ...) (when vlines ... ...) (setq pos ...) (when content-lines ...) (insert ...) (when ... ...) (while ... ...) (if recalc ... ... ...)))
  org-dblock-write:columnview((:name "columnview" :maxlevel 3 :id 114233DF-D019-449E-892C :indentation-column 0 :content #("#+TBLFM: $2 = ceil($3 / 8)\n" 0 26 (fontified t font-lock-fontified t face org-meta-line) 26 27 (fontified t font-lock-fontified t face org-meta-line))))
  funcall(org-dblock-write:columnview (:name "columnview" :maxlevel 3 :id 114233DF-D019-449E-892C :indentation-column 0 :content #("#+TBLFM: $2 = ceil($3 / 8)\n" 0 26 (fontified t font-lock-fontified t face org-meta-line) 26 27 (fontified t font-lock-fontified t face org-meta-line))))
  (let* ((pos ...) (line ...) (params ...) (name ...) (indent ...) (cmd ...)) (message "Updating dynamic block `%s' at line %d..." name line) (funcall cmd params) (message "Updating dynamic block `%s' at line %d...done" name line) (goto-char pos) (when (and indent ...) (setq indent ...) (save-excursion ... ... ... ...)))
  (save-window-excursion (let* (... ... ... ... ... ...) (message "Updating dynamic block `%s' at line %d..." name line) (funcall cmd params) (message "Updating dynamic block `%s' at line %d...done" name line) (goto-char pos) (when ... ... ...)))
  org-update-dblock()
  (save-excursion (org-update-dblock))
  (cond ((or ... org-occur-highlights org-latex-fragment-image-overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-latex-fragment-image-overlays) (message "Temporary highlights/overlays removed from current buffer")) ((and ... ...) (funcall org-finish-function)) ((run-hook-with-args-until-success ...)) ((org-in-regexp org-ts-regexp-both) (org-timestamp-change 0 ...)) ((or ... ...) (call-interactively ...)) ((org-on-target-p) (call-interactively ...)) ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call-interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula) (if arg ... ...) (call-interactively ...) (orgtbl-send-table ...)) ((or ... ...) (call-interactively ...)) ((org-at-item-checkbox-p) (let* ... ... ... ... ... ... ... ... ...)) ((org-at-item-p) (let* ... ... ... ... ...)) ((save-excursion ... ...) (beginning-of-line 1) (save-excursion ...)) ((save-excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t (or ... ...)))
  (let ((org-enable-table-editor t)) (cond (... ... ... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ... ... ... ...) (... ...) (... ...) (... ...) (... ... ...) (... ...) (...) (t ...)))
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)

[-- Attachment #3: indent0_tbl0.org.txt --]
[-- Type: text/plain, Size: 381 bytes --]

#+COLUMNS: %50ITEM(Task) %Days %5Effort({Hours}){+}
#+STARTUP: odd showall

#+BEGIN: columnview :maxlevel 3 :id 62b7c4f5-bc38-411e-b24f-ba9c4adb74da
#+TBLFM: $2 = ceil($3 / 8)
#+END:

* project
*** Total of Effort
    :PROPERTIES:
    :ID:       62b7c4f5-bc38-411e-b24f-ba9c4adb74da
    :END:
***** feature
******* TODO task
        :PROPERTIES:
        :Effort:   7
        :END:

[-- Attachment #4: indent0_tbl4.org.txt --]
[-- Type: text/plain, Size: 485 bytes --]

#+COLUMNS: %50ITEM(Task) %Days %5Effort({Hours}){+}
#+STARTUP: odd showall

#+BEGIN: columnview :maxlevel 3 :id ddb38905-fcbb-473b-99ef-d35194604ffa
| Task | Days | {Hours} |
|------+------+---------|
|      |      |         |
|      |      |         |
#+TBLFM: $2 = ceil($3 / 8)
#+END:

* project
*** Total of Effort
    :PROPERTIES:
    :ID:       ddb38905-fcbb-473b-99ef-d35194604ffa
    :END:
***** feature
******* TODO task
        :PROPERTIES:
        :Effort:   7
        :END:

[-- Attachment #5: indent2_tbl0.org.txt --]
[-- Type: text/plain, Size: 401 bytes --]

#+COLUMNS: %50ITEM(Task) %Days %5Effort({Hours}){+}
#+STARTUP: odd showall

* custom view
  #+BEGIN: columnview :maxlevel 3 :id f96484a3-c520-4abf-979e-e8ff2c047c54
  #+TBLFM: $2 = ceil($3 / 8)
  #+END:

* project
*** Total of Effort
    :PROPERTIES:
    :ID:       f96484a3-c520-4abf-979e-e8ff2c047c54
    :END:
***** feature
******* TODO task
        :PROPERTIES:
        :Effort:   7
        :END:

[-- Attachment #6: indent2_tbl4.org.txt --]
[-- Type: text/plain, Size: 513 bytes --]

#+COLUMNS: %50ITEM(Task) %Days %5Effort({Hours}){+}
#+STARTUP: odd showall

* custom view
  #+BEGIN: columnview :maxlevel 3 :id 52d4f620-6f41-414f-89d8-cd3e8e19a2f0
  | Task | Days | {Hours} |
  |------+------+---------|
  |      |      |         |
  |      |      |         |
  #+TBLFM: $2 = ceil($3 / 8)
  #+END:

* project
*** Total of Effort
    :PROPERTIES:
    :ID:       52d4f620-6f41-414f-89d8-cd3e8e19a2f0
    :END:
***** feature
******* TODO task
        :PROPERTIES:
        :Effort:   7
        :END:

             reply	other threads:[~2011-11-02 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 17:06 Michael Brand [this message]
2011-11-03 11:13 ` dynamic block for columnview: indent and TBLFM Michael Brand

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='CALn3zohgqUs=C0Dqx=JuA5hYjn21ZpPBNOY92h_y8cRNYnjD8A@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).