emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)]
@ 2017-02-12 19:54 Christoph LANGE
  2017-02-13 15:46 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph LANGE @ 2017-02-12 19:54 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


Dear Nicolas, dear all,

I believe the following fix

http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=ccf832e8317dbac7d3ac2b7dfbb515b1292a329c

introduced a regression.  When I want to run org-dblock-update on a
clocktable with :maxlevel 0 (I'll be happy to provide an example), it
fails with

Debugger entered--Lisp error: (wrong-type-argument wholenump -1)
  make-string(-1 124)

in org-clocktable-write-default, I think in

     (make-string (1- (min maxlevel (or ntcol 100))) ?|)

to be exact, because (1- maxlevel) is -1.

Cheers,

Christoph

------------------------------------------------------------------------



Emacs  : GNU Emacs 25.1.1 (x86_64-w64-mingw32)
 of 2016-09-17
Package: Org mode version 9.0.5 (9.0.5-elpaplus @
c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)

current state:
==============
(setq
 org-id-locations-file "~\\.emacs.d\\.org-id-locations"
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-clock-persist-file "~\\.emacs.d\\org-clock-save.el"
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d"
                            :require-minutes t)
 org-clock-history-length 35
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-start-on-weekday nil
 org-clock-into-drawer 2
 org-confirm-shell-link-function 'yes-or-no-p
 org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id
 org-finalize-agenda-hook '((lambda nil (undo-tree-mode -1))
bh/org-agenda-to-appt)
 org-clock-idle-time 10
 org-agenda-sticky t
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default))
 org-pretty-entities t
 org-agenda-custom-commands '(("J" "Interactive TODO dowith and TASK with"
                               ((org-sec-who-view "TODO dowith")))
                              ("j" "TODO dowith and TASK with"
                               ((org-sec-with-view "TODO dowith")
                                (org-sec-where-view "TODO doat")
                                (org-sec-assigned-with-view "TASK with")
                                (org-sec-stuck-with-view "STUCK with"))
                               )
                              ("A" "Work todos with doat or dowith"
tags-todo
                               "-personal+doat={.+}|dowith={.+}/!-TASK"
                               ((org-agenda-todo-ignore-scheduled nil)))
                              ("H" "All work todos" tags-todo
"-personal/!-TASK-MAYBE"
                               ((org-agenda-todo-ignore-scheduled nil)))
                              ("h" "Work todos" tags-todo
                               "-personal-doat={.+}-dowith={.+}/!-TASK"
                               ((org-agenda-todo-ignore-scheduled t)))
                              ("n" "Agenda and all TODOs" ((agenda "")
(alltodo ""))))
 org-return-follows-link t
 org-todo-keyword-faces '(("TODO" :foreground "DarkOrange1" :weight bold)
                          ("MAYBE" :foreground "sea green")
                          ("DONE" :foreground "light sea green")
                          ("CANCELLED" :foreground "forest green")
                          ("NEXT" :foreground "red" :weight bold)
                          ("TASK" :foreground "blue"))
 org-capture-templates '(("j" "Journal" entry
                          (id "00fba618-a215-4d39-a8fd-88f1ffce1fdb")
                          "* %?\nEntered on %U\n   %i\n   %a" :prepend t)
                         ("w" "Log work task" entry
                          (id "00fba618-a215-4d39-a8fd-88f1ffce1fdb")
                          "* %^{Description}  %^g%?" :prepend t
:clock-in t :clock-keep
                          t)
                         ("t" "TODO" entry (id
"00fba618-a215-4d39-a8fd-88f1ffce1fdb")
                          "* TODO %^{Description}\n  DEADLINE:
%^{DEADLINE}t" :prepend t)
                         ("T" "TODO (and clock in)" entry
                          (id "00fba618-a215-4d39-a8fd-88f1ffce1fdb")
                          "* TODO %^{Description}\n  DEADLINE:
%^{DEADLINE}t" :prepend t
                          :clock-in t :clock-resume t)
                         )
 org-agenda-include-diary t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp nil
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
                     org-src-mode-configure-edit-buffer)
 org-tags-column -90
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-log-redeadline 'note
 org-mode-hook '(org-clock-load org-mode-reftex-setup evil-org-mode
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-show-block-all
append local] 5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook
org-babel-show-result-all append
                    local]
                   5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes
org-eldoc-load)
 org-refile-targets '((nil :level . 8))
 org-goto-auto-isearch nil
 org-outline-path-complete-in-steps nil
 org-stuck-projects '("+prj/-MAYBE-DONE" ("TODO" "TASK") nil)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-use-speed-commands t
 org-agenda-sorting-strategy '((todo priority-down todo-state-down
effort-down
                                category-keep)
                               (agenda habit-down time-up priority-down
todo-state-down
                                effort-down category-keep)
                               (agenda habit-down time-up priority-down
category-keep)
                               (todo priority-down category-keep)
                               (tags priority-down category-keep)
(search category-keep))
 org-clock-persist 'history
 org-refile-use-outline-path t
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
 org-tags-exclude-from-inheritance '(quote
                                     ("prj" "FIX" "Tentative" "NotBusy"
"OtherPeople"))
 org-load-hook '(org-insert-dblock-bindings)
 org-agenda-after-show-hook '(dfeich/org-open-if-in-drawer)
 org-agenda-finalize-hook '((lambda nil (undo-tree-mode -1))
bh/org-agenda-to-appt)
 org-enforce-todo-checkbox-dependencies t
 org-log-reschedule 'note
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info
org-jsinfo org-habit
               org-irc org-mew org-mhe org-rmail org-vm org-wl org-w3m)
 org-agenda-span 8
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-log-into-drawer t
 org-blocker-hook '(org-block-todo-from-checkboxes
                    org-block-todo-from-children-or-siblings-or-parent)
 org-link-parameters '(("w3m" :store org-w3m-store-link)
                       ("wl" :follow org-wl-open :store org-wl-store-link)
                       ("vm-imap" :follow org-vm-imap-open)
                       ("vm" :follow org-vm-open :store org-vm-store-link)
                       ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store
org-mhe-store-link)
                       ("mew" :follow org-mew-open :store
org-mew-store-link)
                       ("irc" :follow org-irc-visit :store
org-irc-store-link)
                       ("info" :follow org-info-open :export
org-info-export :store
                        org-info-store-link)
                       ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
                       ("docview" :follow org-docview-open :export
org-docview-export
                        :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export
org-bbdb-export :complete
                        org-bbdb-complete-link :store org-bbdb-store-link)
                       ("tel") ("id" :follow org-id-open) ("file+sys")
("file+emacs")
                       ("doi" :follow org--open-doi-link)
                       ("elisp" :follow org--open-elisp-link)
                       ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url (concat
"ftp:" path))))
                       ("help" :follow org--open-help-link)
                       ("http" :follow
                        (lambda (path) (browse-url (concat "http:" path))))
                       ("https" :follow
                        (lambda (path) (browse-url (concat "https:" path))))
                       ("mailto" :follow
                        (lambda (path) (browse-url (concat "mailto:"
path))))
                       ("message" :follow
                        (lambda (path) (browse-url (concat "message:"
path))))
                       ("news" :follow
                        (lambda (path) (browse-url (concat "news:" path))))
                       ("shell" :follow org--open-shell-link))
 org-babel-load-languages '((sh . t))
 org-agenda-mode-hook '(dfeich/org-agenda-mode-fn)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-clock-out-remove-zero-time-clocks t
 )

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)]
  2017-02-12 19:54 Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)] Christoph LANGE
@ 2017-02-13 15:46 ` Nicolas Goaziou
  2017-02-13 16:28   ` Christoph LANGE
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2017-02-13 15:46 UTC (permalink / raw)
  To: Christoph LANGE; +Cc: emacs-orgmode@gnu.org

Hello,

Christoph LANGE <math.semantic.web@gmail.com> writes:

> I believe the following fix
>
> http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=ccf832e8317dbac7d3ac2b7dfbb515b1292a329c
>
> introduced a regression.  When I want to run org-dblock-update on a
> clocktable with :maxlevel 0 (I'll be happy to provide an example), it
> fails with
>
> Debugger entered--Lisp error: (wrong-type-argument wholenump -1)
>   make-string(-1 124)
>
> in org-clocktable-write-default, I think in
>
>      (make-string (1- (min maxlevel (or ntcol 100))) ?|)
>
> to be exact, because (1- maxlevel) is -1.

I can reproduce the problem. However, I'm not sure to understand the
meaning of ":maxlevel 0". Don't you mean ":maxlevel 1"?

It sounds like a user error to me.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)]
  2017-02-13 15:46 ` Nicolas Goaziou
@ 2017-02-13 16:28   ` Christoph LANGE
  2017-02-13 20:34     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph LANGE @ 2017-02-13 16:28 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

Hi Nicolas,

Nicolas Goaziou on 2017-02-13 16:46:
> I can reproduce the problem. However, I'm not sure to understand the
> meaning of ":maxlevel 0". Don't you mean ":maxlevel 1"?

I have a clocktable that looks as follows.  (Once more, I'll be happy to
work this out as a minimum working example – later, don't have time
right now.)

#+BEGIN: clocktable :block 2017-W01 :maxlevel 0 :scope ("filename.org")
:indent

The output I got for this from an older Org version (9.0.something,
definitely < 9.0.4) was:

  | File         | Headline         | Time   |
  |--------------+------------------+--------|
  |              | ALL *Total time* | *1:00* |
  |--------------+------------------+--------|
  | filename.org | *File time*      | *1:00* |

:maxlevel 1 would include level-1 headings _in_ this file, like this:

  | File         | Headline         | Time   |
  |--------------+------------------+--------|
  |              | ALL *Total time* | *1:00* |
  |--------------+------------------+--------|
  | filename.org | *File time*      | *1:00* |
  |              | Task 1           | 0:05   |
  |              | Task 2           | 0:55   |

where filename.org looks like

* Task 1
* Task 2
...

> It sounds like a user error to me.

Maybe the truth is that the handling of :maxlevel 0 was an undocumented
feature?

Cheers,

Christoph

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)]
  2017-02-13 16:28   ` Christoph LANGE
@ 2017-02-13 20:34     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2017-02-13 20:34 UTC (permalink / raw)
  To: Christoph LANGE; +Cc: emacs-orgmode@gnu.org

Hello,

Christoph LANGE <math.semantic.web@gmail.com> writes:

> I have a clocktable that looks as follows.  (Once more, I'll be happy to
> work this out as a minimum working example – later, don't have time
> right now.)
>
> #+BEGIN: clocktable :block 2017-W01 :maxlevel 0 :scope ("filename.org")
> :indent
>
> The output I got for this from an older Org version (9.0.something,
> definitely < 9.0.4) was:
>
>   | File         | Headline         | Time   |
>   |--------------+------------------+--------|
>   |              | ALL *Total time* | *1:00* |
>   |--------------+------------------+--------|
>   | filename.org | *File time*      | *1:00* |
>
> :maxlevel 1 would include level-1 headings _in_ this file, like this:
>
>   | File         | Headline         | Time   |
>   |--------------+------------------+--------|
>   |              | ALL *Total time* | *1:00* |
>   |--------------+------------------+--------|
>   | filename.org | *File time*      | *1:00* |
>   |              | Task 1           | 0:05   |
>   |              | Task 2           | 0:55   |
>
> where filename.org looks like
>
> * Task 1
> * Task 2
> ...
>
>> It sounds like a user error to me.
>
> Maybe the truth is that the handling of :maxlevel 0 was an undocumented
> feature?

I see. It makes sense. I just couldn't find it. Thanks for the
explanation. This is now fixed.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-13 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-12 19:54 Bug: org-dblock-update regression in case of :maxlevel 0 [9.0.5 (9.0.5-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20170210/)] Christoph LANGE
2017-02-13 15:46 ` Nicolas Goaziou
2017-02-13 16:28   ` Christoph LANGE
2017-02-13 20:34     ` Nicolas Goaziou

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