* lisp/org-colview.el (org-columns-edit-value): Small refactoring. Use
new function.
(org-columns--call): New function.
(org-columns-eval): Remove function.
(org-columns-next-allowed-value): Use new function.
* lisp/org-colview.el (org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix argument name in docstrings.
* lisp/org-colview.el (org-dblock-write:columnview): Fix typo in pcase
so ID are properly recognized in current document.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add tests.
* lisp/org-colview.el (org-columns--display-here): Remove unnecessary
`org-columns-spec' property.
(org-columns-update): Use (current-column) to extract column format
specifications.
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-next-allowed-value): Make sure overlays are still in place
when a property altering current headline is modified. Refactor code.
Do not limit allowed values to 10.
* testing/lisp/test-org-colview.el (test-org-colview/columns-next-allowed-value):
New test.
* lisp/org-colview.el (org-columns-new): Change signature to allow both
editing and column creation non-interactively.
(org-columns-edit-attributes): Use new signature.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new):
Update tests.
* lisp/org-colview.el (org-columns-move-right): Do not compute values
swapping columns. Comment about a corner case.
* testing/lisp/test-org-colview.el (test-org-colview/columns-move-left):
(test-org-colview/columns-move-right): New tests.
* lisp/org-colview.el (org-columns-get-format): Do not assume
`org-columns-default-format' contains valid columns format. Look for
COLUMNS keyword if necessary.
(org-columns-quit): Reset `org-columns-current-fmt'.
(org-columns-redo): Provide `org-columns-current-fmt' as the active
format so as to avoid extracting it again.
* testing/lisp/test-org-colview.el (test-org-colview/get-format): New
test.
* lisp/org-colview.el (org-columns-check-computed): Check if current
column contains an operator instead of looking for an `org-computed'
text property.
(org-columns--compute-spec): Do not apply `org-computed' text property.
* lisp/org-colview.el (org-edit-headline): Move from here...
* lisp/org.el (org-edit-headline): ... to here. Also refactor code.
Accept to set headline non-interactively.
* testing/lisp/test-org.el (test-org/edit-headline): New test.
* lisp/org-colview.el (org-columns-store-format): Make sure we're really
at a COLUMNS keyword before replacing it. Also replace only the first
one, not all of them.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new): Add
tests.
* lisp/org-colview.el (org-columns--collect-values):
(org-agenda-colview-summarize): Use column format specification as the
unique identifier for the returned alist.
* lisp/org-colview.el (org-columns--display-here): Store column format
specification in a new overlay property.
(org-columns--set-widths):
(org-columns--display-here): Use column format specification instead of
(org-columns--displayed-value): Since the same property can have
multiple titles, use column specification instead of property as keys.
(org-columns--collect-values): Apply signature change.
(org-columns-update): Handle multiple columns for the same property.
Also apply signature change to `org-columns--displayed-value'.
(org-columns--compute-spec): New function.
(org-columns-compute):
(org-columns-compute-all): Use new function.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
(test-org-colview/columns-update): Add tests.
* doc/org.texi (Column attributes): Document computation with multiple
summary types for a given property.
* lisp/org-colview.el (org-columns--summarize): Throw an error when no
summarize function is associated to a given operator.
(org-columns-compile-format): Do not provide summarize function, which
can be found using the accessor `org-columns--summarize'.
(org-columns-new):
(org-columns-uncompile-format):
(org-columns-compute):
(org-columns-compute-all):
(org-agenda-colview-summarize): Use new compiled format.
* lisp/org-colview.el (org-columns-compile-format): Property is
upper-cased. Title is not, however.
(org-columns--displayed-value):
(org-columns--collect-values):
(org-columns--autowidth-alist):
(org-columns--overlay-text):
(org-columns--display-here):
(org-columns--display-here-title):
(org-columns-next-allowed-value):
(org-columns):
(org-columns-widen):
(org-columns-update):
(org-columns--capture-view):
(org-dblock-write:columnview):
(org-agenda-colview-summarize): Since properties in compiled format are
upper-cased, remove the `upcase' or `assoc-string' dance.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new):
(test-org-colview/columns-update): Add case-sensitivity tests.
`assoc-string' is still necessary in functions where property is
provided by the user, e.g. `org-columns-update'.
* lisp/org-colview.el (org-columns--summarize): New function.
(org-columns-new):
(org-columns-compile-format): Use new function.
(org-agenda-colview-summarize): Use new function. Fix return value for
CLOCKSUM and CLOCKSUM_T.
* lisp/org-colview.el (org-columns-summary-types): New variable.
(org-columns-compile-map): Rename into...
(org-columns-summary-types-default): ... this.
(org-columns-new):
(org-columns-compile-format): Use new variables.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
Add test.
* doc/org.texi (Column attributes): Document new variable. Improve
description of time and age based summary types.
* lisp/org-colview.el (org-columns-compile-map): Externalize summary
functions. Remove "none" summary.
(org-columns-new): Apply previous removal.
(org-columns--fractional-duration-re): Rename variable to...
(org-columns--duration-re): ... this.
(org-columns-compute): Change how values are computed. This is now done
in one pass. A summarize function is given a list of strings and
possible a format string. It has to return the computed value as
a string.
(org-columns--time-to-seconds):
(org-columns--age-to-seconds):
(org-columns--summary-apply-times):
(org-columns--summary-sum):
(org-columns--summary-currencies):
(org-columns--summary-checkbox):
(org-columns--summary-checkbox-count):
(org-columns--summary-checkbox-percent):
(org-columns--summary-min):
(org-columns--summary-max):
(org-columns--summary-mean):
(org-columns--summary-sum-times):
(org-columns--summary-min-time):
(org-columns--summary-max-time):
(org-columns--summary-mean-time):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): New functions.
(org-columns--summary-estimate):
(org-agenda-colview-summarize): Update functions to new process.
(org-columns-string-to-number): Apply variable renaming.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
Fix test. Add some more.
* lisp/org-colview.el (org-columns-compute): Properly summarize values
obtained through inline tasks.
* testing/lisp/test-org-colview.el (test-org-colview/columns-update):
Add test.
Previously, the summary of values from inline tasks was added to to the
summary of values from children.
* lisp/org-colview.el (org-columns--overlay-text): New function.
(org-columns--display-here): Use new function.
(org-columns-update): Properly handle additional decorations to
displayed values (e.g., ellipses).
* testing/lisp/test-org-colview.el (test-org-colview/columns-update):
New test.
* lisp/org-colview.el (org-columns-dblock-insert): Rename to...
(org-columns-insert-dblock): ... this. Also fix a bug that would insert
"local" instead of `local' as the :id value.
* lisp/org.el (org-mode-map):
(org-org-menu): Use new name.
* lisp/org-colview.el (org-columns-time): Rename to...
(org--columns-time): ... this.
(org-columns--fractional-duration-re): New variable.
(org-columns-edit-value):
(org-columns):
(org-columns-compute-all):
(org-agenda-columns): Use new variable.
(org-columns-compile-map): Remove unneeded "calc" attribute.
(org-columns-number-to-string):
(org-columns-string-to-number): Fix ages set as a duration (e.g., "1d
12h"). Compare ages as seconds, not number of days.
* doc/org.texi (Column attributes): Document syntax for "age".
* lisp/org-colview.el (org-columns-compute-all): Small refactoring.
(org-columns-number-to-string): Handle special case of 0 among 0. Small
refactoring.
(org-nofm-to-completion):
(org-format-time-period): Remove functions.