* lisp/ox.el (org-export--populate-ignore-list): Ignore text before
first headline if an :export: tag (or a select tag) is found within
the buffer.
* testing/lisp/test-ox.el: Add tests.
* lisp/org-element.el (org-element-at-point): If point is at the end
of the buffer, and that buffer ends with a list, and there's no
final newline, return last element in last item instead of plain
list.
* testing/lisp/test-org-element.el: Add test.
This fix allows to fill correctly the following construct:
- Item with a very long line ending at the end of buffer.
* lisp/org-element.el (org-element-footnote-definition-parser): Fix
value for :contents-begin when first line of footnote definition is
empty besides the label.
* testing/lisp/test-org-element.el (test-org-element/footnote-definition-parser):
Add test.
* lisp/org-element.el (org-element-at-point): Return correct element
when point is on a blank line just below a headline.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-adaptive-fill-function): Do not handle
`adaptive-fill-regexp' in comments as the behaviour is not
satisfying.
* testing/lisp/test-org.el: Remove test.
* lisp/org-list.el (org-list-struct-apply-struct): Do not move item's
contents within a child above when repairing indentation.
* testing/lisp/test-org-list.el: Add tests.
* lisp/ox.el (org-export-collect-headlines): Do not build TOC for
headlines below H value.
* testing/lisp/test-ox.el: Add test.
Reported-by: Jambunathan K <kjambunathan@gmail.com>
* lisp/org-element.el (org-element-text-markup-successor,
org-element-latex-or-entity-successor,
org-element-export-snippet-successor,
org-element-footnote-reference-successor,
org-element-inline-babel-call-successor,
org-element-inline-src-block-successor,
org-element-line-break-successor, org-element-link-successor,
org-element-plain-link-successor, org-element-macro-successor,
org-element-radio-target-successor,
org-element-statistics-cookie-successor,
org-element-sub/superscript-successor,
org-element-table-cell-successor, org-element-target-successor,
org-element-timestamp-successor): Remove LIMIT argument.
(org-element--parse-objects, org-element--get-next-object-candidates):
Apply signature change to successors.
(org-element-context): Narrow buffer around object containers so
parsing of objects when using this function is done under the same
restrictions as in buffer parsing.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-adaptive-fill-function): Look for a fill prefix at
the beginning of the paragraph and subsquently on its second line
instead of the current line.
* testing/lisp/test-org.el: Add test
* lisp/ox.el (org-export-data-with-backend): Set temporary back-end as
the new back-end in local communication channel.
(org-export-filter-apply-functions): Handle corner case where back-end
is nil.
* testing/lisp/test-ox.el: Small refactoring.
* lisp/org.el (org-adaptive-fill-function, org-fill-paragraph): Add
support for `adaptive-fill-regexp' in paragraphs and comments.
* testing/lisp/test-org.el: Add tests.
* lisp/org-element.el (org-element-plain-list-parser): Fix infloop
when parsing a list at the end of buffer, if buffer doesn't end at
a line beginning.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-fill-paragraph): Use empty commented lines as
separators when filling comments. This mimics default behaviour
from "newcomment.el", which is not used in Org.
* testing/lisp/test-org.el: Add tests.
* lisp/org.el (org-fill-paragraph): Do not mix consecutive comments
when filling any of them.
* testing/lisp/test-org.el: Add test.
Thanks to Samuel Wales for reporting it.
* lisp/org-element.el (org-element-item-interpreter): Correctly
interpret back plain lists with "*" items. This fixes "This is not
a list" error returned in this case.
* testing/lisp/test-org-element.el: Add test.
* lisp/ox.el (org-export--registered-backends): Renamed from
`org-export-registered-backends'.
(org-export-invisible-backends): Removed variable.
(org-export-get-backend, org-export-get-all-transcoders
org-export-get-all-options, org-export-get-all-filters): New
functions. It replaces `org-export-backend-translate-table'.
(org-export-barf-if-invalid-backend, org-export-derived-backend-p,
org-export-define-backend, org-export-define-derived-backend):
Rewrite functions using new representation.
(org-export-backend-translate-table): Remove function.
(org-export-get-environment): Use new function.
(org-export--get-subtree-options, org-export--parse-option-keyword,
org-export--get-inbuffer-options, org-export--get-global-options,
org-export-to-buffer org-export-to-file, org-export-string-as
org-export-replace-region-by): Update docstring.
(org-export-data-with-translations): Remove function. Use
`org-export-data-with-backend' with a temporary back-end instead.
(org-export-data-with-backend, org-export-as): Reflect new definition
for back-ends.
(org-export--dispatch-action, org-export--dispatch-ui): Reflect new
definition for back-ends and variable removal. Refactoring.
(org-export-filter-apply-functions): Call functions with
current back-end's name, not full back-end.
* lisp/org.el (org-export-backends, org-create-formula--latex-header):
Use new structure and variables.
* testing/lisp/test-ox.el: Update tests.
This patch separates back-end definition from its registration. Thus,
it allows to use anonymous or unregistered back-ends.
* testing/examples/babel.org(use case of reading entry properties):
Adapt to use the new introduced #+NAME for src block calls.
* testing/lisp/test-ob-exp.el(ob-exp/use-case-of-reading-entry-properties):
Adapt to use the new introduced #+NAME for src block calls.
* lisp/ob-core.el (org-babel-execute-src-block): Ensure that the
location is set before anything else is done.
* lisp/ob-ref.el (org-babel-ref-parse): Evaluate Emacs Lisp values in
header arguments at the location of the original code block.
* testing/lisp/test-ob.el (test-ob/location-of-header-arg-eval): Test
defending the new header argument evaluation behavior.
* lisp/org-element.el (org-element--current-element): Fix
org-meta-return error at the end of buffer.
* testing/lisp/test-org-element.el: Add test.
Thanks to Nicolas Richard for reporting this.
* lisp/org-element.el (org-element-special-block-parser): Fix typo in
regexp matching block type. Also quote the type so it can contain
special characters.
* testing/lisp/test-org-element.el: Add test.
* testing/examples/babel.org: Quote :shebang header argument.
2a73e06 introduced a new behaviour for org-babel-read and values
starting with "#" must now be quoted.
* lisp/ob-fortran.el: add a branch which handles nested lists
* testing/examples/ob-fortran-test.org: add a test for matrix input
* testing/lisp/test-ob-fortran.el: add a test for matrix input
* testing/org-test.el: Conditionalize interactive setup on
bound-and-true `org-batch-test'. (org-id-locations-file): New
defvar. (org-test-run-batch-tests): Use `org-id-locations-file'
defined before and add optional argument `org-test-selector' to
control which tests to run.
This change introduces ability to select the tests to run for batch
testing and removes several dependencies not needed during batch test
when `org-batch-test' is defined in preparation for a corresponding
change in how the build system invokes batch testing. Full backward
compatibility is maintained.
* lisp/org-element.el (org-element--remove-indentation): New function.
(org-element-example-block-parser, org-element-src-block-parser): Use
new function.
(org-element-src-block-interpreter): Update function according to
change.
* lisp/ox.el (org-export-unravel-code): Do not remove any indentation
since it now happens at the parser level.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-ox.el: Refactor tests.
* lisp/ox.el (org-export-options-alist): Change default value
for :title property.
(org-export--default-title): New dynamically scoped variable.
(org-export-store-default-title): New function.
(org-export--get-buffer-attributes): Remove title handling.
(org-export--get-global-options): Revert "ox: Fix default
title" (16f12e0aef). Refactor code.
* testing/lisp/test-ox.el: Update a test.
* lisp/org-element.el (org-element--current-element): Be stricter when
matching arguments in LaTeX environments. In particular, do not
allow anything else than options and arguments in the opening line.
* testing/lisp/test-org-element.el: Add tests.
* lisp/ox.el (org-export--get-global-options): Properly set default
title, i.e. when to TITLE keyword is provided.
* testing/lisp/test-ox.el: Add tests.
Escape double quotes in URL passed to browse-url
* lisp/org.el (org-link-escape-chars-browser): Add char double quote.
* lisp/org.el (org-open-at-point): Make use of the constant
`org-link-escape-chars-browser'.
* testing/lisp/test-org.el
(test-org/org-link-unescape-ascii-extended-char): Fill paragraph.
(test-org/org-link-escape-url-with-escaped-char): Fill paragraph and
typo.
(test-org/org-link-escape-chars-browser): New test.
This is to make work to open the Org link
[[http://some.host.com/search?q="Org mode"]] in a browser.
From 28726bcc7b7c440d70e2d95ea5a61d0cd5f084ea Mon Sep 17 00:00:00 2001
From: Michael Brand <michael.ch.brand@gmail.com>
Date: Sun, 5 May 2013 17:02:18 +0200
Subject: [PATCH] Escape double quotes in URL passed to browse-url
* lisp/org.el (org-link-escape-chars-browser): Add char double quote.
* lisp/org.el (org-open-at-point): Make use of the constant
`org-link-escape-chars-browser'.
* testing/lisp/test-org.el
(test-org/org-link-unescape-ascii-extended-char): Fill paragraph.
(test-org/org-link-escape-url-with-escaped-char): Fill paragraph and
typo.
(test-org/org-link-escape-chars-browser): New test.
This is to make work to open the Org link
[[http://some.host.com/search?q="Org mode"]] in a browser.
* lisp/org-element.el (org-element--current-element): Allow the
opening string of a LaTeX environment to contain additional
arguments.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-table.el (org-table-get-remote-range): Extend regexp to
match "#+NAME: table" additionally to "#+TBLNAME: table".
* testing/lisp/test-org-table.el: Add test.
* testing/org-test.el (org-test-table-target-expect): Allow several
tables to support testing remote references in the last table.
* lisp/org.el (org-fill-paragraph): Move to table beginning before
aligning the table when M-q is called from an affiliated keyword.
* testing/lisp/test-org.el: Add test.
* lisp/org-element.el (org-element-fixed-width-interpreter): Fix
interpretation of fixed-width elements with a nil or empty string
value.
* testing/lisp/test-org-element.el: Add tests.
* lisp/ox.el (org-export--skip-p, org-export--interpret-p): When
`org-export-with-footnotes' is nil, ignore completely footnotes
references and definitions instead of exporting them verbatim.
* testing/lisp/test-ox.el: Add tests.
* lisp/ox.el (org-export-with-timestamps): Only applies to isolated
timestamps, i.e. timestamps in a paragraph containing only
timestamps and empty strings.
(org-export--skip-p): Skip timestamps according to new behaviour.
* testing/lisp/test-ox.el: Update tests.
* doc/org.texi (Formula syntax for Calc): Improve the documentation of
empty fields in formulas for spreadsheet.
* testing/lisp/test-org-table.el: Rename wrongly named functions.
* testing/lisp/test-org-table.el: Use the more obvious "==" instead of
"=" for Calc conditions.
* testing/lisp/test-org-table.el (test-org-table/empty-field): Improve
the examples for vmean with empty fields.
(org-table-make-reference): A range with only empty fields should lead
to length 0.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.
The range len bugs may lead to wrong calculations for range references
with empty fields when the range len is relevant. Affects typically
Calc vmean on simple range and without format specifier EN. Also
Lisp with e. g. `length' on simple range or with L.
It is worth a small compatibility change: For a range with only empty
fields it is now possible and necessary to choose different behaviors
of vmean by adding the format specifiers E and/or N.
This is a follow-up of commit
764315b3fc.
* testing/lisp/test-ob-fortran.el (ob-fortran/character-var):
Uncomment test that formerly failed.
This test seems to be working correctly on Linux and Cygwin.
Re-enable to see if it may not work on other systems and then check
why.
testing/lisp/test-ob-perl.el (test-ob-perl/table-passthrough-colnames-nil),
(test-ob-perl/table-passthrough-colnames-no):
Make some table entries numbers for better test coverage.
* org-table.el (org-calc-current-TBLFM): Ensure to remove the
currently inserted TBLFM line, when calling `org-table-recalculate'
returns an error and the processing stops.
* testing/lisp/test-org-table.el: Add test.
When you hit =C-c C-c= at the line of "#+TBLFM: $2=$1*2::$2=$1**2" in
| 1 | |
| 2 | |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
you got:
| 1 | |
| 2 | |
#+TBLFM: $2=$1*2::$2=$1**2
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
with the error message of:
user-error: Double definition `$2=' in TBLFM line, please fix by hand
In this case, you expected:
| 1 | |
| 2 | |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
* org-table.el (org-calc-current-TBLFM): New function to
re-calculate the table by applying the #+TBLFM in the line
where the point is.
* org.el (org-ctrl-c-ctrl-c): Call `org-calc-current-TBLFM' when
point is in the #+TBLFM line.
* testing/lisp/test-org-table.el: Add test.
* lisp/org.el (org-store-link, org-link-search, org-options-keywords):
Remove reference to TARGET keyword.
* lisp/ox.el (org-export-resolve-fuzzy-link, org-export-get-ordinal):
Do not use TARGET as a destination for links anymore.
* testing/lisp/test-ox.el: Update tests.
* testing/lisp/test-org.el: Update tests.
Its specifications were not useful enough to keep maintaining this
feature.
* lisp/org-macro.el (org-macro--collect-macros): Fix a bug where
reading a macro in a setup file would remove other macros read so
far from template. Change function signature.
(org-macro-initialize-templates): Apply signature change from function
above.
* testing/lisp/test-org-macro.el: Add test.
* lisp/ox.el (org-export--list-bound-variables): Renamed from
`org-export--install-letbind-maybe'. Though, only return list of
bound variables instead of installing them as buffer-local
variables.
(org-export-get-environment): Use new function. Take care of the
installation of bound variables.
(org-export--generate-copy-script): Make sure non-Org variables are
also installed in buffer copy.
* testing/lisp/test-ox.el: Add test.
* lisp/ox.el (org-export-data): White spaces after export snippets are
never ignored.
* testing/lisp/test-ox.el: Add test.
Back-end developers should pay attention to the fact that white spaces
before and after an ignored export snippet now are accumulated in the
output.
* lisp/org-element.el (org-element-macro-parser): Allow to escape
escaping character before a comma. Also do not trim spaces at
argument boundaries.
* doc/org.texi (Macro replacement): Update documentation about
possible locations and escaping mechanism.
* testing/lisp/test-org-element.el: Add tests.
With this patch, macro's arguments are read as the following:
"a,b" -> '("a" "b")
"a\,b" -> '("a,b")
"a\\,b" -> '("a\" "b")
"a\\\,b" -> '("a\,b")
"a\\\\,b" -> '(a"\\" "b")
Note that with the patch, you only need to escape backslashes before
a comma:
"a\\b\,c" -> '("a\\b,c")
* testing/examples/open-at-point.org: new file.
* testing/lisp/test-org-open-at-point.el: new file.
This tests only the function when inside or before bracket links
and plain links.
These tests fail when run in batch mode:
`test-org-export/define-derived-backend'
`test-org-export/derived-backend-p'
They don't fail when run interactively.
Let's comment them out until we understand
what's wrong with these tests.
* lisp/ox.el (org-export-read-attribute): Do not use `read' to read
attributes. Instead, extract keywords and values from it, which
means each value will be a string when non-nil.
* contrib/lisp/ox-groff.el (org-groff-link--inline-image): Use new
attribute syntax. Small refactoring.
* lisp/ox-ascii.el (org-ascii-horizontal-rule): Use new attribute
syntax.
* lisp/ox-beamer.el (org-beamer-plain-list): Use new attribute syntax.
* lisp/ox-html.el (org-html--textarea-block): Use new attribute
syntax.
* lisp/ox-latex.el (org-latex--inline-image, org-latex--org-table,
org-latex--math-table): Use new attribute syntax.
* lisp/ox-man.el (org-man-table--org-table): Use new attribute syntax.
Small refactoring.
* lisp/ox-odt.el (org-odt-link--inline-image, org-odt-table-cell): Use
new attribute syntax.
* testing/lisp/test-ox.el: Add tests.
This patch introduces two changes. To begin with, it removes the need
for quoting and escaping characters. Also, all non-nil values are
stored as strings. As an exception "nil" is stored as nil.
* lisp/org-list.el (org-list-send-list): Do not rely on
`org-list-parse-list'.
(org-list-to-latex, org-list-to-html, org-list-to-texinfo): Use
appropriate export back-end instead of using `org-list-to-generic'.
* testing/lisp/test-org-list.el: Add tests.
* lisp/ox.el (org-export--selected-trees): Also mark inlinetasks with
a select tag.
(org-export--skip-p): Skip inlinetasks with a :noexport: tag.
* testing/lisp/test-ox.el: Add tests.
* lisp/ox.el (org-export-get-previous-element): Change order of
retured elements in `org-export-get-previous-element'.
* testing/lisp/test-ox.el: Update test.
* lisp/org-element.el (org-element-all-successors): Add `plain-link'
successor.
(org-element-object-restrictions): Remove `link' within `link'. Allow
`plain-link' instead.
(org-element-plain-link-successor): New function.
* testing/lisp/test-org-element.el: Add test.
Plain links within links are needed for the following kind of syntax:
[[http://orgmode.org][file:unicorn.png]]
No other link type is allowed within links.
* lisp/org.el (org-match-substring-regexp,
org-match-substring-with-braces-regexp): Update regexp.
A sub/superscript cannot start anymore at the beginning of the line
or after a space.
* lisp/org-element.el (org-element-footnote-definition-parser):
Require 2 blank lines to separate footnote definition.
* lisp/org-footnote.el (org-footnote-at-definition-p): Require 2 blank
lines to separate footnote definition.
* doc/org.texi: Update documentation for footnotes.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-footnote.el: Add tests.
Footnote definitions can still be separated with other footnote
definitions and headlines. This change allows to have multiple
paragraphs in a footnote definition without resorting to the "\par"
trick.
* lisp/ox.el (org-export-get-optional-title): Return regular title
when no optional title is found.
* lisp/ox-ascii.el (org-ascii--build-title): Apply change to
`org-export-get-optional-title'.
* lisp/ox-html.el (org-html--format-toc-headline): Apply change to
`org-export-get-optional-title'.
* lisp/ox-latex.el (org-latex-headline): Apply change to
`org-export-get-optional-title'.
* testing/lisp/test-ox.el: Add tests.
* lisp/ox.el (org-export-resolve-fuzzy-link): Whitespaces are not
significant when matching a fuzzy link.
* lisp/org-element.el (org-element-link-parser): Do not remove
newlines characters in paths anymore, since this is not required.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-ox.el: Add test.
* lisp/ox.el (org-export-output-file-name): Add a protection when
output file name is the same as the original org.
* testing/lisp/test-ox.el: Add tests.
* lisp/ox.el (org-export--collect-headline-numbering): Remove footnote
section from TOC.
(org-export-collect-headlines): Do not count footnote section when
numbering a headline.
* testing/lisp/test-ox.el: Add tests.
* lisp/ox.el (org-export-as): Call `inner-template' function, if
available.
* lisp/ox-html.el (org-html-inner-template): New function.
(org-html-template): Move all parts that should be inserted even in
a body-only export into `org-html-inner-template'.
* testing/lisp/test-ox.el: Add tests.
* lisp/org-element.el (org-element--current-element): Add a limit
argument.
(org-element--collect-affiliated-keywords): Fix parsing of orphaned
keyword at the end of an element.
* testing/lisp/test-org-element.el: Add test.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Renamed from
`org-export-blocks-preprocess'.
* lisp/ox.el (org-export-execute-babel-code): Apply previous renaming.
* testing/org-test.el (org-test-at-id): Make sure the function returns
the value of the last form in its body.
* testing/lisp/test-ob-exp.el: Fix tests.
* testing/lisp/test-ob-lob.el: Fix tests.
* lisp/org-element.el (org-element-macro-parser): Fix error when last
argument ends with a protected comma.
* testing/lisp/test-org-element.el (test-org-element/macro-parser):
Add tests.
* contrib/lisp/org-export.el (org-export-get-footnote-definition):
Provide a fallback definition when none can be found.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference): Revert
change made in 30ef385ee0 since it is
now handled at the export framework level.
* testing/lisp/test-org-export.el: Add test.