* lisp/org-agenda.el (org-agenda--quit): Fix changes introduced by
9b1c682 and 8594aed that incorrectly assume that the agenda buffer is
always the current buffer at the time of killing or burying.
Reported-by: David Mann <manndmd@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103791>
* lisp/org-footnote.el (org-footnote--collect-references): Include
inline references at the beginning of the line, which are allowed,
unlike regular references.
* lisp/org-footnote.el (org-footnote-re):
(org-footnote-definition-re): Do not match [1]-like constructs.
(org-footnote): Fix typo.
(org-footnote-auto-label): Do not offer to create [1]-like constructs
anymore.
(org-footnote-new): Remove reference to obsolete value in
`org-footnote-auto-label'.
(org-footnote-at-reference-p):
(org-footnote-get-next-reference):
(org-footnote-next-reference-or-definition):
(org-footnote-goto-definition):
(org-footnote-goto-previous-reference): Use new regexp.
(org-footnote-normalize-label): Remove "fn:" prefix instead of adding
it.
(org-footnote-get-definition):
(org-footnote-all-labels):
(org-footnote-unique-label): Small refactoring.
(org-footnote-create-definition):
(org-footnote-delete-definitions):
(org-footnote--clear-footnote-section):
(org-footnote--collect-references):
(org-footnote--collect-definitions):
(org-footnote--set-label):
(org-footnote-sort): New functions.
(org-footnote-auto-adjust-maybe):
(org-footnote-action): Use new functions. Small refactoring.
(org-footnote-renumber-fn:N): Refactor code. Handle nested footnotes.
(org-footnote-normalize): Turn footnotes into [fn:N] construct instead
of [N].
* testing/lisp/test-org-footnote.el (test-org-footnote/delete):
(test-org-footnote/goto-definition):
(test-org-footnote/normalize): Update test
(test-org-footnote/sort):
(test-org-footnote/renumber-fn:N): New tests.
(test-org-footnote/normalize-outside-org): Remove test.
* lisp/org-element.el (org-element--set-regexps):
(org-element-footnote-definition-interpreter):
(org-element-footnote-reference-parser):
(org-element-footnote-reference-interpreter): Do not consider [1]-like
constructs as footnotes anymore.
* lisp/ox.el (org-export-expand-include-keyword):
(org-export--prepare-file-contents): Apply changes to footnotes.
* doc/org.texi (Footnotes): Remove references to plain footnotes.
* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
(test-org-element/footnote-reference-interpreter):
* testing/lisp/test-ox.el (test-org-export/expand-include):
(test-org-export/expand-macro):
(test-org-export/get-footnote-number):
(test-org-export/collect-footnote-definitions):
(test-org-export/footnotes):
(test-org-export/fuzzy-link): Update tests.
Since it is possible to refer unambiguously to a label without the "fn:"
prefix, the latter becomes part of the syntax and no longer part of the
label. In particular [fn:1] and [fn:label] are labelled, respectively,
"1" and "label".
* lisp/org-protocol.el: Update documentation.
(org-protocol-store-link, org-protocol-capture,
org-protocol-open-source): Accept new-style links.
(org-protocol-check-filename-for-protocol): Update documentation.
(org-protocol-parse-parameters, org-protocol-assign-parameters):
New functions.
This allows the use of org-protocol on KDE 5 and makes org-protocol
links more URI-like. New-style links are of the form:
org-protocol://store-link?title=TITLE&url=URL
* testing/lisp/test-org-protocol.el: New file.
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.
* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.
* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".
* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.
* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks. Remove
back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.
* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
forbidden blocks. Remove back-ends blocks, which are now special
blocks.
* contrib/lisp/ox-extra.el: Update comments.
* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.
Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks. The new syntax is
#+BEGIN_EXPORT backend
...
#+END_EXPORT
instead of
#+BEGIN_backend
...
#+END_backend
As a consequence, =INCLUDE= keywords syntax is modified, e.g.,
#+INCLUDE: "file.org" HTML
becomes
#+INCLUDE: "file.org" export html
* lisp/ob-sql.el: Add a database type 'oracle that uses sqlplus to
support running SQL blocks against an Oracle database.
Use with properties like this (all mandatory):
:engine oracle :dbhost <host.com> :dbport <1521> :dbuser <username>
:database <database> :dbpassword <secret>
TINYCHANGE
* lisp/org-table.el (org-table-recalculate): Expand "$<" without
returning an error. Small refactoring.
* testing/lisp/test-org-table.el (test-org-table/first-rc): New test.
Reported-by: Stefan Nobis <stefan-ml@snobis.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103693>
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions):
* lisp/ox.el (org-export--selected-trees):
(org-export--prune-tree):
(org-export--merge-external-footnote-definitions):
(org-export--footnote-reference-map): Provide nil value for binders.
Using
(letrec ((SYMBOL)) ...)
to bind SYMBOL to nil relies on (setq SYMBOL) setting SYMBOL to nil. As
of 5d93a89 (Byte compiler: on setq with an odd number of arguments,
generate a `signal', 2015-11-26) in the Emacs repo, setq signals an
error when given an odd number of arguments.
Reported-by: Zack Piper <zack@apertron.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103539>
<http://permalink.gmane.org/gmane.emacs.devel/196182>
* lisp/org.el (org-unique-local-variables): New variable.
(org-get-local-variables):
(org-clone-local-variables): Use variable above. Do not rely on an
obscure naming convention to determine if a local variable is meant to
be cloned or read.
* lisp/org.el (org-mode): `org-startup-truncated' and
`org-startup-indented' are expected to have an effect only when
`org-inhibit-startup' is non-nil.
* lisp/org-capture.el (org-capture-steal-local-variables): Remove function.
(org-capture-fill-template): Apply removal. Use
`org-clone-local-variables' instead. Focus on Org specific variables.
* lisp/org.el (org-get-local-variables):
(org-clone-local-variables): Ignore internal local variables, whose
value is probably tied to their respective buffer. In particular, this
prevents cache related variables from being copied.
* lisp/org-indent.el (org-indent--initial-marker): Renamed from
`org-indent-initial-marker'. Marking it as internal prevents it from
being copied by `org-clone-local-variables' and alike.
(org-indent-mode):
(org-indent-initialize-buffer): Apply renaming.
* lisp/org-capture.el (org-capture-is-refiling): New variable.
(org-capture-place-template): Silence byte-compiler.
* lisp/org.el (org-refile): Use new variable.
* lisp/org-table.el (org-table-eval-formula): Properly parse named
fields when indentation of current line ends with a TAB character.
* testing/lisp/test-org-table.el (test-org-table/tab-indent): New test.
Reported-by: Piotr Gajewski <pg7@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103290>
* org-inlinetask.el(org-inlinetask-goto-end): Position point just at the
end. Do not forward-line.
Fixes org-cycle for state CHILDREN when the children are inlinetasks
which have immediate neigbors.
* lisp/org-capture.el (org-capture-templates): Update docstring.
(org-capture-fill-template): Expand interactive placeholders when the
template is otherwise completely filled.
This restores the previous behaviour for template's expansion.
* lisp/org-capture.el (org-capture-fill-template): Allow more than one
word when filling %{prompt} place holders.
Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/103251>
* lisp/ox-html.el (org-html-template): Add lang attribute to exported
html tag. Some features of the CSS Text Module (Level 3) require this
attribute to be present (for example, so that the browser knows how to
hyphenate the text). For more info, please take a look here:
https://drafts.csswg.org/css-text-3/#languages
TINYCHANGE
* lisp/ox-html.el: Remove superfluous whitespace from meta tags, put
there by `org-html--buld-meta-info' and `org-html--build-head'.
`org-html-close-tag' already inserts a space, so it is not necessary
to add another. Previously these affected tags would look like
<meta name="generator" content="Org-mode" />.
TINYCHANGE
* ox-latex.el (org-latex-custom-lang-environments): Extend the
documentation string.
* ox-latex.el (org-latex-src-block): Allow a custom language environment
to be a format string to be directly inserted.
* lisp/org-capture.el (org-capture-templates): Improve docstring.
(org-capture-fill-template): Prevent recursive evaluation of %(...)
placeholders. Fix escaping of % character in templates.
* testing/lisp/test-org-capture.el: New file.
Reported-by: Thomas Preindl <thomas.preindl@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103018>
* lisp/org-agenda.el (org-agenda-write): Fix arguments passed to
`org-agenda-remove-marked-text' to properly remove entries with
`invisible' property set to `org-filtered'.
* lisp/ox-icalendar.el (org-icalendar-export-current-agenda): Always
include TODO entries in the output. The motivation is that a user not
filtering out TODO or DONE items in the current agenda probably wants
them in the output.
Reported-by: "sgeorgii ." <sgeorgii@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102998>
* lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): Deal with
the case when the user provided an empty string to filter or exclude
rows from the agenda.
This is done in order to fix a problem reported in emacs-orgmode mailing
list 2015-11-25 02:50 with subject "[O] [RFC] [PATCH] Changes to Tag
groups - allow nesting and regexps".
* lisp/org-table.el (org-table-get-formula):
(org-table-store-formulas): Column formulas references are stored along
with their dollar-sign since "Fix `org-table-get-range' with column
formulas". Update functions accordingly.
Reported-by: John Hendy <jw.hendy@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103056>
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Ignore
any link search suffix on an include so that the path represents
a valid file during the publishing check.
TINYCHANGE
* lisp/org-colview.el (org-columns-capture-view): Obey to
skip-empty-rows even when "ITEM" doesn't belong to current title.
Reported-by: Joon Ro <joon.ro@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102924>
* lisp/ox.el (org-export--delete-comments): Preserve document's
structure when removing comment lines or comment blocks.
* testing/lisp/test-ox.el (test-org-export/comments): New test.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102860>
* lisp/org-table.el (org-table-analyze): Fix incorrect replacement for
"$>" reference when the table ends on a hline.
* testing/lisp/test-org-table.el (test-org-table/end-on-hline): New
test.
* lisp/org-src.el (org-edit-inline-src-code): New function.
(org-src--contents-area): Handle inline src blocks.
* lisp/org.el (org-edit-special): When on an inline src block, edit it.
* lisp/org-list.el (org-list-parse-list): Use `letrec'.
(org-list-to-generic): Do not allow random sexp, but authorize functions.
(org-list-to-subtree): Apply change to previous function.
Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102651>
* lisp/ox-publish.el (org-publish-compare-directory-files):
(org-publish-get-base-files-1):
(org-publish-get-base-files):
(org-publish-index-generate-theindex):
(org-publish--collect-references):
(org-publish-resolve-external-link): Prefix functions from cl-lib with
"cl-" or replace `case' with `pcase'.
* lisp/ob-R.el (org-babel-R-evaluate-session) should find prompts more
reliably. First, the regular expression used requires spacing
between and after instances of `[>+.]'. Also, the search terminates
at the first `\n', so complicated results with prompt like strings
in them are not deleted.
Prompt finding is necessarily heuristic. It may be necessary to render
the regular expression with a defcustom as is done in ess-mode.
* lisp/org-lint.el (org-lint-wrong-header-value): Don’t call
`org-babel-process-params'.
This function adds generated values to the header args: it’s never a
user error if these are incorrect. It also calls babel code to resolve
:var references, which makes linting an undesirably long and potentially
side-effectful operation.
* lisp/ox-latex.el (org-latex-latex-fragment): Since $$..$$ snippets are
not wrapped within a math-block, do not remove markers.
(org-latex--wrap-latex-math-block): Do not wrap $$...$$ LaTeX snippets.
* lisp/ox-ascii.el (org-ascii-inner-template): Since 47265b3, footnotes
definitions' contents do no start with `org-data'. Update code.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102648>
* lisp/org.el (org-self-insert-command): Do not call
`backward-delete-char' since it possibly deletes active region.
Simplify code.
This fixes bug#21838.
* lisp/ob-core.el (org-babel-check-confirm-evaluate): Convert from macro
to function.
(org-babel-check-evaluate):
(org-babel-confirm-evaluate): Adapt to above change. Convert from
defsubst to defun.
* testing/lisp/test-ob.el (ob/check-eval) New test.
(org-test-babel-confirm-evaluate): New function supporting it.
* lisp/ob-core.el (org-babel-read-element): New function.
* lisp/ob-ref.el (org-babel-ref-resolve): Use new function. Refactor
code.
(org-babel-ref-at-ref-p): Remove function.
* testing/lisp/test-ob.el (test-ob/ignore-reference-in-commented-headings):
New test.
* testing/lisp/test-ob.el (test-ob/resolve-code-blocks-before-data-blocks):
Remove test
The second test is removed because names are expected to be unique.
There is no order to expect when more than one uses the same name.
Reported-by: myq <myqlarson@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102464>
* lisp/ox.el (org-export-get-environment): Do not handle :back-end
and :translate-alist.
(org-export--collect-tree-properties): Do not handle :exported-data.
(org-export--get-export-attributes): New function.
(org-export-as): Use new function.
* testing/lisp/test-ox.el (org-test-with-parsed-data): Use new function.
* lisp/ox.el (org-export-get-environment): Do not fill :id-alist yet.
(org-export-collect-tree-properties): Complete it here instead.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102540>
* lisp/org-agenda.el (org-agenda--timestamp-to-absolute): New function.
(org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled): Use new function.
* lisp/org.el (org-diary-sexp-no-match): New error.
(org-time-string-to-absolute): Raise an error when a diary sexp cannot
match instead of returning a nonsensical value.
Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102417>
* lisp/org.el (org-format-outline-path): Ignore nil path elements.
* testing/lisp/test-org.el (test-org/format-outline-path): Add test.
The PATH argument shouldn't contain a nil item. However, this didn't
fail before 1c74002, and helm-get-org-candidates-in-file relies on this
behavior, so prevent it from failing now.
Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102411>
* lisp/org.el (org-format-outline-path): Change loop counter.
The old version gives the same result when combined with the other for
clause, but it reads as though the intention is to reach
(length path) rather than (1- (length path)).
* lisp/org-agenda.el (org-agenda-get-day-entries): Rewrite function to
avoid O(n^2) complexity. Also fix empty deadline list passed as
argument when :deadline (or :deadline*) is not the first symbol.
* lisp/org.el (org-format-outline-path): Avoid out-of-range error when
the length of PREFIX is greater than the value given for WIDTH.
Prevent result from extending beyond WIDTH. Simplify code.
* testing/lisp/test-org.el (test-org/format-outline-path): Add tests.
Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102241>
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): When closest scheduled/deadline date is
today, also report all days since original timestamp.
* lisp/org.el (org-emphasis-regexp-components): Allow singe quote,
double quote and comma as the last character in an emphasis string.
Reported-by: Marcin Borkowski <mbork@mbork.pl>
<http://permalink.gmane.org/gmane.emacs.orgmode/102191>
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): For past repeaters, compute the number of
scheduled or deadline days since original date, not closest repeater.
Suggested-by: cesar mena <cmena@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101884>
* lisp/org.el (org-return): Properly follow links when description is
emphasized. Also tolerate links and timestamps in otherwise forbidden
areas (e.g., comments, node properties...), much like
`org-open-at-point'.
* testing/lisp/test-org.el (test-org/return): Add tests.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101977>
* lisp/org-clock.el (org-clock-find-position): Create clock drawer when
a drawer is missing, even though requested, but some clocks are
already present in the entry.
Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101973>
* lisp/ox.el (org-export-with-broken-links): New variable.
(org-export-options-alist): Add new OPTIONS item.
(org-link-broken): New error type.
(org-export-resolve-coderef):
(org-export-resolve-fuzzy-link):
(org-export-resolve-id-link): Raise appropriate error symbol when a link
cannot be resolved.
(org-export-data): Handle new error type.
* doc/org.texi (Export settings): Document new feature.
* testing/lisp/test-ox.el (test-org-export/resolve-id-link):
(test-org-export/resolve-fuzzy-link):
(test-org-export/resolve-coderef): Update tests.
* lisp/org-element.el (org-element--next-mode): Line following an
inlinetask can be a planning.
* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
Update test.
Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/101958>
* lisp/ox-beamer.el (org-beamer--get-label): Remove protective braces
when extracting label from options.
(org-beamer--format-frame): Protect label with braces if it contains
colons.
Based off a patch from Fabrice
Popineau (<http://permalink.gmane.org/gmane.emacs.orgmode/101933>).
* lisp/org.el (org-closest-date): Rewrite function with less arguments.
Improve readability.
(org-time-string-to-absolute): Apply changes to `org-closest-date'.
Improve docstring.
* testing/lisp/test-org.el (test-org/closest-date): New test.
This change implies specific repeaters (i.e., ".+" and "++") are no
longer treated the same as regular one (i.e. "+") wrt
`org-agenda-repeating-timestamp-show-all'. Indeed, only the latter
represents multiple dates. The former represent another date only when
TODO state changes, which could then skip some occurrences.
This fixes issue raised at
<http://permalink.gmane.org/gmane.emacs.orgmode/101884> and
<http://article.gmane.org/gmane.emacs.orgmode/26154>.
* org-capture.el (org-capture-refile): Call finalize first, then
refile. If the capture buffer needs to be killed afterwards, kill
after refiling.
Refiling before finalizing led to an incorrect cursor position during
refile. Since adjusting the buffer position and bounds for the refiled
entry is difficult, I reverted the `org-capture-refile' function to its
original order of finalizing and then refiling. However, this leads to
a bug with killing the buffer on capture, described in
<http://permalink.gmane.org/gmane.emacs.orgmode/78027/>. To work around
this, now the :kill-buffer flag is cleared before calling finalize, and
the capture buffer is killed after `org-refile' is called.
TINYCHANGE
* lisp/ox-publish.el (org-publish-projects): Call preparation function
earlier in the process, before files constituting the project are
collected.
Suggested-by: Arun Isaac <theroarofthedragon@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101858>
* lisp/org-src.el (org-edit-src-code): Always preserve tabs not related
to indentation.
* testing/lisp/test-org-src.el (test-org-src/preserve-tabs): New test.
* lisp/org-element.el (org-element-remove-indentation): Mark as
an obsolete replacement for `org-remove-indentation'.
(org-element-example-block-parser):
(org-element-example-block-interpreter):
(org-element-src-block-parser):
* lisp/ox.el (org-export-unravel-code): Apply obsolescence.
* lisp/org.el (org-remove-indentation):
(org-do-remove-indentation): Change algorithm so as not to untabify
string or buffer.
Only <tab> characters used for indentation may be removed.
Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/101768>
* ox-latex.el (org-latex--make-preamble): Renamed
org-latex--make-header.
(org-latex--insert-compiler): New function.
(org-latex-template):
* ox-koma-letter.el: Use new function.
* lisp/org-mouse.el (org-mouse-insert-item):
(org-mouse-context-menu):
* lisp/org-pcomplete.el (org-thing-at-point):
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-timestamp-change): Provide LIMIT argument to org-looking-back.
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-insert-heading): Replace looking-back with org-looking-back.
As of Emacs 25, the LIMIT argument to looking-back is advertised as a
required argument.
* lisp/ox.el (org-export-smart-quotes-alist):
(org-export--smart-quote-status): Change misleading quote names.
Due to the new smart quotes algorithm, "..." are always primary quotes,
even though they may be translated as single quotes. Conversely, '...'
are secondary quotes and may not be translated to single quotes.