Commit Graph

435 Commits

Author SHA1 Message Date
Nicolas Goaziou d2af251077 org-colview: Fix summary computation in agenda
* lisp/org-colview.el (org-agenda-colview-summarize): Do not include
  already summarized values in current summary.
2017-01-17 12:00:49 +01:00
Nicolas Goaziou b223c099f0 org-colview: Fix missing agenda summary if org-agenda-overriding-header is set
* lisp/org-colview.el (org-agenda-colview-summarize): Do not ignore
  first agenda line when displaying summaries.

This fixes a regression introduced in
279902ca4d.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/111473>
2017-01-17 11:35:05 +01:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Nicolas Goaziou d777418ac6 org-colview: Fix `org-agenda-overriding-columns-format'
* lisp/org-colview.el (org-columns--collect-values): Change signature.
(org-agenda-columns): Apply signature change.

When calling `org-agenda-columns' compiled columns format is set
locally to Agenda buffer, but `org-columns--collect-values' is called
from source buffers.  Therefore, it uses default format instead of the
compiled one.

Reported-by: Christian Prothmann <ckprothmann@yahoo.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110748>
2016-12-11 01:34:55 +01:00
Nicolas Goaziou a3c366eb98 org-colview: Fix time sum when mixing duration and H:MM:SS time
* lisp/org-colview.el (org-columns--time-to-seconds): Recognize
  a duration even when it contains a H:MM:SS part.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add test.

Reported-by: Björn Döring <bjoern@doering.io>
<http://permalink.gmane.org/gmane.emacs.orgmode/110144>
2016-11-11 12:02:34 +01:00
Nicolas Goaziou 0cf58cc208 Improve docstrings
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-custom-commands):
(org-stuck-projects):
(org-agenda):
(org-timeline):
(org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-log-mode):
(org-agenda-refile):
(org-agenda-show-and-scroll-up):
(org-agenda-tree-to-indirect-buffer):
(org-agenda-show-the-flagging-note):
(org-agenda-to-appt):
* lisp/org-capture.el (org-capture-mode):
(org-capture-use-agenda-date):
(org-capture):
* lisp/org-clock.el (org-clock-in):
(org-clock-display):
* lisp/org-colview.el (org-columns--display-here):
(org-columns):
* lisp/org-footnote.el (org-footnote-section):
* lisp/org-gnus.el (org-gnus-prefer-web-links):
* lisp/org-lint.el (org-lint):
* lisp/org-list.el (org-plain-list-ordered-item-terminator):
(org-list-allow-alphabetical):
(org-list-automatic-rules):
(org-list-use-circular-motion):
* lisp/org-protocol.el (org-protocol-store-link):
(org-protocol-create-for-org):
* lisp/org-src.el (org-src-preserve-indentation):
(org-edit-src-content-indentation):
(org-src-mode-hook):
(org-src-mode):
(org-edit-table.el):
(org-edit-export-block):
(org-edit-src-code):
(org-edit-fixed-width-region):
* lisp/org-table.el (org-table-automatic-realign):
(org-table-copy-increment):
(org-table-formula-evaluate-inline):
(org-table-allow-automatic-line-recalculation):
(org-table-edit-field):
(orgtbl-ascii-plot):
* lisp/org-timer.el (org-timer):
* lisp/org.el (org-deadline-string):
(org-comment-string):
(org-ellipsis):
(org-show-context-detail):
(org-indirect-buffer-display):
(org-cycle-global-at-bob):
(org-insert-heading-respect-content):
(org-enable-table-editor):
(org-context-in-file-links):
(org-display-internal-link-with-indirect-buffer):
(org-file-apps):
(org-refile-targets):
(org-todo-keywords):
(org-use-fast-todo-selection):
(org-treat-insert-todo-heading-as-state-change):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-effort-durations):
(org-agenda-files):
(org-cycle-hide-archived-subtrees):
(org-cycle):
(org-global-cycle):
(org-tree-to-indirect-buffer):
(org-insert-heading):
(org-store-link):
(org-insert-link):
(org-mark-ring-push):
(org-refile):
(org-todo):
(org-show-todo-tree):
(org-reveal):
(org-check-deadlines):
(org-switchb):
(org-cdlatex-mode):
(org-toggle-latex-fragment):
(org-ctrl-c-ctrl-c):
(org-toggle-heading):
(org-indent-line):
(org-yank):
(org-speedbar-set-agenda-restriction):
* lisp/ox-html.el (org-html-htmlize-output-type):
* lisp/ox-icalendar.el (org-icalendar-combined-agenda-file):
* lisp/ox-publish.el (org-publish-project-alist):
* lisp/ox.el (org-export-in-background):
(org-export-stack-mode):
(org-export--stack-source-at-point):
(org-export-dispatch): Improve quotes and formatting in docstrings.
2016-10-15 17:43:54 +02:00
Nicolas Goaziou d907041911 Change :version in defcustoms from "25.1" to "25.2"
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.1" to "25.2".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-images-centered):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.1" to "25.2".

Neither Org 8.3 nor Org 9.0 were released with Emacs 25.1.
2016-10-05 11:18:39 +02:00
Aaron Ecay 140aacbf2f Use ‘eq’ instead of ‘equal’ for symbols
* lisp/ob-C.el (org-babel-C-val-to-C-type):
* lisp/ob-core.el (org-babel-get-colnames):
(org-babel-disassemble-tables):
* lisp/ob-lua.el (org-babel-lua-var-to-lua):
(org-babel-lua-table-or-string):
* lisp/ob-python.el (org-babel-python-var-to-python):
(org-babel-python-table-or-string):
* lisp/ob-ruby.el (org-babel-ruby-var-to-ruby):
(org-babel-ruby-table-or-string):
* lisp/ob-shell.el (org-babel-sh-var-to-string):
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-compile-prefix-format):
* lisp/org-bibtex.el (org-bibtex-headline):
* lisp/org-capture.el (org-capture):
* lisp/org-colview.el (org-columns-next-allowed-value):
* lisp/org-mhe.el (org-mhe-store-link):
(org-mhe-get-message-real-folder):
(org-mhe-get-message-folder):
(org-mhe-get-message-num):
(org-mhe-get-header):
(org-mhe-follow-link):
* lisp/org-table.el (org-define-lookup-function):
* lisp/org.el (format-spec):
* lisp/ox-odt.el (org-odt--translate-description-lists):
* lisp/ox-publish.el (org-publish-compare-directory-files):
Use `eq' instead of `equal' when comparing to symbols.
* lisp/org-timer.el (org-timer-set-mode-line):
* lisp/org-capture.el (org-capture-finalize):
Use `cl-case' instead of `(cond ((eq x 'foo) ...) ...)'.
2016-09-25 16:29:06 +01:00
Nicolas Goaziou b2091f6d75 Move obsolete declarations into "org-compat.el"
* lisp/org-agenda.el (org-agenda-list):
(org-agenda-goto-today):
(org-agenda-reset-view): Remove reference to obsolete
`org-agenda-ndays'.
2016-06-30 15:20:51 +02:00
Lele Gaifax c338f9c630 org-colview.el: Fix typo in function name
* lisp/org-colview.el (org-columns-hscroll-title): Rename from
  `org-columns-hscoll-title'.
(org-columns--display-here-title):
(org-columns-remove-overlays): Adjust reference to renamed function.
2016-06-24 15:58:29 +02:00
Nicolas Goaziou 313146374e org-colview: Fix last commit
* lisp/org-colview.el (org-columns-edit-value): Fix last commit.
2016-06-24 10:06:02 +02:00
Nicolas Goaziou 1114418dd4 org-colview: Replace `org-columns-eval' with `org-columns--call'
* 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.
2016-06-24 09:59:49 +02:00
Nicolas Goaziou ee7aa9878f Deprecate `org-no-warnings' in favor of `with-no-warnings'
* lisp/org-macs.el (org-no-warnings): Rewove macro.
* lisp/org-compat.el (org-no-warnings): Mark `org-no-warnings' as
  obsolete.
* contrib/lisp/org-contacts.el (defvar):
* contrib/lisp/org-wl.el (org-wl-open):
* lisp/org-agenda.el (defvar):
(org-anniversary):
(org-cyclic):
(org-block):
(org-date):
* lisp/org-bbdb.el (defvar):
* lisp/org-clock.el (org-clock-out):
(org-clock-cancel):
* lisp/org-mouse.el (org-mouse-show-context-menu):
* lisp/org.el (org-modify-ts-extra):
(org-order-calendar-date-args): Small refactoring.
* lisp/ox-odt.el (org-odt-htmlfontify-string):
2016-06-23 15:20:32 +02:00
Nicolas Goaziou ff80654617 Mark `org-bound-and-true-p' as obsolete
* lisp/org-macs.el (org-bound-and-true-p): Remove macro.
* lisp/org-compat.el (org-bound-and-true-p): Deprecated alias for
  `bound-and-true-p'.
* lisp/ob-core.el (org-babel-confirm-evaluate):
* lisp/org-agenda.el (org-agenda-write):
(org-agenda-add-entry-text):
(org-agenda-todo):
* lisp/org-clock.el (org-clocktable-defaults):
(org-clocktable-write-default):
* lisp/org-colview.el (org-columns):
(org-columns--compute-spec):
(org-agenda-columns):
* lisp/org-indent.el (org-indent-set-line-properties):
* lisp/org-inlinetask.el (org-inlinetask-fontify):
* lisp/org-mobile.el (org-mobile-write-agenda-for-mobile):
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
* lisp/org-src.el (org-src-mode-configure-edit-buffer):
(org-edit-table.el):
* lisp/org.el (org-store-link):
(org-refile):
(org-get-export-keywords):
(org-set-tags):
(org-order-calendar-date-args):
(org-mode-restart):
(org-tbl-menu):
(org-beginning-of-line):
(org-end-of-line):
(org-kill-line):
(org-truely-invisible-p):
(org-remove-flyspell-overlays-in): Use `bound-and-true-p' instead of
`org-bound-and-true-p'.
2016-06-23 14:23:52 +02:00
Nicolas Goaziou 2c70283641 org-colview: Fix docstrings
* lisp/org-colview.el (org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix argument name in docstrings.
2016-06-04 21:29:27 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Kyle Meyer 4925d5be7b Merge branch 'maint' 2016-05-15 19:00:30 -04:00
Paul Eggert 1f046ea4b1 Backport commit 65c8c7c from Emacs
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-exp.el (org-element-context):
* lisp/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/ob-haskell.el (org-export-to-file):
* lisp/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/ob-python.el (run-python):
* lisp/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org-colview.el (org-agenda-redo):
* lisp/org-feed.el (url-retrieve-synchronously):
* lisp/org-info.el (Info-find-node):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-macs.el (org-string-match-p):
* lisp/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/ob-comint.el (tramp-flush-directory-property):
* lisp/ob-tangle.el (org-babel-update-block-body):
* lisp/org-bibtex.el (org-babel-trim):
* lisp/org-pcomplete.el (org-export-backend-options):
* lisp/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/ob-comint.el (with-parsed-tramp-file-name)
* lisp/ob-core.el (with-parsed-tramp-file-name):
* lisp/org.el (org-beamer-mode):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/ob-core.el (org-save-outline-visibility):
Remove; not needed.
* lisp/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.

Pacify ‘make check-declare’
65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Paul Eggert
Sat May 14 19:57:44 2016 -0700
2016-05-15 18:59:16 -04:00
Nicolas Goaziou 07e514b58b org-colview: Fix :id in columnview
* 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.
2016-02-27 09:25:01 +01:00
Nicolas Goaziou 86bc987ca1 org-colview: Remove `org-columns-spec' property
* 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.
2016-02-25 00:36:05 +01:00
Nicolas Goaziou 71d734f399 org-colview: Prevent computing again values in some cases
* lisp/org-colview.el (org-columns-delete):
(org-columns-widen): Do not recompute value.
2016-02-25 00:33:28 +01:00
Nicolas Goaziou 1f84cc2182 org-colview: Silence byte-compiler 2016-02-24 00:53:27 +01:00
Nicolas Goaziou 099d84c76d org-colview: Fix editing values altering headings
* 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.
2016-02-23 22:32:47 +01:00
Nicolas Goaziou a4ad618f62 org-colview: Fix `org-columns-view' and `org-columns-edit-value'
* 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.
2016-02-23 17:36:48 +01:00
Nicolas Goaziou acef7d8a43 org-colview: Do not compute values swapping columns
* 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.
2016-02-23 17:36:41 +01:00
Nicolas Goaziou 14d81d38e0 org-colview: Fix columns format extraction
* 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.
2016-02-23 15:20:02 +01:00
Nicolas Goaziou ab38d15186 org-colview: Tiny refactoring
* lisp/org-colview.el (org-columns--collect-values): Tiny refactoring.
2016-02-23 15:19:59 +01:00
Nicolas Goaziou 0de85fca9e org-colview: Remove `org-computed' property
* 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.
2016-02-23 14:07:36 +01:00
Nicolas Goaziou d7fbad1a81 org-colview: Rename `org-columns-new-overlay'
* lisp/org-colview.el (org-columns-new-overlay): Rename this to...
(org-columns--new-overlay): ... this.
(org-columns--display-here): Apply renaming.
2016-02-23 14:07:36 +01:00
Nicolas Goaziou 24033e3c67 Move `org-edit-headline'
* 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.
2016-02-23 14:07:32 +01:00
Nicolas Goaziou 7c0618b04d org-colview: Fix COLUMNS keyword update
* 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.
2016-02-23 13:18:38 +01:00
Nicolas Goaziou de439a68c8 org-colview: Allow multiple summaries for a single property
* 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.
2016-02-23 13:18:34 +01:00
Nicolas Goaziou 633e4d4202 org-colview: Remove summarize function from format spec
* 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.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou 9dfe3d8079 org-colview: Make `org-columns-current-maxwidths' a vector
* lisp/org-colview.el (org-columns-current-maxwidths): Update docstring.
(org-columns--autowidth-alist): Rename to...
(org-columns--set-widths): ... this.
(org-columns--display-here):
(org-columns--display-here-title):
(org-columns-widen):
(org-columns-update): Use new type.

(org-columns):
(org-agenda-columns): Apply renaming.

* testing/lisp/test-org-colview.el (test-org-colview/columns-width):
  Update test.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou ebf7bbb308 org-colview: Store properties in upper case
* 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'.
2016-02-22 22:15:13 +01:00
Nicolas Goaziou 2b3c72e231 org-colview: Fix failing test
* lisp/org-colview.el (org-columns-new): Tiny refactoring.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new): Fix
  typo in test.
2016-02-21 20:21:48 +01:00
Nicolas Goaziou b386089ee6 org-colview: Fix `org-columns-new'
* lisp/org-colview.el (org-columns-new): Fix location of inserted
  column.  Properly handle non-interactive cases.
* testing/lisp/test-org-colview.el (test-org-colview/columns-new): New
  test.
2016-02-21 14:59:52 +01:00
Nicolas Goaziou cd5eb50fd1 org-colview: Fix CLOCKSUM and CLOCKSUM_T summaries
* 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.
2016-02-21 14:22:23 +01:00
Nicolas Goaziou fedd6be97a org-colview: Introduce custom summary types
* 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.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 15101fe7a6 org-colview: Remove now useless functions
* lisp/org-colview.el (org-columns-number-to-string):
(org-columns-string-to-number): Remove functions.

(org-columns--displayed-value): Apply removal.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 58d387661a org-colview: Rationalize summary process
* 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.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 5c0a927990 org-colview: Move summary functions in a dedicated section 2016-02-21 00:44:17 +01:00
Nicolas Goaziou 58777b8200 org-colview: Remove unusued format attribute
* lisp/org-colview.el (org-columns-compile-map):
(org-columns-compile-format): Remove unused "format" attribute.

(org-columns--displayed-value):
(org-columns-new):
(org-columns-compute):
(org-columns-uncompile-format):
(org-agenda-colview-summarize): Apply removal.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou d59d96efaa org-colview: Ignore "fmt" format property
* lisp/org-colview.el (org-columns--displayed-value):
(org-columns-next-allowed-value):
(org-columns-new):
(org-columns-compute):
(org-columns-number-to-string):
(org-columns-string-to-number):
(org-columns-uncompile-format):
(org-columns-compile-format):
(org-agenda-colview-summarize):
(org-agenda-colview-compute): Ignore "fmt" property.  Use "op" instead.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 323a945366 org-colview: Fix previous commit
* lisp/org-colview.el (org-columns-compute): Fix error introduced in
  last commit.
2016-02-18 13:56:27 +01:00
Nicolas Goaziou 62ec8c0a48 org-colview: Fix `org-columns-compute' with inlinetasks
* 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.
2016-02-18 11:40:17 +01:00
Nicolas Goaziou ca1fb80dad org-colview: Silence byte-compiler 2016-02-17 23:24:51 +01:00
Nicolas Goaziou 9e3090a5a0 org-colview: Fix `org-columns-update'
* 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.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c158bf2f16 org-colview: Refactor low-high estimates
* lisp/org-colview.el (org-columns-string-to-number):
(org-columns-number-to-string): Handle estimates.

(org-columns-estimate-combine): Rename this to...
(org-columns--estimate-combine): ... this.

(org-columns-compile-map):
(org-columns-compute): Apply renaming.

(org-estimate-mean-and-var):
(org-estimate-print):
(org-string-to-estimate): Remove functions.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c8e7d93bbd org-colview: Remove trailing white space in headers
* lisp/org-colview.el (org-columns--display-here):
(org-columns--display-here-title): Remove trailing white space.
2016-02-17 22:49:19 +01:00