* 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.
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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
* 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.
* 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.
* 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.
* 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.
* 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
* 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>
* 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>
* 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.
* 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>
* 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
* 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.
* 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.
* 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.
* 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
* 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>
* 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>
* 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.
* 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.
* 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.
* 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.
lisp/org-protocol.el (org-protocol-project-alist): Date-URL is added
as example.
(org-protocol-open-source): First match is processed in rewrite.
testing/lisp/test-org-protocol.el (test-org-protocol/org-protocol-open-source):
Configuration displaying a date-style URL is added.
TINYCHANGE
* lisp/org-element.el (org-element-latex-fragment-parser): Also check
border character right after opening "$" sign.
* testing/lisp/test-org-element.el (test-org-element/latex-fragment-parser):
Add tests.
Reported-by: thomas <thomas@friendlyvillagers.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/114285>
* lisp/org.el (org-open-at-point): Also open links in example blocks
and diary-sexps.
* testing/lisp/test-org.el (test-org/open-at-point/keyword):
(test-org/open-at-point/property):
(test-org/open-at-point/comment): Add tests.
Reported-by: Dieter Faulbaum <Dieter.Faulbaum@helmholtz-berlin.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00277.html>
* lisp/org-clock.el (org-clock-out):
(org-clock-sum):
(org-clocktable-steps):
(org-clock-update-time-maybe): Use UTC to compute time differences.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/scope):
Update test.
* lisp/org-macro.el (org-macro--counter-increment): Rename the
optional arg RESET to ACTION, as now that action can mean setting,
resetting or even holding the specified counter. ACTION set to
"-" will hold the previous value of the counter. White-space is
now trimmed from the NAME arg too.
* doc/org.texi (Macro replacement): Document the new hold action.
* testing/lisp/test-org-macro.el (test-org-macro/n): Add new tests for
the hold action.
* lisp/org-table.el (org-table-duration-custom-format): Add new
HH:MM format.
(org-table-duration-hour-zero-padding): New option.
(org-table-eval-formula): Select second-less format if
requested.
(org-table-time-seconds-to-string): Implement formats without
seconds and without zero-padding for hours.
* testing/lisp/test-org-table.el (test-org-table/duration):
New test for second-less durations.
* doc/org.texi (Formula syntax for Calc)
(Durations and time values): Document the U mode switch.
* lisp/org.el (org--file-cache): New variable.
(org-reset-file-cache):
(org-file-url-p): New function.
(org-mode-restart): Use new function.
* lisp/org.el (org-file-contents): Allow the FILE argument to be a
URL. If the URL contents are already cached, return the cache
contents, else download the file and return contents of that. The
file is automatically cached each time it is downloaded. Add a new
optional argument NOCACHE. If this is non-nil, the URL is always
downloaded afresh. Use `org--file-cache' and `org-file-url-p'.
* lisp/org.el (org-edit-special): Do not allow editing the "file" if a
URL is specified for the "#+SETUPFILE".
* lisp/ox.el (org-export--list-bound-variables)
(org-export--prepare-file-contents):
* lisp/org-macro.el (org-macro--collect-macros) : Adapt to the
possibility that the input to `org-file-contents' can be a URL too.
* doc/org.texi (Export settings, In-buffer settings)
(The very busy C-c C-c key): Mention that #+SETUPFILE keyword can now
take a URL as a value, and that C-c C-c on the #+SETUPFILE line will
clear the org file cache.
* testing/lisp/test-org.el (test-org/org-file-contents-url)
(test-org/org-file-contents-file): Add tests for org-file-contents.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options): Add
test for reading setupfile specified via a URL.
* lisp/ob-shell.el (org-babel--variable-assignments:bash): Do not
error when value is a list.
* testing/lisp/test-ob-shell.el (ob-shell/simple-list): New test.
Reported-by: Keith Amidon <camalot@picnicpark.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/113920>
* lisp/org-src.el (org-edit-footnote-reference): Do not collapse
footnote definitions after editing remotely one of them.
* testing/lisp/test-org-src.el (test-org-src/footnote-references): New
test.
* lisp/org-macro.el (org-macro-replace-all): Expand macros only within
narrowed part of buffer.
* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Update
test.
Expanding macros outside in the whole buffer could make sense, e.g.,
if a macro expands to some Babel code, which, in turn, is evaluated
prior to export. However, by principle of least surprise, it is
better to limit expansion to current accessible part of the buffer.
* lisp/org-clock.el (org-clocktable-write-default): Limit number of
time columns to the deepest headline level.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/maxlevel):
Update tests.
* lisp/org-macro.el (org-macro--counter-table): New variable.
(org-macro--counter-initialize):
(org-macro--counter-increment): New functions.
(org-macro-initialize-templates): Use new functions.
* doc/org.texi (Macro replacement): Document new macro.
* testing/lisp/test-org-macro.el (test-org-macro/n):
(test-org-macro/property): New tests.
* lisp/org-capture.el (org-capture-finalize): Remove blank lines
number fix, which only applies to narrowed capture buffers.
(org-capture-insert-template-here):
(org-capture-place-plain-text):
(org-capture-place-item):
(org-capture-place-entry): Do not hard-code number of blank lines
after entry.
Reported-by: Igor Perepelytsya <igorquail@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113093>
Reported-by: Jay Dresser <jay@jaydresser.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/113449>
* lisp/org.el (org-fill-element): New function.
(org-fill-paragraph): Use new function. Also handle region, when
called interactively.
* testing/lisp/test-org.el (test-org/fill-element): Renamed from
test-org/fill-paragraph. Update tests.
Reported-by: Oskar Kvist <oskar.kvist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113542>
* lisp/org.el (org-store-link): When a double C-u prefix argument is
given, do not reverse the meaning of the org-context-in-file-links
option.
* testing/lisp/test-org.el (test-org/store-link): Add tests.
This allows the user to fall back to the core link storing functions
without also reversing their org-context-in-file-links preference,
because wanting to do the former does not mean a user also wants to do
the latter.
Reported-by: York Zhao <gtdplatform@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00254.html>
* lisp/org-colview.el (org-columns--displayed-value): When value is
a number and a format string is specified, apply it.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
Add tests.
Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113547>
* lisp/org-element.el (org-element-context): Do not parse timestamps
within planning line.
* testing/lisp/test-org-element.el (test-org-element/context): Remove test.
Strictly speaking, timestamps within planning lines are parameters
values that use timestamp syntax, not real timestamps belonging to the
document contents.
* lisp/org-element.el (org-element-latex-fragment-parser):
* lisp/org.el (org-latex-regexps): Allow an apostrophe right after
a fragment.
* testing/lisp/test-org-element.el (test-org-element/latex-fragment-parser):
Add test.
In Text mode, and, as a consequence, in Org mode, "'" is not treated
as punctuation, but as word constituent. The apostrophe isn't caught
by "\s." regexp.
Reported-by: Joe Corneli <holtzermann17@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113464>
* lisp/org.el (org-N-empty-lines-before-current): Insert empty lines
before point, not after.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
* lisp/org.el (org--get-expected-indentation): Correctly indent line
when last element in an item is not a greater element.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
* lisp/ox.el (org-export-get-loc):
(org-export-unravel-code):
(org-export-format-code):
(org-export-format-code-default): Do not trim leading and trailing
blank lines from code during export.
* testing/lisp/test-ox.el (test-org-export/unravel-code): Update tests.
(test-org-export/format-code-default): Add tests.
Reported-by: Li DebugFan <debugfanli@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113205>
* lisp/org-src.el (org-src--source-type):
(org-src--tab-width): New variables.
(org-src--edit-element): Set variables above.
(org-src--contents-for-write-back): Re-indent properly non-blank lines
before inserting contents back into the source buffer.
(org-edit-src-code): Delegate block indentation to
`org-src--contents-for-write-back'.
* testing/lisp/test-org-src.el (test-org-src/indented-blocks): New
test.
Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113207>
* lisp/org-element.el (org-element--object-lex): Fix parsing of radio
links within emphasis.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
test.
Reported-by: R C <recifx@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113063>
* lisp/org.el (org-forward-heading-same-level): Do not fail when
heading is at the beginning of the buffer.
* testing/lisp/test-org.el (test-org/forward-heading-same-level): New
test.
Reported-by: Rafael Laboissière <rafael@laboissiere.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/113084>
* lisp/ox.el (org-export-as): Remove uninterpreted data from back-end
specific parsed keywords.
* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.
This fixes 6cd42b08f9.
* lisp/org-agenda.el (org-agenda-list): Reset `org-agenda-buffer-name'
to the original name.
* testing/lisp/test-org-agenda.el: Pertaining unit test. + 2 basic
agenda tests.
* testing/examples/agenda-file.org: File to produce content for an
agenda to test.
* lisp/org.el (org-N-empty-lines-before-current): Do not hide newline
character before current headline.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
Reported-by: Rick Frankel <rick@rickster.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112751>
* lisp/ox.el (org-export--remove-uninterpreted-data): Do not modify
communication channel. Change "blob" to "datum".
(org-export--remove-uninterpreted-data-1): Remove function.
(org-export-as): Remove uninterpreted data from parsed keyword before
applying filters.
* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/112730>
* lisp/org-capture.el (org-capture-fill-template): Escape backslash
characters in %i contents when those are inserted within a S-exp.
Also prevent adding any prefix to %i contents spanning over multiple
lines when they are inserted within a S-exp.
* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
Add tests.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112232>
* lisp/org-clock.el (org-dblock-write:clocktable): Funcall the scope
argument if it is a function.
* doc/org.texi: Document the feature of using a nullary function as the
scope for the clocktable.
* testing/lisp/test-org-clock.el: Adds a test for the above
feature. Also, fix the number of hours of a test that seemed to be
broken.
TINYCHANGE
* lisp/ob-core.el (org-babel-examplify-region): Escape Org syntax
before wrapping it.
* testing/lisp/test-ob.el (test-ob/org-babel-insert-result): Add test.
Renamed from `test-ob/org-babel-insert-result--improper-lists'.
Reported-by: D M German <dmg@turingmachine.org>
* lisp/org-duration.el (org-duration-to-minutes): Fix bug where the
same unit with a decimal unit would be matched multiple times.
* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
Fix test.
* lisp/org-capture.el (org-capture-refile): Preserve location of point
when refiling.
* testing/lisp/test-org-capture.el (test-org-capture/refile): New
test.
Reported-by: Liu Hui <liuhui1610@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112202>
* lisp/org-clock.el (org-clocktable-write-default): Do not ignore
properties specified by :properties parameter.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/properties):
New test.
The regression was introduced in b897ab722.
Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112219>
* lisp/org-clock.el (org-clock--translate): New function.
(org-clocktable-write-default): Use new function.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/lang): New
test.
* lisp/org-element.el (org-element-link-parser):
Handle drive names in uri like file:///c:/dir/file
* lisp/ox.el (org-export-file-uri):
Handle drive names in uri like file:///c:/dir/file
* testing/lisp/test-ox.el (test-org-export/file-uri):
Generate the right uri to be tested against link exporter.
* lisp/org-clock.el (org-clocktable-write-default): Do not raise an
error when :maxlevel is 0. Small refactoring.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Split
into ...
(test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/tags):
(test-org-clock/clocktable/scope):
(test-org-clock/clocktable/maxlevel):
(test-org-clock/clocktable/formula): ... these. Add tests.
This fixes regression introduced in ccf832e83.
Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112091>
* lisp/org-element.el (org-element-insert-before): Do not call
`reverse' as contents might use `eq' objects.
* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test
Reported-by: Justin Kirby <justinkirby@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112065>
* contrib/lisp/org-depend.el (org-depend-trigger-todo): Use new
functions.
* contrib/lisp/org-invoice.el (org-invoice-heading-info):
(org-invoice-info-to-table):
(org-invoice-list-to-table): Use new functions.
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler--build-task): Use
new functions.
* lisp/org-agenda.el (org-agenda-show-clocking-issues):
(org-agenda-format-item):
(org-agenda-filter-effort-form): Use new functions.
* lisp/org-clock.el (org-clock-get-clock-string):
(org-clock-modify-effort-estimate):
(org-clock-notify-once-if-expired):
(org-clock-out):
(org-clock-display):
(org-clock-put-overlay):
(org-clocktable-write-default): Use new functions.
* lisp/org-table.el (org-table-sort-lines): Use new functions.
* lisp/org.el (org-properties-postprocess-alist):
(org-refresh-effort-properties):
(org-set-effort):
(org-entry-properties):
(org-property-next-allowed-value): Use new functions.
(org-time-clocksum-format):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-fractional-format):
(org-time-clocksum-use-effort-durations): Declare as obsolete. Move
to "org-compat.el".
(org-minutes-to-clocksum-string):
(org-hh:mm-string-to-minutes):
(org-duration-string-to-minutes): Declare as obsolete. Move to
"org-compat.el".
(org-hours-to-clocksum-string): Remove function.
* lisp/org-colview.el (org-columns--collect-values): Use new
functions.
(org-columns--duration-re): Remove variable.
(org-columns--time-to-seconds): Rename to...
(org-columns--age-to-minutes): ... this.
(org-columns--format-age): New function.
(org-columns--summary-apply-times):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Use new functions.
* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents-at-point):
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
Update tests.
* lisp/org-clock.el (org-clocktable-write-default): Fix percent computation.
(org-clock-time%): Remove function.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Update
test.
As a consequence of this patch, a ":formula %" doesn't generate
a TBLFM line anymore.
* lisp/org.el (org-get-repeat): Make sure matching group refers to the
proper regexp.
* testing/lisp/test-org.el (test-org/get-repeat): New test.
The bug was introduced in aef7eef0f.
* lisp/org.el (org-get-repeat): Wrap call to save match data against
side effects.
* testing/lisp/test-org.el (test-org/get-repeat): New test for
`org-get-repeat'.
* lisp/org-table.el (org-table-get-field): Do not return
`beginning-of-buffer' error when called at beginning of buffer.
* testing/lisp/test-org-table.el (test-org-table/get-field): New test.
* lisp/org.el (org-refresh-properties): Handle inheritance from global
values (e.g., from "#+PROPERTY:" keyword).
(org-refresh-property): Handle property inheritance with a new
optional argument.
* testing/lisp/test-org.el (test-org/refresh-properties): New test.
* lisp/org.el (org--deadline-or-schedule): New function.
(org-schedule):
(org-deadline): Use new function.
* testing/lisp/test-org.el (test-org/deadline):
(test-org/schedule): New tests.
Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111569>
* lisp/org.el (org-entry-properties): Fix special property value in
current entry, do not leak into next entry.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111648>
* lisp/org.el (org-entry-delete): Also remove erroneously inserted
special properties in properties drawer. Small refactoring.
* testing/lisp/test-org.el (test-org/entry-delete): Add test.
Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111564>
* lisp/org-info.el (org-info-export): Handle links when exporting to
"texinfo" back-end.
* lisp/ox-texinfo.el (org-texinfo-link): Delegate "info" links
handling to the function above.
* lisp/org.el (org-clone-subtree-with-time-shift): Don't choke on a
blank SHIFT argument.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
test.
This fixes a regression introduced by c31462f33.
* lisp/org-table.el (org-table-eval-formula): Result is not always a string.
* testing/lisp/test-org-table.el (test-org-table/copy-field): Update
test.
* lisp/org.el (org-drag-element-backward): When point is on empty
lines below a headline, call `org-move-subtree-up'.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
* lisp/org-element.el (org-element-normalize-contents): Fix return
value when any line after the first has no indentation.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Add test.
* lisp/ox.el (org-export--skip-p): Handle comments and comment blocks
removal.
(org-export--delete-comments): Rename to...
(org-export--delete-comment-trees): ... this. Now only take care of
commented trees and inlinetasks.
* testing/lisp/test-ox.el (test-org-export/comments): Add test.
(org-test-with-parsed-data): Apply renaming.
* lisp/org.el (org-N-empty-lines-before-current): Preserve point when
calling the function from the beginning of a line.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
* lisp/ox.el (org-export-table-has-special-column-p): Tiny
refactoring.
(org-export-table-has-header-p): Fix cache use, i.e., no longer
re-compute return value when the table is already known to have no
header.
(org-export-table-row-group):
(org-export-table-row-number): Populate cache with all the rows
whenever a row is queried. This fixes previous quadratic behaviour.
Reported-by: Thierry Banel <tbanelwebmin@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/111131>
* lisp/ox-publish.el (org-publish-get-base-files): Make sure to remove
directories.
* testing/examples/pub/file.txt:
* testing/examples/pub/noextension: New files.
* testing/lisp/test-ox-publish.el (test-org-publish/base-extension):
New test.
* lisp/org-element.el (org-element-class): Make it a defsubst.
* lisp/org-table.el (orgtbl-to-generic): Do not use cache when
building Org table. Factor out calls to Org Export functions when
they are not necessary.
(org-table--to-generic-row): Factor out calls to Org Export functions
when they are not necessary.
* lisp/ox.el (org-export-resolve-fuzzy-link):
(org-export-table-has-header-p):
(org-export-table-row-group):
(org-export-table-cell-width):
(org-export-table-cell-alignment): Small refactoring.
(org-export-table-row-number): Add caching.
* testing/lisp/test-org-element.el (test-org-element/class): Remove
test.
* lisp/org.el (org-set-tags): Reveal newly inserted tags.
* testing/lisp/test-org.el (test-org/set-tags): New test.
Sometimes freshly added tags can be sucked into invisible outline
region (denoted by ellipsis) - and to see them you need to do the full
global visibilty cycle.
* lisp/org-list.el (org-list-to-generic): :istart, :icount, :iend
and :isep are now called with an additional argument, the type of the
list. Also add a new property :ifmt.
(org-list--to-generic-item): Use new property.
(org-list-to-subtree): Adapt to new requirements for :istart and :iend.
* testing/lisp/test-org-list.el (test-org-list/to-generic): Update
tests.
* lisp/ox.el (org-export-data-with-backend):
(org-export-with-backend): Preserve internal references once the local
back-end has been applied.
* testing/lisp/test-ox.el (test-org-export/get-reference): Add tests.
* lisp/org.el (org-set-emph-re): Refactor code. Rip "~" and "="
markers off `org-emph-re'.
(org-do-emphasis-faces):
(org-sort-remove-invisible): Handle both `org-emph-re' and
`org-verbatim-re'.
(org-in-verbatim-emphasis): Use `org-verbatim-re' instead of
`org-emph-re'.
* lisp/org-element.el (org-element-code-parser):
(org-element-verbatim-parser): Use `org-verbatim-re' instead of
`org-emph-re'.
* testing/lisp/test-org-element.el (test-org-element/bold-parser):
(test-org-element/code-parser):
(test-org-element/italic-parser):
(test-org-element/strike-through-parser):
(test-org-element/underline-parser):
(test-org-element/verbatim-parser): Update tests, which no longer need
to bind `org-emph-re'.
* lisp/ob-plantuml.el (org-babel-execute:plantuml) Include prologue and
header variables to temporary file body.
(org-babel-plantuml-make-body): New function.
(org-babel-variable-assignments:plantuml): New function.
* testing/lisp/test-ob-plantuml.el: New file.
* lisp/ob-tangle.el (org-babel-tangle-single-block):
`org-babel-expand-noweb-references' specifically needs to be run in
the Org document so as to resolve references.
* testing/lisp/test-ob-tangle.el (ob-tangle/continued-code-blocks-w-noweb-ref):
Make sure a failing test doesn't leave a file behind it.
* lisp/org.el (org-drag-element-backward):
(org-drag-element-forward): Check that org-element-at-point returns a
non-nil value to avoid a type-error when called before first element.
* testing/lisp/test-org.el (test-org/drag-element-backward):
(test-org/drag-element-forward): Add test for when point is before
first element. Adjust existing should-error calls to specify
user-error.
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
Use `expand-file-name' to prevent introducing "//" patterns in file
name.
Reported-by: David Talmage <david.talmage@shoutpoint.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110285>
* lisp/ob-exp.el (org-babel-exp-process-buffer): Change variable
name `org-export-babel-evaluate' to `org-export-use-babel'. Also
change the name in its `defcustom' and set the `:safe' key.
* lisp/ox-icalendar.el (org-icalendar-export-current-agenda): Change
variable name.
* lisp/ox.el (org-export-as): Change variable name.
* doc/org.texi (Exporting code blocks): Change variable name. Amplify
the explanation of what the variable does. Add variable index entry.
* testing/lisp/test-ob-exp.el: Change variable name.
* testing/lisp/test-ob-lob.el: Change variable name.
* testing/lisp/test-ox.el: Change variable name.
Users were often confused that setting this variable to `nil' will
cause header arguments to be ignored in addition to preventing code
from being evaluated. It is hoped that the documentation changes and
the name `org-export-use-babel' will better convey that everything
babel does can be switched off with this variable.
* lisp/ox.el (org-export-get-reference): Ensure different elements or
objects generating the same search cell do not get the same internal
reference.
* testing/lisp/test-ox.el (test-org-export/get-reference): Add test.
Reported-by: mstrey@strey.biz
<http://permalink.gmane.org/gmane.emacs.orgmode/110211>
* 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>
* lisp/ox.el (org-export-as): Skip planning info and first property
drawer when exporting a subtree.
* testing/lisp/test-ox.el (test-org-export/export-scope): Add test.
* lisp/org-element.el (org-element--current-element): Check that
planning info and property drawers are correctly located before
parsing them.
* testing/lisp/test-org-element.el (test-org-element/planning-parser):
(test-org-element/property-drawer-parser): Add tests.
* lisp/org.el (org-return): Recognize non-keywords and split text
accordingly.
* testing/lisp/test-org.el (test-org/return): Add test.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109929>
* lisp/org-clock.el (org-dblock-write:clocktable): Small refactoring.
(org-clocktable-write-default): Avoid writing a "File" column when using
`file-with-archives' scope instead of deleting it at the end of the
process.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Add test.
Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/109856>
* lisp/org-element.el (org-element--object-lex): Do not re-match past
1-character long radio links.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
test.
Reported-by: Daniel Clemente <n142857@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109861>
* lisp/org-element.el (org-element-class): New function.
(org-element-map):
(org-element-interpret-data):
* lisp/org-footnote.el (org-footnote--allow-reference-p):
* lisp/org-src.el (org-src--on-datum-p):
* lisp/ox-odt.el (org-odt-footnote-reference):
(org-odt-table-cell):
* lisp/ox.el (org-export-data):
(org-export-expand): Use new function.
* testing/lisp/test-org-element.el (test-org-element/class): New test.
Using generic `org-element-class' allows to handle unknown, i.e.,
pseudo, object or element types. It also reduces code duplication in
`org-element-interpret-data' and `org-export-data', preventing, e.g.,
bugs as the one fixed in c58e1b5.
* lisp/org-element.el (org-element-link-interpreter): % in description
are confused with format string placeholders. Escape them so as to
fix the error.
* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
Add test.
Reported-by: Daniel Clemente <n142857@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109878>
* lisp/org-element.el (org-element-interpret-data):
* lisp/ox.el (org-export-data): Correctly guess if a pseudo element or
object should be followed by spaces or blank lines.
* testing/lisp/test-ox.el (test-org-export/pseudo-objects):
(test-org-export/pseudo-elements): New tests.
* lisp/org-table.el (org-table-recalculate-buffer-tables): Align all
tables in a buffer.
(org-table-iterate-buffer-tables): Align a table only once, align all
tables in a buffer.
* lisp/org.el (org-beginning-of-line): Move to beginning of visual line
when appropriate. Fix docstring.
* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.
* lisp/org.el (org-end-of-line): Correctly go to the end of visible
line, when appropriate.
* testing/lisp/test-org.el (test-org/end-of-line): Add tests.
* lisp/org.el (org-beginning-of-line): Leave point before any invisible
character at column 0. Small refactoring.
* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.
The regression was introduced in
3baf246f4f.
* lisp/org-element.el (org-element-link-parser): Add :format property.
Tiny refactoring.
* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
Add one test. Update some others.
Since the link format is lost during parsing, the interpreter can hardly
handle nested links. Indeed, in that case, the inner link is
interpreted as a bracket link, thus breaking the outer link.
Another option could be to guess a safe format for the link to be
interpreted. E.g.,
- any inner link could default to angle format unless it contains ">",
it which case it would become a plain link;
- other links would have the bracket format, unless they contain "][" or
"]]".
In any case, defining :format is less error prone and is similar to what
entities and sub/super-scripts have for curly brackets.
Reported-by: Thibault Marin <thibault.marin@gmx.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109623>
* lisp/ob-core.el (org-babel--insert-results-keyword):
(org-babel-where-is-src-block-result): Control better the number of
empty lines around results of a source block evaluation.
* testing/lisp/test-ob.el (test-ob/blocks-with-spaces): Add tests.
(test-ob/specific-colnames): Fix test.
* lisp/org.el (org-align-tags-here): Renamed to...
(org--align-tags-here): ... this.
This change emphasizes the fact that, as an internal function, it
shouldn't be used without special care. This also prevents confusing
between this function and `org-set-tags' called with a non-nil ALIGN
argument.
* lisp/org.el (org-align-tags-here): Do not use `org-move-to-column',
which may move point on the other side of some invisible text.
Refactor code.
* testing/lisp/test-org.el (test-org/tag-align): Add test.
Reported-by: Michael Fiano <michael.fiano@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109435>
* lisp/org-table.el (org-table-insert-row): Fix inserting a new row when
the buffer doesn't end with a newline character. Tiny refactoring.
* testing/lisp/test-org-table.el (test-org-table/next-field): New test.
* testing/lisp/test-ob-maxima.el:
(ob-maxima/matrix-output): Remove filtering of informational output.
Credit to Leo Butler. From his post:
Since those informational messages are written to stdout, do
with_stdout("/dev/null", load(numericalio))$
write_data ....
to muffle the messages. Note that sbcl warnings are muffled by
:lisp (setf sb-ext::*muffled-warnings* 'warning)
* testing/lisp/test-ob-maxima.el (ob-maxima/matrix-output): Remove lines
starting with ";;" from the result of `org-babel-execute-src-block'.
This fix works around the occurance of lines like
;; loading #P"/home/b/.../numericalio/encode-decode-float.fasl"
in the output of maxima.
Maxima version: "5.38.1"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.3.6"
* lisp/org-clock.el (org-clock-sum): Fix infloop when first headline in
scope has a level strictly greater than 1.
Reported-by: Yichao Woo <wooyichao@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108606>
* lisp/org-src.el (org-src-coderef-regexp): A coderef label cannot be
consist of white spaces only.
* testing/lisp/test-org-src.el (test-org-src/coderef-regexp): Add test.
* lisp/org-src.el (org-src-coderef-format): New function
(org-src-coderef-regexp): Change signature.
* lisp/ob-core.el (org-babel--normalize-body):
* lisp/ox.el (org-export-unravel-code): Use new functions.
* testing/lisp/test-org-src.el (test-org-src/coderef-format): New test.
* lisp/ob-core.el (org-babel--normalize-body): New function.
(org-babel-get-src-block-info): Use new function.
* lisp/org-src.el (org-src-coderef-regexp): New function.
* lisp/ox.el (org-export-unravel-code): Use new function.
* testing/lisp/test-ob.el (test-ob/evaluate-body-with-coderefs): New
test.
* lisp/org.el (org-get-heading): Ensure that return value is always
a string.
* testing/lisp/test-org.el (test-org/get-heading): Add tests.
Reported-by: Joe Schafer <joesmoe10@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108559>
* lisp/org-table.el (org-table-eval-formula): Fix calculations with
locale specific time-stamps.
* testing/lisp/test-org-table.el (test-org-table/time-stamps): New test.
Reported-by: "Ulrich J. Herter" <ujh@posteo.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/108165>
* lisp/org-element.el: Replace `org-link-types' variable with
`org-link-types' function.
* lisp/org.el: Replace the `org-link-types' variable with
`org-link-types' function. Create `org-link-get-parameter' and
`org-link-set-parameters' functions. Remove `org-add-link-type'. Add
`org-store-link-functions' function and remove
`org-store-link-functions' variable. Add `org--open-file-link' for use
as a :follow function for file type links.
* lisp/org.el: Set :follow functions for file links in `org-link-parameters.
Define `org-open-file-link' that opens a file link with an app.
* testing/lisp/test-ox.el: Remove usage of the `org-link-types'
variable.
* lisp/org-compat.el: Move `org-add-link-type' and mark it as obsolete.
* lisp/ox.el: Change org-add-link-type comment in ox.el.
* lisp/org-compat.el (org-link-escape-browser): Make function an alias
for `url-encode-url'.
* lisp/org.el (org-link-escape-chars-browser): Remove variable.
(org-link-escape-browser): Remove function.
(org-open-at-point):
* lisp/ox-html.el (org-html-link): Use `url-encode-url'.
* testing/lisp/test-org.el(test-org/org-link-escape-chars-browser):
Remove test.
* lisp/ox.el (org-export--missing-definitions):
(org-export--install-footnote-definitions): New functions
(org-export--merge-external-footnote-definitions): Remove function
(org-export-as):
(org-export--prune-tree): Use new functions.
* testing/lisp/test-ox.el (test-org-export/footnotes): Add tests.
Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107940>
* testing/lisp/test-org-table.el:
(test-org-table/org-table-convert-refs-to-an/1):
(test-org-table/org-table-convert-refs-to-rc/1): Row and column number
different.
* lisp/ox.el (org-export-get-footnote-definition): When a definition is
empty, but does exist, return the empty string instead of raising an
error.
* testing/lisp/test-ox.el (test-org-export/get-footnote-definition): New
test.
Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107873>
* lisp/ob-lob.el (org-babel-default-lob-header-args): Merge value with
`org-babel-default-header-args' since this variable is meant to
replace the latter.
(org-babel-lob-ingest): Make sure `org-babel-default-lob-header-args' is
used instead of `org-babel-default-header-args'.
(org-babel-lob--src-info): New function.
(org-babel-lob-get-info): Use new function. Make return value
a replacement for `org-babel-get-src-block-info'.
(org-babel-lob-execute): Use `org-babel-execute-src-block' instead of
duplicating functionalities.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply changes to
`org-babel-lob-get-info' return value.
* testing/examples/ob-header-arg-defaults.org:
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line): Update tests.
The purpose of this commit is to make Babel calls more
predictable (e.g., wrt property inheritance) and to remove code
duplication. Also, Babel calls results are no longer treated as Emacs
Lisp values.
* lisp/ob-core.el (org-babel-goto-named-src-block): The user prompt
(i.e. `initial-input' arg of `completing-read') will be the name of
the results block, noweb reference, call reference, or symbol if
point is in such.
* testing/lisp/test-ob.el (test-ob/goto-named-src-block): Simulate
interactive use of `org-babel-goto-named-src-block'.
* lisp/org.el (org-insert-heading): Do not reveal gratuitously too much
context before inserting an item.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
Reported-by: Steinar Bang <sb@dod.no>
<http://permalink.gmane.org/gmane.emacs.orgmode/107665>
* lisp/org-element.el (org-element--parse-paired-brackets): New function.
(org-element-inline-babel-call-parser):
(org-element-inline-src-block-parser): Use new function.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add test.
Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107629>
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to
match all tags (and not just the last.)
* testing/lisp/test-org.el (test-org/tags-at): One test to cover the
issue.
* lisp/org.el (org-deadline-close): A timestamp is close if the days
between now and the timestamp are less then or equal to the days of
lead time.
* testing/lisp/test-org.el: Add tests for org-deadline-close.
* lisp/org.el (org-deadline-close): A timestamp is close if the days
between now and the timestamp are less then or equal to the days of
lead time.
* testing/lisp/test-org.el: Add tests for org-deadline-close.
* lisp/org.el (org-get-heading): Prevent removing false-positive TODO
keywords due to case-insensitivity.
* testing/lisp/test-org.el (test-org/get-heading): New test.
* lisp/ox.el (org-export-get-loc): Refactor code. Speed-up processing
when the element doesn't require line numbering.
* testing/lisp/test-ox.el (test-org-gen-loc-list): Reformat code.
* lisp/org-element.el (org-element-example-block-parser): Use cons cell
for :number-lines specifying offset in addition to type (new/continue).
('continue . offset) for :number-lines will add this offset count to
the last line number. ('new . offset) for :number-lines will reset the
line number counting starting at offset
(org-element-src-block-parser): same for SRC block as EXAMPLE block
* lisp/ox-html.el (org-html-format-code):
* lisp/ox-latex.el (org-latex-src-block):
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-resolve-coderef):
(org-export-get-loc):
(org-export-format-code-default):
* contrib/lisp/ox-groff.el (org-groff-src-block): Use new cons cell
for :number-lines.
* testing/lisp/test-ox.el (ert-deftest test-org-export/get-loc): Tests for
changes
(test-org-gen-loc-list): Helper function for `test-org-export/get-loc'.
* testing/lisp/test-org.el (test-org/open-at-point-in-keyword):
(test-org/open-at-point-in-property):
(test-org/open-at-point-in-comment):
(test-org/open-at-point/inline-image): Simplify tests so as to not rely
on info.
(test-org/open-at-point/info): Remove test as it fails on the build bot.
* lisp/org-clock.el (org-clock-drawer-name): When
`org-clock-into-drawer' is a number and `org-log-into-drawer' is t,
default to "LOGBOOK".
* testing/lisp/test-org-clock.el (test-org-clock/into-drawer):
(test-org-clock/drawer-name): New tests.
* lisp/org.el (org-occur): Fix infloop when regexp matches a single
char. Improve docstring.
(org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Match correct object since point may be at the
beginning of the next one.
* testing/lisp/test-org.el (test-org/occur): New test.
* lisp/org.el (org-flag-drawer): Do not require point to be at a drawer
in order to call the function with an optional argument.
* testing/lisp/test-org.el (test-org/flag-drawer): Narrow test.
* lisp/org.el (org-show-set-visibility): Always show point, even when it
is hidden in a block or a drawer.
* testing/lisp/test-org.el (test-org/show-set-visibility): Add tests.
Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106744>
* lisp/ob-exp.el (org-babel-exp-process-buffer): Handle
`org-export-babel-evaluate' handling.
(org-babel-exp-results): Ignore `org-export-babel-evaluate' since it is
handled as a higher level.
* lisp/ox.el (org-export-as): Allow to short-circuit babel evaluation if
`org-export-babel-evaluate' is nil.
* testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): New test.
Reported-by: Nicolas Richard <nrichard@ulb.ac.be>
<http://permalink.gmane.org/gmane.emacs.orgmode/106767>
* lisp/org.el (org-current-tag-alist): New variable.
(org-set-tags):
(org-global-tags-completion-table):
(org-agenda-prepare-buffers): Use new variable.
(org-set-regexps-and-options): Use new variable. Handle STARTUP early
so that "#+STARTUP: noptag" is taken into consideration.
* lisp/org-agenda.el (org-agenda-bulk-action): Use new variable.
* lisp/org-mobile.el (org-mobile-create-index-file): `org-tag-alist' is
no longer buffer-local.
* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
tests.
* lisp/org.el (org-tag-string-to-alist):
(org-tag-alist-to-string):
(org-tag-alist-to-groups): New functions.
(org-set-regexps-and-options): Use new functions.
(org--setup-process-tags): Remove function.
(org--setup-collect-keywords): Return tag groups as a string instead of
a list so as to be compatible with new functions.
* lisp/org-mobile.el (org-mobile-create-index-file): Use new functions.
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags): Use new
functions.
(pcomplete/org-mode/tag): Small refactoring.
* testing/lisp/test-org.el (test-org/tag-string-to-alist):
(test-org/tag-alist-to-string):
(test-org/tag-alist-to-groups): New tests.
* lisp/org.el (org--get-expected-indentation): Return correct columns
when at the end of an empty item.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
* lisp/ox.el (org-export-get-reference): Use randomly generated labels.
(org-export-new-reference):
(org-export-format-reference): New functions.
* testing/lisp/test-ox.el (test-org-export/get-reference): New test.
The new scheme is better when datum type cannot be known ahead of time
or when references are not created sequentially, e.g., during
a publishing process where a reference to a file can be require before
the file is published.
* lisp/org.el (org--get-outline-path-1): Replace links with their
description, or path, in addition to removing statistics cookies.
(org-get-outline-path): Add an optional argument to include current
headline in path.
(org-refile-get-targets): Make use of new argument. Remove call to
`org-link-display-format', which is now handled in
`org--get-outline-path-1'.
* testing/lisp/test-org.el (test-org/get-outline-path): Add tests.
Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105425>
* lisp/org.el (org--get-outline-path-1): Fix wrong type arrayp error
when trying to get the outline path of an empty headline.
* testing/lisp/test-org.el (test-org/get-outline-path): Add test.
Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105407>
* 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/ob-core.el (org-babel-where-is-src-block-result): Return nil when
anonymous results would be located outside of the container of the
source block.
* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): Add test.
Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105309>
* lisp/org.el (org-refile-get-targets): Fix bug when using
`org-refile-target-verify-function'. Improve speed.
(org-olpa): Remove variable.
(org-outline-path-cache): New variable.
(org--get-outline-path-1): New function.
(org-get-outline-path): Use new function. This fixes return value when
cache is used and calls are not in the same path.
* testing/lisp/test-org.el (test-org/get-outline-path): New test.
Reported-by: Florian Adamsky <fa-org-mode@haktar.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/104829>
* lisp/org.el (org--get-expected-indentation): Fix indentation bug.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
In the following document, the last line would be indented to "|"
- item
#+BEGIN_SRC emacs-lisp
(+ 1 1)
#+END_SRC
|
* 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-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.