Commit Graph

1726 Commits

Author SHA1 Message Date
Nicolas Goaziou 46e24f6830 Merge branch 'maint' 2018-01-09 19:51:17 +01:00
Nicolas Goaziou 8c7a14a850 org-clock: Consider hours when splitting the table with :steps
* lisp/org-clock.el (org-clocktable-steps): Check time when :tstart
  and :tend are defined.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  tests.

Reported-by: savoie@nsidc.org
<http://lists.gnu.org/r/emacs-orgmode/2018-01/msg00227.html>
2018-01-09 19:47:39 +01:00
Nicolas Goaziou b65fe0f7a2 Merge branch 'maint' 2018-01-07 10:56:02 +01:00
Nicolas Goaziou 0c93296f83 org-table: Obey to `org-table-formula-create-columns'
* lisp/org-table.el (org-table-recalculate): Return an error when the
  formula cannot create a necessary column.
(org-table-formula-create-columns): Fix docstring.
* testing/lisp/test-org-table.el (test-org-table/field-formula-outside-table):
  Fix tests.
2018-01-07 10:55:30 +01:00
Kyle Meyer d94f7024bc Merge branch 'maint' 2018-01-07 00:28:35 -05:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Nicolas Goaziou b030475575 Merge branch 'maint' 2018-01-02 14:14:18 +01:00
Nicolas Goaziou 16c7ae7996 Fix handling nested VISIBILITY properties
* lisp/org.el (org-set-visibility-according-to-property): Fix handling
  nested VISIBILITY properties.
* testing/lisp/test-org.el (test-org/set-visibility-according-to-property):
  New test.

Reported-by: Michael Maurer <maurer.michael@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-01/msg00012.html>
2018-01-02 14:13:46 +01:00
Nicolas Goaziou e9f30779de Merge branch 'maint' 2017-12-31 15:49:55 +01:00
Nicolas Goaziou af58a6dbf7 Change Org-mode into Org mode
* lisp/ob-core.el (org-babel-result-to-file):
* lisp/ob-picolisp.el:
* lisp/org-agenda.el (org-check-for-org-mode):
(org-search-view):
(org-tags-view):
(org-agenda-cleanup-fancy-diary):
(org-agenda-get-day-entries):
* lisp/org-table.el (orgtbl-mode):
* lisp/org-w3m.el (org-w3m-copy-for-org-mode):
* lisp/org.el (org-modules):
(org-startup-options):
(org-fontify-meta-lines-and-blocks):
* mk/default.mk:
* mk/manfull.pl:
* mk/org-fixup.el (org-make-org-version):
(org-make-org-loaddefs):
* mk/orgcard2txt.pl (rep_esc):
* mk/targets.mk ($(info):
* testing/README:
(Example):
* testing/examples/no-heading.org:
* testing/examples/normal.org: Change Org-mode into Org mode
2017-12-31 15:48:09 +01:00
Nicolas Goaziou c5208634ba Fix failing tests.
* testing/lisp/test-org-list.el (test-org-list/send-list): Remove
  test.
(test-org-list/to-html):
(test-org-list/to-latex):
(test-org-list/to-texinfo): Update tests.
2017-12-31 15:19:56 +01:00
Nicolas Goaziou 2fb65b73b6 test-org-table: Tiny refactoring
* testing/lisp/test-org-table.el (test-org-table/org-table-make-reference/mode-string-EL):
(test-org-table/org-table-make-reference/mode-string-E):
(test-org-table/org-table-make-reference/mode-string-EN):
(test-org-table/org-table-make-reference/mode-string-L):
(test-org-table/org-table-make-reference/mode-string-none):
(test-org-table/org-table-make-reference/mode-string-N): Tiny
refactoring.
2017-12-30 00:24:01 +01:00
Marco Wahl 144451143a Merge branch 'maint' 2017-12-28 19:15:43 +01:00
Marco Wahl e401afffde inlinetask: Fix folding of directly consecutive inlinetask children 2017-12-28 19:12:36 +01:00
Marco Wahl 6311c12556 Merge branch 'maint' 2017-12-28 18:05:54 +01:00
Marco Wahl b29a972307 org-inlinetask:Fix folding of inline tasks within plain list
This is the fix proposed by Nicolas.  See
http://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00564.html

Add and accommodate some tests.
2017-12-28 17:59:52 +01:00
Marco Wahl 269009d297 Merge branch 'maint' 2017-12-28 15:44:34 +01:00
Marco Wahl ab61357791 testing/README Document use of regexp filter for testing 2017-12-28 15:35:19 +01:00
Nicolas Goaziou 774e553f11 Merge branch 'maint' 2017-12-23 14:03:47 +01:00
Nicolas Goaziou d9125e435f Fix recursive Noweb expansion
* lisp/ob-core.el (org-babel-expand-noweb-references): Recursive Noweb
  expansion obey to :noweb parameter.
* testing/lisp/test-ob.el (test-ob/noweb-expansion): Add tests.

Fixes: 17523
2017-12-23 13:58:25 +01:00
Nicolas Goaziou 913aad68c3 Merge branch 'maint' 2017-12-20 13:16:28 +01:00
Nicolas Goaziou 3acc212c8f ob-core: Get :noweb-ref from definition instead of point of call
* lisp/ob-core.el (org-babel-expand-noweb-references): Get :noweb-ref
  from definition instead of point of call.

* testing/lisp/test-ob.el (test-ob/noweb-expansion-1):
(test-ob/noweb-expansion-2): Merge tests.  Add test.
2017-12-20 13:15:08 +01:00
Kyle Meyer 06b49cd837 Merge branch 'maint' 2017-12-19 00:00:49 -05:00
Jack Kamm b506bb68d0 ob-python: Fix :session :results output multiline behavior
* lisp/ob-python.el (orb-babel-python-evaluate-session): When :session
:results output, send multiline code blocks to tmpfile and execute in
Python with exec().
(org-babel-python--exec-tmpfile): New variable.
* testing/lisp/test-ob-python.el (test-ob-python/session-multiline):
Test for :session with multiple lines and indentation.
2017-12-18 23:59:04 -05:00
Nicolas Goaziou fdb2eb6701 Preserve file local variables during some operations
* lisp/org-macs.el (org-preserve-local-variables): New macro.
* lisp/org-footnote.el (org-footnote--clear-footnote-section):
(org-footnote--goto-local-insertion-point):
(org-footnote-create-definition):
(org-footnote-delete):
(org-footnote-renumber-fn:N):
(org-footnote-sort):
(org-footnote-normalize):
* lisp/org.el (org-move-subtree-down):
(org-copy-subtree):
(org-sort-entries):
(org-refile): Use new macro.
* testing/lisp/test-org-footnote.el (test-org-footnote/normalize):
(test-org-footnote/delete):
(test-org-footnote/sort):
(test-org-footnote/normalize):
* testing/lisp/test-org.el (test-org/sort-entries): Add tests.

Operations affected include copying, killing, refiling, archiving and
moving subtrees.  It also affects sorting, creating and deleting
footnotes.
2017-12-18 16:01:41 +01:00
Nicolas Goaziou 3ac619c8ac org-macro: Placeholders in (eval ...) macros are always strings
* lisp/org-macro.el (org-macro-initialize-templates): Update
  templates.
(org-macro-expand): Ensure placeholders in "eval" macros are strings.

* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Update
  tests.
2017-12-17 09:40:56 +01:00
Nicolas Goaziou 6ffcdcbf02 Merge branch 'maint' 2017-12-16 13:45:43 +01:00
Nicolas Goaziou 84cb63a44a ox: Fix plain text export with `org-export-with-backend'
* lisp/ox.el (org-export-with-backend): Handle arity for plain text
  transcoder.
* testing/lisp/test-ox.el (test-org-export/with-backend): Add test.
2017-12-16 13:44:56 +01:00
Nicolas Goaziou 5d4691dfbf Merge branch 'maint' 2017-12-15 00:00:55 +01:00
Nicolas Goaziou 327ca051ae ob-ref: Fix parsing arguments with a newline character
* lisp/ob-ref.el (org-babel-ref-split-regexp): Remove variable.
(org-babel-ref-parse): Handle arguments containing a newline
character (e.g., strings).

* testing/lisp/test-ob-lob.el (test-ob-lob/assignment-with-newline):
  New test.
2017-12-15 00:00:30 +01:00
Nicolas Goaziou 6fc4a1c53b Merge branch 'maint' 2017-12-14 22:40:55 +01:00
Nicolas Goaziou fe98379fce Fix fuzzy link escaping
* lisp/org.el (org-make-link-string): Properly escape square brackets
  and percent sings in fuzzy links.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
  Update tests.

Reported-by: Paulo Matos <paulo@matos-sorge.com>
<http://lists.gnu.org/r/emacs-orgmode/2017-12/msg00269.html>
2017-12-14 22:39:54 +01:00
Nicolas Goaziou f8849e92e5 org-archive: Add a test
* testing/lisp/test-org-archive.el (test-org-archive/to-archive-sibling):
New test.
2017-12-11 23:22:21 +01:00
Nicolas Goaziou c3c1c52eb8 ox: Fix inline source block evaluation
* lisp/ox.el (org-export-as): Specifically expand {{{results}}} macro
  after Babel code execution.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Add test.

Reported-by: "Berry, Charles" <ccberry@ucsd.edu>
<http://lists.gnu.org/r/emacs-orgmode/2017-12/msg00202.html>
2017-12-11 14:56:57 +01:00
Nicolas Goaziou fc5abc2d55 ob-core: Insert lowercase results
* lisp/ob-core.el (org-babel-insert-result): Insert lower case blocks
  and drawers.

* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-wrap):
(test-ob/org-babel-remove-result--results-org):
(test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
(test-ob/org-babel-remove-result--results-code): Update tests.
2017-12-10 23:05:32 +01:00
Rasmus 94f1a58438 org-tempo.el: New file for expansion of templates
* lisp/org-tempo.el: New file.
* doc/org.texi (Structure templates):
* lisp/org.el (org-modules): Add org-tempo.
* testing/lisp/test-org-tempo.el: New file.
2017-12-08 00:29:08 +01:00
Nicolas Goaziou 259656a76e Merge branch 'maint' 2017-12-03 09:03:37 +01:00
Nicolas Goaziou 2faaacfeeb Revert the whole time zone mess
* lisp/org.el (org-time-string-to-time):
(org-time-string-to-seconds): Remove optional ZONE argument.
(org-2ft):
(org-check-before-date):
(org-check-after-date):
(org-check-dates-range):
(org-parse-time-string):
* lisp/org-clock.el (org-clock-get-sum-start):
(org-clock-out):
(org-clock-timestamps-change):
(org-clock-sum):
(org-clock-update-time-maybe):
* lisp/org-colview.el (org-columns--age-to-minutes): Apply change.
* testing/lisp/test-org-clock.el (org-test-clock-create-clock):
(test-org-clock/clocktable/scope):
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Apply change.  Simplify tests to avoid daylight saving time issue.
2017-12-03 08:57:37 +01:00
Nicolas Goaziou bdaf5dacf4 Merge branch 'maint' 2017-12-02 17:27:53 +01:00
Nicolas Goaziou ca43c1f262 Fix RET past the last column of a table
* lisp/org.el (org-return): Split the table before first column or
  after last one.
* lisp/org-table.el (org-table-next-row): Remove code handling split.

* testing/lisp/test-org.el (test-org/return): Add test.
2017-12-02 17:23:03 +01:00
Nicolas Goaziou 0ace32b045 Merge branch 'maint' 2017-12-02 12:23:02 +01:00
Nicolas Goaziou f53d1e2005 Let `or-export-last-sibling-p' handle discontinuous headlines
* lisp/ox.el (org-export-last-sibling-p): Handle discontinuous
  headlines.
* testing/lisp/test-ox.el (test-org-export/last-sibling-p): Add test.

Fixes: 24836
2017-12-02 12:22:32 +01:00
Alex Branham ee7ead62aa Make `org-comment-dwim' check if on a heading
* lisp/org.el (org-comment-dwim): If on a heading, comment the
  heading.

* testing/lisp/test-org.el: Add test.

TINYCHANGE
2017-11-29 14:41:12 +01:00
Nicolas Goaziou acfb1ca4b8 Merge branch 'maint' 2017-11-29 14:37:33 +01:00
Nicolas Goaziou 12ea0f08f4 Fix some tests
* testing/lisp/test-org.el (test-org/comment-dwim): Fix tests
2017-11-29 14:37:12 +01:00
Nicolas Goaziou b0ab7008df Merge branch 'maint' 2017-11-26 10:47:55 +01:00
Nicolas Goaziou 6aac798f25 Fix publishing links to absolute file names belonging to project
* lisp/ox-publish.el (org-publish-file-relative-name): New function.
* lisp/ox-html.el (org-html-link): Use new function.

* testing/lisp/test-ox-publish.el (test-org-publish/file-relative-name):
  New test.
2017-11-26 10:46:53 +01:00
Nicolas Goaziou be1e807942 Merge branch 'maint' 2017-11-25 21:13:58 +01:00
Nicolas Goaziou 1d8126385c ob-core: Fix results removal without blank line between source and results
* lisp/ob-core.el (org-babel-remove-result): Delete blank lines before
  results.
(org-babel-result-end): Use `org-element-at-point'.
* testing/lisp/test-ob.el (test-ob-verify-result-and-removed-result):
  Remove duplicate.
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--no-blank-line):
  New test.
* testing/lisp/test-ob.el (test-ob/results-in-narrowed-buffer): Small
  refactoring.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00338.html>
2017-11-25 21:07:52 +01:00
Nicolas Goaziou 51234f9555 org-macro: Implement "keyword" macro
* lisp/org-macro.el (org-macro-initialize-templates): Implement
  "keyword" macro.
* doc/org.texi (Macro replacement): Document new macro.

* testing/lisp/test-org-macro.el (test-org-macro/keyword): New test.
2017-11-21 23:38:24 +01:00
Nicolas Goaziou 7455f4bf83 ox: Allow a less strict UNNUMBERED inheritance
* lisp/ox.el (org-export-collect-headlines):
(org-export-excluded-from-toc-p): Allow to number headlines in the
middle of an otherwise unnumbered tree.

* testing/lisp/test-ox.el (test-org-export/collect-headlines):
(test-org-export/excluded-from-toc-p):
(test-org-export/toc-entry-backend): Update tests.  Add more tests.

Reported-by: Akater <nuclearspace@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00219.html>
2017-11-20 14:07:03 +01:00
Nicolas Goaziou f482cfa785 Merge branch 'maint' 2017-11-20 00:14:05 +01:00
Nicolas Goaziou 82812ff086 ox: Fix UNNUMBERED strict inheritance
* lisp/ox.el (org-export-numbered-headline-p): Use a less opinionated
  definition of inheritance.

* testing/lisp/test-ox.el (test-org-export/numbered-headline-p):
  Update test.

* doc/org.texi (Export settings): Insist on UNNUMBERED inheritance.

It is now possible to number a headline within an unnumbered tree.
2017-11-20 00:09:59 +01:00
Nicolas Goaziou b8d473a04f org-table: Insert new column to the right instead of the left
* lisp/org-table.el (org-table-insert-column): Insert new column to
  the right instead of the left.

* testing/lisp/test-org-table.el (test-org-table/insert-column): New
  test.
2017-11-19 23:22:16 +01:00
Nicolas Goaziou 966af419f9 Merge branch 'maint' 2017-11-15 18:14:44 +01:00
Nicolas Goaziou 40f73953f6 Fix `org-string-display'
* lisp/org-macs.el (org-string-display): Preserve original string's
  display property when computing displayed width.

* testing/lisp/test-org-macs.el (test-org/string-display): Add test.

Reported-by: Ruy Exel <ruyexel@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00160.html>
2017-11-15 18:13:34 +01:00
Nicolas Goaziou 8ff3673dfc Merge branch 'maint' 2017-11-15 17:41:48 +01:00
Nicolas Goaziou 6059c3a057 org-table: Clean left-over `:org-untouchable' property
* lisp/org-table.el (org-table-recalculate): Clean `:org-untouchable'
  property once we no longer need it.

* testing/lisp/test-org-table.el (test-org-table/formula-priority):
  New test.

Reported-by: Ruy Exel <ruyexel@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00159.html>
2017-11-15 17:40:22 +01:00
Marco Wahl 5c382f2ee2 org-attach,test-org-attach: Refactoring.
* lisp/org-attach.el (org-attach-dired-to-subtree): Renamed from
  `org-attach-dired-attach-to-next-best-subtree'.  Convenience
  functions have been dropped.

* testing/lisp/test-org-attach.el: Tests use
  `org-test-with-temp-text-in-file' now and are cleaner now.
2017-11-15 14:39:26 +01:00
Marco Wahl 615b147031 org-attach: Attach files specified in a dired buffer.
* lisp/org-attach.el (org-attach-attach-files): New.
(org-attach-dired-marked-files-in-dired): New
(org-attach-dired-marked-files-or-file-at-cursor-in-dired): New.
(org-attach-dired-attach-to-next-best-subtree): New command.
(org-attach-dired-attach-to-next-best-subtree-cp): New command.
(org-attach-dired-attach-to-next-best-subtree-mv): New command.
(org-attach-dired-attach-to-next-best-subtree-ln): New command.
(org-attach-dired-attach-to-next-best-subtree-lns): New command.
* testing/lisp/test-org-attach.el: Tests.
2017-11-15 11:25:51 +01:00
Nicolas Goaziou d07ee7f7f2 Implement :pre-blank property for items and footnotes definitions
* lisp/org-element.el (org-element-footnote-definition-parser):
(org-element-item-parser): Add `:pre-blank' property.
(org-element-footnote-definition-interpreter):
(org-element-item-interpreter):
(org-element-interpret-data):
* lisp/ox.el (org-export-data): Use new property.
* testing/lisp/test-org-element.el (test-org-element/footnote-definition-parser):
(test-org-element/item-parser): Add tests.
2017-11-10 00:38:31 +01:00
Eric Abrahamsen c04e357f3d Replace easy templates with org-insert-structure-template
* lisp/org.el (org-insert-structure-template): New function for
  wrapping region (or element at point) in a begin/end block.
  (org-structure-predefined-blocks): New option holding predefined
  blocks, for completion.
  (org-try-structure-completion,
  org-complete-expand-structure-template): Remove functions.
* doc/org.texi (Inserting structure templates): Document.
* testing/lisp/test-org.el (test-org/insert-template): New test.
2017-11-05 09:56:26 +01:00
Nicolas Goaziou 7ba058963e Merge branch 'maint' 2017-11-04 21:51:40 +01:00
Nicolas Goaziou 6186ed3a22 org-element: Fix item parser
* lisp/org-element.el (org-element--list-struct): Correctly handle end
  of sub-lists and end of last item.

* testing/lisp/test-org-element.el (test-org-element/item-parser):
(test-org-element/plain-list-parser): Add tests.
2017-11-04 21:50:11 +01:00
Nicolas Goaziou 6a273e30d7 Merge branch 'maint' 2017-11-03 22:20:46 +01:00
Xavier Martinez-Hidalgo f38a7d433b org-capture: Fix aborting after inserting text at end of buffer
* lisp/org-capture.el (org-capture-mark-kill-region): Set end marker
  insertion type so that it advances when inserting text at the end of
  the capture buffer.

* testing/lisp/test-org-capture.el (test-org-capture/insert-at-end-abort):
  Add test case.

Inserting text at the end of the capture buffer does not advance the
end kill marker.  This causes the narrowing region and the kill
markers to get out of sync, which prevents 'org-capture-finalize' from
correctly cleaning the target buffer when aborting the capture.

Setting the kill end marker insertion type fixes this.

TINYCHANGE
2017-11-03 22:20:11 +01:00
Nicolas Goaziou ee3a9e9a77 Fix failing test
* testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link):
  Rewrite test to prevent race condition which could affect results.
* testing/examples/pub/b.org: Add missing keyword.
2017-11-03 22:15:41 +01:00
Nicolas Goaziou 99dbca3d4f Remove `org-babel-use-quick-and-dirty-noweb-expansion'
* lisp/ob-core.el (org-babel-use-quick-and-dirty-noweb-expansion):
  Remove variable.
(org-babel-expand-noweb-references): Update function.

* doc/org.texi (noweb-ref): Document new behaviour.
(Noweb reference syntax): Delete reference to removed variable.

`org-babel-use-quick-and-dirty-noweb-expansion' main use is to speed
up Noweb expansion when expanding only by name.  By distinguishing
name and reference expansion, we no longer need this variable.  In the
first case, the expansion is quicker anyway, and in the second case,
we most certainly need an accurate expansion.
2017-10-26 13:09:23 +02:00
Nicolas Goaziou 1b9a66487a Move a test
* testing/lisp/test-org-macs.el (test-org/in-regexp): Moved from...
* testing/lisp/test-org.el: ... here.
2017-10-24 09:55:49 +02:00
Nicolas Goaziou 96c7fd7541 Merge branch 'maint' 2017-10-24 09:53:47 +02:00
Nicolas Goaziou 3aa4d44ba8 Fix comma escaping with multiple leading commas
* lisp/org-src.el (org-escape-code-in-region):
(org-escape-code-in-string):
(org-unescape-code-in-region):
(org-unescape-code-in-string): Fix comma escaping with multiple
leading commas.

* testing/lisp/test-org-src.el (test-org-src/escape-code-in-string):
(test-org-src/unescape-code-in-string): New tests.

Reported-by: Michal Politowski <mpol@meep.pl>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00359.html>
2017-10-24 09:51:43 +02:00
Nicolas Goaziou bed03c4b42 Merge branch 'maint' 2017-10-22 12:42:35 +02:00
thibault 1613153aac Fix tangling of org block with nested source block
* lisp/ob-tangle.el (org-babel-tangle-single-block): Prevent double unescaping
of source block by removing unnecessary call to `org-unescape-code-in-string'.

* testing/lisp/test-ob-tangle.el (ob-tangle/nested-block) New function.
2017-10-22 12:42:05 +02:00
Nicolas Goaziou cd9cccb4b2 Merge branch 'maint' 2017-10-18 22:49:10 +02:00
Allen Li 8c5c030c64 Fix `org-insert-todo-heading'
* lisp/org.el (org-insert-todo-heading): Insert TODO keyword relative
  to the original headline, not to the headline above.

* testing/lisp/test-org.el (test-org/insert-todo-heading-respect-content):
  Add test.
2017-10-18 22:48:16 +02:00
Nicolas Goaziou b401d3a44b Implement `org-export-excluded-from-toc-p'
* lisp/ox.el (org-export-excluded-from-toc-p): New function.

* testing/lisp/test-ox.el (test-org-export/excluded-from-toc-p): New
  test.
2017-10-15 16:51:13 +02:00
Nicolas Goaziou 9b13e44ad7 ox: Implement "notoc" UNNUMBERED value
* lisp/ox.el (org-export-collect-headlines): Exclude headlines with
  UNNUMBERED property set to "notoc".

* doc/org.texi (Export settings):
(Table of contents): Document new value.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Add
  test.
2017-10-15 16:51:10 +02:00
Nicolas Goaziou 7df5d21f79 Merge branch 'maint' 2017-10-14 12:30:59 +02:00
Nicolas Goaziou 827af59873 Fix links without contents in table of contents' entries
* lisp/ox.el (org-export-toc-entry-backend): New function.

* lisp/ox-html.el (org-html--format-toc-headline):
* lisp/ox-md.el (org-md--build-toc):
* lisp/ox-odt.el (org-odt-toc): Use new function.

* lisp/ox-texinfo.el (org-texinfo--sanitize-title):
(org-texinfo--wrap-float): Handle links without contents.

* testing/lisp/test-ox.el (test-org-export/toc-entry-backend): New
  test.

Reported-by: ConcreteVitamin <concretevitamin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00235.html>
2017-10-14 12:29:52 +02:00
Nicolas Goaziou 2a55d206e3 Merge branch 'maint' 2017-10-08 10:54:00 +02:00
Georgiy Tugai 07f939f419 org-clock: Fix clock report sometimes ignoring hours before :wstart
* lisp/org-clock (org-clocktable-steps): Fix weekly-step clock report
  ignoring hours between start of period and start of week, when start
  of period is on a day of week numerically less than start of week.

  Clock report now always inserts a "week" starting at the start of
  the period, if necessary; all following weeks start on the start of
  the week as expected.

TINYCHANGE
2017-10-08 10:53:39 +02:00
Nicolas Goaziou fa56da61a7 Merge branch 'maint' 2017-10-08 10:36:48 +02:00
Nicolas Goaziou d747e51fbf Consider headlines as sentences by themselves
* lisp/org.el (org-forward-sentence): Consider headlines as sentences
  by themselves.

* testing/lisp/test-org.el (test-org/forward-sentence): Add test.

Reported-by: Mat Vibrys <vibrysec@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00130.html>
2017-10-08 10:35:22 +02:00
Nicolas Goaziou 44e3745c78 Merge branch 'maint' 2017-10-06 19:35:25 +02:00
Nicolas Goaziou fb403ca34e Fix `org-backward-paragraph' on an empty heading
* lisp/org.el (org-backward-paragraph): Fix behavior on greater
  elements without contents.

* testing/lisp/test-org.el (test-org/backward-paragraph): Add test.

Reported-by: Omar Antolin <omar.antolin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00099.html>
2017-10-06 19:34:28 +02:00
Nicolas Goaziou 1b12ad5cf6 Merge branch 'maint' 2017-10-04 12:58:41 +02:00
Nicolas Goaziou ef6dac812b Fix `org-backward-paragraph' on block opening line
* lisp/org.el (org-backward-paragraph): Do not error when called from
  a block opening line.
* testing/lisp/test-org.el (test-org/backward-paragraph): Add tests.

Reported-by: Omar Antolin <omar.antolin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00051.html>
2017-10-04 12:57:14 +02:00
Nicolas Goaziou 73df53f185 Merge branch 'maint' 2017-10-01 22:58:24 +02:00
Nicolas Goaziou fcdcfe682f Fix typo in comment
* testing/lisp/test-org.el (test-org/buffer-property-keys): Remove
  spurious word.
2017-10-01 22:56:57 +02:00
Nicolas Goaziou 428368af2f Merge branch 'maint' 2017-10-01 19:02:47 +02:00
Nicolas Goaziou 018fb0149d Fix parsing properties with title or summary type
* testing/lisp/test-org.el (test-org/buffer-property-keys): Ignore
  title and summary type when extracting name.

Reported-by: Adrian Bradd <adrian.bradd@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00001.html>
2017-10-01 19:01:58 +02:00
Nicolas Goaziou 3056abe781 Merge branch 'maint' 2017-09-24 10:58:43 +02:00
Nicolas Goaziou d40deb6967 ox-publish: Fix :base-extension any with :recursive t
* lisp/ox-publish.el (org-publish-get-base-files): Ensure MATCH regexp
  is always a string since `directory-files-recursively' requires it.
* testing/lisp/test-ox-publish.el (test-org-publish/get-project-from-filename):
  Add test.

Suggested-by: Jens Lechtenboerger <lechten@wi.uni-muenster.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00528.html>
2017-09-24 10:57:11 +02:00
Nicolas Goaziou ad0662bbe7 Revert "Table of contents ignore unnumbered headlines"
This reverts commit bd2378161e.
2017-09-21 21:14:41 +02:00
Nicolas Goaziou 85acebdc2e Remove auto-repair of malformed property drawers
* lisp/org.el (org-buffer-property-keys): Remove optional argument
  IGNORE-MALFORMED.
* lisp/org-pcomplete.el (pcomplete/org-mode/prop): Update call to
  previous function.

* testing/lisp/test-org.el (test-org/buffer-property-keys): Remove
  a test.

More often than not, the question just gets in the way.  Use `M-x
org-lint' instead.
2017-09-16 14:15:57 +02:00
Nicolas Goaziou 9e062df65d Merge branch 'maint' 2017-09-14 15:44:06 +02:00
Nicolas Goaziou 25f12218d2 Fix `org-auto-repeat-maybe'
* lisp/org.el (org-auto-repeat-maybe): Fix `org-auto-repeat-maybe'.

* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00298.html>
2017-09-14 15:40:28 +02:00
Nicolas Goaziou 04498a4fbd Merge branch 'maint' 2017-09-14 15:25:36 +02:00
Nicolas Goaziou 63f1ffac32 ob-scheme: Fix results error on unspecified and void values
* lisp/ob-scheme.el (org-babel-scheme-execute-with-geiser): Return
  "#<void>" or "#<unspecified>" when the REPL says so.

* testing/lisp/test-ob-scheme.el (test-ob-scheme/unspecified): New
  test.
(test-ob-scheme/prologue): Fix tests.

Reported-by: Lawrence Bottorff <borgauf@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00346.html>
2017-09-14 15:25:04 +02:00
Nicolas Goaziou c59cb987eb Merge branch 'maint' 2017-09-12 09:02:43 +02:00
Nicolas Goaziou 95271315cc Fix `org-forward-sentence' on a headline
* lisp/org.el (org-forward-sentence): Fix `org-forward-sentence' on a headline.

* testing/lisp/test-org.el (test-org/forward-sentence): Add tests.

Reported-by: Mat Vibrys <vibrysec@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00282.html>
2017-09-12 09:02:02 +02:00
Nicolas Goaziou bd2378161e Table of contents ignore unnumbered headlines
* doc/org.texi (Table of contents): Document behavior.
* lisp/ox-texinfo.el (org-texinfo-classes): Use @heading commands and
  alike for unnumbered sections.
* lisp/ox.el (org-export-collect-headlines): Ignore unnumbered
  headlines.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Add
  test.
2017-09-10 15:53:20 +02:00
Stig Brautaset 2b2314d46d org-colview: Allow custom COLLECT functions for derived properties
* lisp/org-colview.el (org-columns-summary-types): Allow new format.
(org-columns--summarize): Update to new summary type format.
(org-columns--collect): New function.
(org-columns--compute-spec): Apply changes.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add test.

In addition to (LABEL . SUMMARIZE), org-columns-summary-types now
accepts (LABEL SUMMARIZE COLLECT) entries. The new COLLECT function is
called with one argument, the property being summarized.

TINYCHANGE
2017-09-10 11:06:43 +02:00
Nicolas Goaziou 007bbddbcc ox-html: Prevent spurious target below headlines
* lisp/ox-html.el (org-html-headline):
(org-html-link): Do not insert an additional target.

* lisp/ox-publish.el (org-publish-resolve-external-link): Add an
  optional argument.

* lisp/ox.el (org-export-get-reference): Improve docstring.

* testing/examples/pub/a.org:
* testing/examples/pub/b.org: New files.
* testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link):
  New test.
2017-09-10 00:23:42 +02:00
Nicolas Goaziou c8aaf8f694 Merge branch 'maint' 2017-09-08 13:21:22 +02:00
Nicolas Goaziou 7ce9a24115 Fix duplicate tests
Reported-by: Stig Brautaset <stig@brautaset.org>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00187.html>
2017-09-08 13:20:48 +02:00
Nicolas Goaziou 17013d6f38 Remove duplicate test
* testing/lisp/test-org-table.el (test-org-table/align): Remove test.
2017-09-08 13:14:55 +02:00
Nicolas Goaziou 11979e298d org-archive: Fix failing tests
* testing/lisp/test-org-archive.el (test-org-element/archive-update-status-cookie):
Fix failing tests.
2017-09-07 15:25:00 +02:00
Nicolas Goaziou 6cfc7cb958 Merge branch 'maint' 2017-09-07 15:21:35 +02:00
Nicolas Goaziou 91a76063d8 org-duration: Fix `org-duration-to-minutes' with the empty string
* lisp/org-duration.el (org-duration-to-minutes): Accept the empty
  string.

* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Add test.

For backward compatibility with `org-duration-string-to-minutes'
accept the empty string as a duration.
2017-09-07 15:20:26 +02:00
Nicolas Goaziou 70d2b3c96f org-table: Obey <c> cookie when aligning a table
* lisp/org-table.el (org-table--align-field): New function.
(org-table-align): Use new function.  Refactor code.
(org-table-justify-field-maybe): Use new function.
(org-table-get-remote-range): Remove duplicate bindings.

* doc/org.texi (Column width and alignment): Remove footnote.

* testing/lisp/test-org-table.el (test-org-table/align): New test.
2017-09-06 15:21:20 +02:00
Nicolas Goaziou 882f3f3fc0 org-table: Change behavior of `org-table-toggle-column-width'
* lisp/org-table.el (org-table-toggle-column-width): Change behavior
  of `org-table-toggle-column-width'.
(org-table-shrink): Allow optional arguments.

* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
  Update tests.
2017-09-06 15:18:37 +02:00
Nicolas Goaziou 23a2fde6fe Remove visual effect of width cookies in tables
* lisp/org-colview.el (org-dblock-write:columnview): Remove :width
  parameter.

* lisp/org-table.el (org-narrow-column-arrow): Remove variable.
(org-table-cleanup-narrow-column-properties): Remove function.
(org-table-align): Ignore width cookies when aligning table.
(org-table-justify-field-maybe):
(org-table-finish-edit-field):
(org-table-follow-fields-with-editor):
(orgtbl-setup): Remove reference to `org-cwidth' property.

* lisp/org.el (org-mode):
(org-hide-wide-columns): Remove function.
(org-set-font-lock-defaults): Apply previous removal.
(org-shorten-string): Ignore `org-cwidth' property.

* testing/lisp/test-org-colview.el (test-org-colview/dblock): Remove
  a test.

Export back-ends may still use width cookie to alter table's output.
2017-09-06 15:18:37 +02:00
Nicolas Goaziou 6d6a30d4cd org-table: Implement shrunk columns
* lisp/org-table.el (org-table-shrunk-column-indicator): New variable.
(org-table-with-shrunk-columns): New macro.
(org-table--shrunk-field):
(org-table--list-shrunk-columns):
(org-table--shrink-field):
(org-table--read-column-selection):
(org-table--expand-all-columns):
(org-table-toggle-column-width): New functions.

(org-table-align):
(org-table-get-field):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-move-row):
(org-table-insert-row):
(org-table-insert-hline):
(org-table-kill-row):
(org-table-sort-lines): Use new functions.

(org-table-overlay-coordinates):
(org-table-toggle-coordinate-overlays): Tiny refactoring.

* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
(test-org-table/shrunk-columns): New tests.
2017-09-06 15:18:37 +02:00
Jay Kamat 331ba68495 org-archive.el: Update statistic cookies when archiving
* lisp/org-archive.el (org-archive-subtree): Update todo statistics
  when calling `org-archive-subtree'.
(org-archive-to-archive-sibling): Update cookie statistics when
calling `org-archive-to-archive-sibling'.

* testing/lisp/test-org-archive.el: New file.

This can be disabled by setting `org-provide-todo-statistics' to nil.
2017-09-06 14:31:01 +02:00
Eduardo Bellani 6edec1bef5 Fix table variable with commas in ob-sqlite
* lisp/ob-sqlite.el (org-babel-sqlite-expand-vars): Stop interfering
  with the 'orgtbl-to-csv' default formatting.

* testing/lisp/test-ob-sqlite.el: New file.

The problem here was that ob-sqlite was providing a format to the
`orgtbl-to-csv' that actually overwrote the default format in that
function, and in the case where there were commas in the content of
the table, broke the table as argument mechanism.

TINYCHANGE
2017-09-06 13:18:30 +02:00
Nicolas Goaziou 8a0c89244d Merge branch 'maint' 2017-08-31 23:15:56 +02:00
Nicolas Goaziou 1654a5a98a Fix `:jump-to-captured' when refiling a capture target
* lisp/org-capture.el (org-capture-refile): Call
  `org-capture-goto-last-stored' at the appropriate time.

* testing/lisp/test-org-capture.el (test-org-capture/refile): Add
  test.

Reported-by: "Raymond Zeitler" <zeitra@yahoo.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00704.html>
2017-08-31 23:14:04 +02:00
Nicolas Goaziou 64bfa2d931 Remove `inline-only' option for `org-export-use-babel'
* lisp/ob-exp.el (org-export-use-babel): Remove `inline-only' option.
(org-babel-exp-process-buffer): Ignore `inline-only' value.

* doc/org.texi (Exporting code blocks): Remove documentation.

* testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): Remove tests.
2017-08-26 10:32:26 +02:00
Nicolas Goaziou e0682619dd Merge branch 'maint' 2017-08-26 00:12:46 +02:00
Nicolas Goaziou a6840598ed Fix `org-copy-visible'
* lisp/org.el (org-copy-visible): Rewrite function.  Do not use
  dubious `org-find-visible' and `org-find-invisible'.

* testing/lisp/test-org.el (test-org/copy-visible): New test.

Reported-by: Gary Cheng <garycheng12@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00568.html>
2017-08-26 00:09:51 +02:00
Nicolas Goaziou a68d117459 Merge branch 'maint' 2017-08-25 15:25:02 +02:00
Nicolas Goaziou c1b9d38c89 org-lint: Fix wrong warning with inline footnotes
* lisp/org-lint.el (org-lint-undefined-footnote-reference): Do not
  warn when definition is inline.

* testing/lisp/test-org-lint.el (test-org-lint/undefined-footnote-reference):
  Add tests.

Reported-by: Eric S Fraga <esflists@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00577.html>
2017-08-25 15:24:07 +02:00
Nicolas Goaziou bae41a277e org-table: Fix sorting with times > 100 hours
* lisp/org-table.el (org-table-sort-lines): Fix regexp.  Also test
  durations.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): Update
  tests.  Add a new one.
2017-08-25 00:06:27 +02:00
Nicolas Goaziou 526b3d4b98 Merge branch 'maint' 2017-08-21 21:27:06 +02:00
Nicolas Goaziou 6980b02b6f Revert "org-macro: Expand macros only within narrowed part of buffer"
This reverts commit 82db669de6.
2017-08-21 21:21:30 +02:00
Nicolas Goaziou 5cde947766 test-org-agenda: Small refactoring
* testing/lisp/test-org-agenda.el (org-test-agenda--agenda-buffers):
(org-test-agenda--kill-all-agendas): Use appropriate prefix.

(test-org-agenda/empty):
(test-org-agenda/one-line):
(test-org-agenda/scheduled-non-todo):
(test-org-agenda/sticky-agenda-name):
(test-org-agenda/sticky-agenda-name-after-reload): Find a human
readable name.
2017-08-19 19:42:20 +02:00
Nicolas Goaziou bc8360c702 Fix failing test
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
  Fix failing test.
2017-08-19 19:12:08 +02:00
Nicolas Goaziou 8590c79b3a Fix some failing tests
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-headers):
(test-ob-exp/org-babel-exp-src-blocks/w-no-file): Fix test.

These tests fail when "htmlize" is not available on the machine.
2017-08-19 18:56:31 +02:00
Nicolas Goaziou 15e992c6da Merge branch 'maint' 2017-08-13 16:21:21 +02:00
Nicolas Goaziou 24a76fbe57 ob-core: Fix improper results indentation
* lisp/ob-core.el (org-babel-insert-result): Fix improper results
  indentation.
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation): Add
  test.

Reported-by: Chunyang Xu <mail@xuchunyang.me>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00308.html>
2017-08-13 16:20:20 +02:00
Galen Menzel 8fa6c015a4 Fix false test failure
* testing/lisp/test-org.el (test-org/refile-get-targets): Fix false
failures when test temp-file path contains a symlink.

TINYCHANGE
2017-08-10 22:43:39 +02:00
Nicolas Goaziou 9945e029f5 Merge branch 'maint' 2017-08-10 22:40:34 +02:00
Galen Menzel bff63cbeb3 Fix false test failure
* testing/lisp/test-org.el (test-org/deadline-close-p): Fix false
failures due to time-zone differences.
2017-08-10 22:39:30 +02:00
Nicolas Goaziou 829ffa977c Merge branch 'maint' 2017-08-10 12:42:51 +02:00
Nicolas Goaziou febab2fedb Add test for `org-open-at-point'
* testing/lisp/test-org.el (test-org/open-at-point/tag): New test.
2017-08-10 12:41:54 +02:00
Christian Garbs 4d2c8354ee ob-vala.el: Add Vala support to Babel
* lisp/ob-vala.el: Add support for the Vala language to Babel.

* testing/lisp/test-ob-vala.el: Add tests for ob-vala.el.

* doc/org.texi (Working with source code): Add Vala to the list of
  supported languages.
2017-08-07 11:40:25 +02:00
Nicolas Goaziou a7e11643a9 Merge branch 'maint' 2017-08-06 10:31:06 +02:00
Nicolas Goaziou 9974ed39b2 org-src: Fix remote footnote edition
* lisp/org-src.el (org-edit-footnote-reference): Clone local variables
  in remote editing buffer.

* testing/lisp/test-org-src.el (test-org-src/footnote-references): Add
  test.
2017-08-06 10:30:48 +02:00
Nicolas Goaziou b0776e39b5 org-table: Small refactoring
* lisp/org-table.el (org-table-previous-field): Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/previous-field): New
  test.
2017-08-02 10:35:57 +02:00
Nicolas Goaziou 29d8d407e8 org-macs: Add tests for `org-split-string.
* testing/lisp/test-org-macs.el (test-org/split-string): New test.
2017-08-01 20:29:23 +02:00
Nicolas Goaziou 90f606d9c2 org-macs: Fix `org-string-width' with `display' property
* lisp/org-macs.el (org-string-display): New function.
(org-string-width): Use new function.

* testing/lisp/test-org-macs.el: New file.
2017-07-28 12:15:47 +02:00
Nicolas Goaziou e79b0bd9f3 Merge branch 'maint' 2017-07-28 10:15:35 +02:00
Nicolas Goaziou 808089ee04 `org-forward/backward-paragraph' do not error at buffer boundaries
* lisp/org.el (org-forward-paragraph):
(org-backward-paragraph): Do not error at buffer boundaries.

Reported-by: Omar Antolín Camarena <omar.antolin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-07/msg00478.html>
2017-07-28 10:07:53 +02:00
Nicolas Goaziou 9adab7ff90 ob-scheme: Fix :prologue handling
* lisp/ob-scheme.el (org-babel-expand-body:scheme): Handle :prologue
  handling without any :var parameter.
* testing/lisp/test-ob-scheme.el: New file.
2017-07-24 13:55:20 +02:00
Nicolas Goaziou f6109d355e Merge branch 'maint' 2017-07-23 22:42:50 +02:00
Nicolas Goaziou 5e0db07988 ob-emacs-lisp: Fix pp results
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Move "pp" handling...
(org-babel-execute:emacs-lisp): ... here.

* testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/commented-last-block-line):
  Small refactoring.

Reported-by: Chunyang Xu <mail@xuchunyang.me>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-07/msg00355.html>
2017-07-23 22:41:27 +02:00
Stig Brautaset 3e1aeac3b3 use cl-lib functions rather than cl ones in org-test
From ead36e862d150e3a83d363bdead850a2e3ec281d Mon Sep 17 00:00:00 2001
From: Stig Brautaset <stig@brautaset.org>
Date: Fri, 14 Jul 2017 20:43:11 +0100
Subject: [PATCH 1/3] org-test.el: use prefixed functions from cl-lib.el rather
 than cl.el
2017-07-23 11:06:37 +02:00
Marco Wahl 566e700007 test-org-agenda: Non-todo-kwd scheduled item must appear in agenda 2017-07-19 17:43:50 +02:00
Nicolas Goaziou 97a1a49895 Fix failing tests in non-daylight saving time zones
* lisp/org.el (org-time-string-to-time): Remove optional POS and
  BUFFER arguments.  Accept new optional ZONE argument.
(org-time-string-to-seconds): Accept optional ZONE argument.
(org-check-before-date):
(org-check-after-date):
(org-check-dates-range):
(org-goto-calendar):
* lisp/ob-gnuplot.el (org-time-string-to-time):
* lisp/org-agenda.el (org-agenda-get-blocks):
* lisp/org-clock.el (org-clock-timestamps-change):
* lisp/org-list.el (org-time-string-to-seconds): Use UTC for time
  difference and time comparison.

* testing/lisp/test-org-clock.el (org-test-clock-create-clock): Use
  UTC for time differences.
2017-07-07 18:23:10 +02:00