Commit Graph

18213 Commits

Author SHA1 Message Date
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
Nick Dokos 73d5733d01 Fix typo. 2016-02-20 09:55:08 -05:00
Nicolas Goaziou 635161cd3e ob-core: Small refactoring
* lisp/ob-core.el (org-babel-insert-result): Exit early in case of wrong
  parameters used along with inline results.
2016-02-20 00:08:19 +01:00
Nicolas Goaziou 027681c352 Fix typo
* testing/lisp/test-ob.el (test-ob/results-in-narrowed-buffer): Fix
  typo.
2016-02-19 23:58:01 +01:00
Nicolas Goaziou 801a66c4b5 ob-core: Tiny refactoring
* lisp/ob-core.el (org-babel-insert-result): Delegate removal of old
  inline results to...
(org-babel-where-is-src-block-result): ... this.

Now `org-babel-where-is-src-block-result' behaves in a symmetric way for
inline an non-inline source blocks.
2016-02-19 23:58:01 +01:00
Nicolas Goaziou e6984bd74b Merge branch 'maint' 2016-02-19 14:29:06 +01:00
Austin Walker 5a193ed485 ox-html.el: Fix TOC export of TODO headlines
* lisp/ox-html.el (org-html--todo): Don't show nil in format string for
  TODO class

Use empty string if :html-todo-kwd-class-prefix is not present.

TINYCHANGE
2016-02-19 14:22:08 +01:00
Bastien ca842068bb Merge branch 'maint' 2016-02-19 08:39:28 +01:00
Bastien 9259de15ec Fix links in the table of contents of the HTML manual and guide.
* mk/mansplit.pl, mk/guidesplit.pl: Don't prepend "toc_" to TOC links in
the manual and the guide.

Thanks to Yasushi SHOJI for reporting this.
2016-02-19 08:38:15 +01:00
Nicolas Goaziou a4a6d65c4b ob-core: Fix inline results
* lisp/ob-core.el (org-babel-where-is-src-block-result): Find results
  for inline src-blocks or inline babel call not located on a subsequent
  line, e.g., because of filling.
(org-babel-insert-result): When inline results exist, replace them
in-place.
(org-babel-remove-inline-result): Also remove results not located on the
same line as the source code.
(org-babel-examplify-region): Change signature.  Properly mark inline
results at the beginning of a line.

* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Add tests.
2016-02-18 23:17:15 +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
Nicolas Goaziou 3debe06bdd Rename `org-insert-columns-dblock' into `org-columns-insert-dblock'
* 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.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 2c974fc8c8 org-colview: Remove unused "calc" operator
* lisp/org-colview.el (org-columns--displayed-value):
(org-columns-compile-map):
(org-columns-compute):
(org-columns-compile-format):
(org-agenda-colview-summarize): Remove "calc" operator.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 923f512ee4 org-colview: Add tests
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  New test.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou aa2db034a0 org-colview: Fix age related summary
* 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".
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 04c405660d org-colview: Remove unused functions
* lisp/org-colview.el (org-columns-not-in-agenda):
(org-string-to-number): Remove functions.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou c551ee4dde org-colview: Fix {X%} summary type
* 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.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou d14d14b479 org-colview: Add tests
* testing/lisp/test-org-colview.el: New file.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 470f9fae08 org-colview: Fix capture view
* lisp/org-colview.el (org-columns-capture-view): Rename to...
(org-columns--capture-view): ... this.

(org-dblock-write:columnview): Fix produced table according to new
column view internals.

* lisp/org-colview.el (org-columns--clean-item): New function.

(org-listtable-to-string): Remove function.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 23f1119042 org-colview: Allow to force global column view
* lisp/org-colview.el (org-columns): Add new argument to force global
  column view.

* doc/org.texi (Using column view): Document change.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 279902ca4d org-colview: Fix column width computation
* lisp/org-colview.el (org-columns-current-widths): Remove variable.
(org-columns--value): Remove function.
(org-columns--displayed-value): New function.
(org-columns--collect-values): New function.

(org-columns-display-here): Rename function to...
(org-columns--display-here): ... this.  First argument is now mandatory.

(org-columns-display-here-title): Rename function to...
(org-columns--display-here-title): ... this.

(org-columns-autowidth-alist): Rename function to...
(org-columns--autowidth-alist): ... this.  Remove one argument.

(org-columns-edit-value):
(org-columns-next-allowed-value): Always refresh all columns, not only
the current one.  Otherwise, the current column may end up with
a different width than the others.

(org-columns):
(org-dblock-write:columnview):
(org-agenda-columns):
(org-agenda-colview-summarize): Apply changes above.

Columns width is now computed according to displayed values, not real
ones.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 3196b14342 Make `org-agenda-view-columns-initially' a defcustom
* lisp/org-agenda.el (org-agenda-view-columns-initially): New variable,
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 4eada95883 Move `org-columns-modify-value-for-display-function'
* lisp/org.el (org-columns-modify-value-for-display-function): Move from
  here...
* lisp/org-colview.el (org-columns-modify-value-for-display-function):
  ... to here.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou a5540c5599 org-colview: Remove compatibility cruft
* lisp/org-colview.el (org-verify-version): Remove function.
(org-columns):
(org-agenda-columns): Apply removal.
2016-02-17 22:49:19 +01:00
Erik Hetzner c56ff1071d org-attach: Fix git annex test directories
* testing/lisp/test-org-attach-annex.el: `default-directory' should end
  in a slash to function properly. This was causing test failures on
  older versions of git-annex.
2016-02-16 21:40:37 +01:00
John Foerch ff98903015 org-attach: Make use of git optional
* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.

TINYCHANGE
2016-02-14 17:56:18 +01:00
Achim Gratz bb3dca06a5 Makefile: provide CHMOD customization, use it for cleantest
* mk/default.mk (CHMOD): Addtional customization variable for
  chmod (change file permissions).  Explain why we need it for
  git-annex.

* mk/targets.mk (cleantest): If the plain $(RMR) fails, try to make
  directories writable recursively and retry the $(RMR).
  (cleanall, $(CLEANDIRS:%=clean%)): Use "+" instead of ";" to reduce
  the number of execs.
2016-02-14 12:44:56 +01:00
Erik Hetzner a4cfd3343a org-attach: Prevent test fails on systems without git-annex
* testing/lisp/test-org-attach-annex.el: Move all org-attach tests that
  use git-annex to this file, which can test for the presence of
  git-annex. Prevents tests failing on systems where git-annex is not
  installed.
2016-02-14 12:14:24 +01:00
Nicolas Goaziou d846817f9d Allow to preview LaTeX fragments in temporary buffers
* lisp/org.el (org-toggle-latex-fragment): Allow to preview fragments
  even when current buffer is not visiting a file.
2016-02-14 00:11:28 +01:00
Nicolas Goaziou caf66ea779 org-colview: Fix columnview table
* lisp/org-colview.el (org-columns-capture-view): Properties are not
  case sensitive.
(org-dblock-write:columnview): Take into consideration stars turned into
spaces (i.e., invisible leading stars) when computing heading level.
Also do not assume "ITEM" is always in the first column of the table.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105051>
2016-02-12 00:43:33 +01:00
Nicolas Goaziou 8eff64cffe Silence byte-compiler
* lisp/org-agenda.el (org-agenda-current-date): New variable.
(org-agenda-get-day-entries):
* lisp/org.el (org-calendar-holiday): Use new variable.
2016-02-11 11:32:14 +01:00
Nicolas Goaziou 5d817df125 Merge branch 'maint' 2016-02-11 09:50:55 +01:00
Nicolas Goaziou 9f737bdf14 org-element: Fix search failed error in `org-element-context'
* lisp/org-element.el (org-element-context): Make sure point is on tag
  line before searching for it.

* testing/lisp/test-org-element.el (test-org-element/context): Add test.
  Small refactoring.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105018>
2016-02-11 09:47:54 +01:00
Alan Schmitt 90ec88d71c ox-coq.el: Clean up
* lisp/ob-coq.el: Create a variable `coq-program-name' and remove unused
  `org-babel-coq-eoe'.

  (org-babel-coq-initiate-session): Use `coq-program-name'.
2016-02-11 08:54:03 +01:00
Nicolas Goaziou 94b78a1198 ob-core: Silence byte-compiler 2016-02-11 00:54:12 +01:00
Nicolas Goaziou ae767704ff Merge branch 'maint' 2016-02-11 00:49:59 +01:00
Nicolas Goaziou 6e88bf07d1 org-archive: Speed-up archiving subtrees
* lisp/org-archive.el (org-toggle-archive-tag): Use `org-flag-subtree',
  which is much faster than outline-hide-subtree'.

Reported-by: Michael Ziems <michael.ziems@xiron.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105005>
2016-02-11 00:47:55 +01:00
Nicolas Goaziou 94dfa7fa9c ob-lob: Improve `org-babel-lob-get-info' consistency
* lisp/ob-lob.el (org-babel-lob-get-info): Make the function on par with
  `org-babel-get-src-block-info' by providing the beginning position of
  Babel code.

(org-babel-lob-execute):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Handle new data.
2016-02-11 00:32:07 +01:00
Nicolas Goaziou a00af53e6e ob: Refactor `org-babel-read-result'
* lisp/ob-core.el (org-babel-read-result): Refactor code.
(org-babel-read-table):
(org-babel-read-list):
(org-babel-read-link): Fix docstring.
(org-babel-read-element): Fix indentation for example blocks.
2016-02-11 00:00:18 +01:00
Nicolas Goaziou 49bb05487c ob: Remove variables related to inline Babel code
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp):
(org-babel-inline-lob-one-liner-regexp):
(org-babel-lob-one-line-regexp):
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Remove variables.

(org-babel-map-inline-src-blocks):
(org-babel-map-call-lines):
(org-babel-map-executables):
(org-babel-execute-buffer):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Do not use removed variables.

Babel now mostly uses the parser to handle Babel code.  Regexps are not
needed anymore.
2016-02-10 23:50:46 +01:00
Nicolas Goaziou a1ca1f3bee ob: Remove `org-babel-inline-lob-one-line-matches'
* lisp/ob-core.el (org-babel-inline-lob-one-liner-matches): Remove now
  unused function.
2016-02-10 23:50:46 +01:00