* lisp/org.el (org-fill-context-prefix, org-fill-paragraph): Do not
fill verse blocks contents. Verse blocks can be used to format
free-form poetry, so filling has to be done manually.
* testing/lisp/test-org.el: Remove unnecessary tests.
* lisp/org-element.el (org-element-paragraph-separate): Since this
variable is meant to be searched forward, \end{...} shouldn't
trigger the end of a paragraph before checking if it is the end of
a complete environment.
(org-element-latex-environment-parser): Slight change to the regexp
matching the beginning of a latex environment.
(org-element-paragraph-parser): Paragraphs don't end at incomplete
latex environments.
(org-element-latex-or-entity-successor): Remove paragraph environments
from latex fragment search.
* org.el (org-contextualize-keys): Rename from
`org-contextualize-agenda-or-capture'. Fix normalization to
handle empty key replacement string.
(org-contextualize-validate-key): Rename from
`org-contexts-validate'. Allow checking against a custom
function.
* org-agenda.el (org-agenda-custom-commands-contexts): Update.
(org-agenda): Use `org-contextualize-keys'.
* org-capture.el (org-capture-templates-contexts): Ditto.
* org.texi (Templates in contexts, Setting Options): Update to
reflect changes in how contexts options are processed.
* org.el (org-contextualize-agenda-or-capture): Handle key
replacement depending on the contexts.
* org-capture.el (org-capture-templates-contexts): Allow to
use the context as a way to replace one capture template by
another one.
* org-agenda.el (org-agenda-custom-commands-contexts): Allow
to use the context as a way to replace one agenda custom
command by another one.
* org.texi (Templates in contexts): Document the new structure
of the variables `org-agenda-custom-commands-contexts' and
`org-capture-templates-contexts'.
In the setup below, X is not a real capture template, it is just
an alias to templates A and B in .txt and .el files. A and B are
deactivated by default in all files.
(setq org-capture-templates
'(("X" "Nothing but an alias")
("A" "AAAA" entry (file+headline [...]))
("B" "BBBB" entry (file+headline [...]))))
(setq org-capture-templates-contexts
'(("A" "A" ((not-in-file . ".*")))
("B" "B" ((not-in-file . ".*")))
("X" "A" ((in-file . "\\.txt")))
("X" "B" ((in-file . "\\.el")))))
Thanks to Carsten for suggesting this "key-replacement" idea!
* contrib/lisp/org-export.el (org-export-filter-apply-functions): Nil
value from a filter means filter will be skipped. To ignore the
current element or object, the filter has to return the empty string
instead.
This change is done to ease filter writing. When writing
a backend-specific filter (and I guess most are), there's no more need
for the somewhat contrived:
(if (not (eq backend 'e-latex)) data
... filter's job...)
A more straightforward:
(when (eq backend 'e-latex)
... filter's job...)
is now enough.
On the other hand, it is not possible anymore to specify 'ignore as
a filter to ignore every element or object of a given type. To
achieve that goal, one can now write, for example:
(add-to-list 'org-export-filter-example-block-functions
(lambda (value backend info)
(when (eq backend 'e-html) "")))
It will ignore every example block in the `e-html' export back-end.
* contrib/lisp/org-export.el (org-export-collect-headlines): By
default, limit depth of headline collection to last headline level.
* contrib/lisp/org-e-html.el (org-e-html-toc): Small refactoring.
* contrib/lisp/org-e-html.el (org-e-html-toc): Accept non numeric
values for depth.
(org-e-html-template): Call previous function even when depth isn't
a number.
(org-e-html-keyword): Call previous function even when depth isn't
a number. Also react on #+HTML keywords, not #+LATEX.
* targets.mk: Remove circular dependency created by robo-changing
UTILITIES->utils.
Fortunately this was non-fatal since direct circular dependencies are
ignored by GNU Make. Must happen more often... :-)
and remove invalid characters from menu items
* contrib/lisp/org-e-texinfo.el (org-e-texinfo--sanitize-menu): Remove
invalid characters from menu entries and nodes.
(org-e-texinfo--sanitize-contents): Ensure @ { and } are properly
escaped in text and headlines.
(org-e-texinfo--generate-menu-items): Strip invalid characters from
menu titles.
(org-e-texinfo-fixed-width): Escape @ { and } in fixed-width
environments.
(org-e-texinfo-headline): Ensure nodes do not have invalid characters
and escape @ { and } in section titles.
(org-e-texinfo-plain-text): Use proper escape character for @ { and }.
exporting to ensure info can process them properly
* contrib/lisp/org-e-texinfo.el (org-e-texinfo--generate-menu-items):
Use org-e-texinfo--sanitize-headline to ensure markup is stripped
before being used for sectioning and menu information. Nodes and
menus can fail because of formatting and section titles do not show
any formatting when viewed in an info-viewer.
(org-e-texinfo--sanitize-headline): Wrapper function for
org-e-texinfo--sanitize-healine-contents
(org-e-texinfo--sanitize-headline-contents): Strips markup from
headlines. It treats content recursively to ensure nested formatting
is removed as well.
* default.mk: Add customizatin variable ORG_ADD_CONTRIB with
descriptiona and commented example.
* targets.mk: Strip leading path and trailing suffix from all elements
of ORG_ADD_CONTRIB, then prefix with contrib/lisp and do wildcard
expansion (this will also remove any invalid names); store the
result in ORG_FROM_CONTRIB. Strip /contrib from ORG_FROM_CONTRIB
and store the result in ORG_TO_LISP. If these are non-empty, copy
the files from contrib/lisp/ into lisp/ before compilation and
remove them when cleanlisp is called.
* org.el (org-contextualize-agenda-or-capture)
(org-rule-validate): New functions, implement context
filtering for agenda commands and capture templates.
* org-agenda.el (org-agenda-custom-commands-contexts): New
option.
(org-agenda): Use it.
* org-capture.el (org-capture-templates-contexts): New option.
(org-capture-select-template): Use it.
* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.
This idea comes from Sylvain Rousseau, who implemented a similar
feature with org-context.el: https://github.com/thisirs/org-context
This implementation is a bit simpler and more general. Simpler
because it relies on existing templates, no need to define other
contextual ones. More general because contexts can be defined
wrt files and modes.
Thanks *very much* to Sylvain for paving the way -- certainly a
great addition to Org.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo--generate-detailed): Do
not run if there are no headlines in the file.
(org-e-texinfo-template): Generate menu and detailed menu in initial
let form. Only insert them if non-empty.
(org-e-texinfo-headline): Ensure that %'s are properly escaped in
@node's to prevent parse errors.
(org-e-texinfo-make-menu): Do not insert "detailed" if menu is empty,
return empty entry instead.
Thanks to Bastien for reporting the failures with headline-less files
and simple "%" in the headline.
* org-icalendar.el (org-icalendar-print-entries): Fix bug:
when `org-icalendar-use-plain-timestamp' is nil, scheduled and
deadline items should not be ignored.
Thanks to Friedrich Delgado for reporting this.
* org-freemind.el (org-freemind-convert-links-from-org):
Replace literally to prevent errors when replacing with string
containing backslashes.
Thanks to Martin Beck for reporting this.
* org-pcomplete.el (org-thing-at-point): Allow to match (and
then complete) a "thing" containing dashes.
Thanks to Aidan Gauland for reporting this problem.
* targets.mk: Repair .PHONY target. Correctly group ORed parameters
in find calls. Introduce $(CLEANDIRS) and use variable instead of
literals. Have a command succeed at the end of `config-*´ so that
no spurious warning is given by make.
* default.mk, targets.mk, lisp/Makefile: Rename _COMPILE_ to ORGCM.
* default.mk: Define ORGCM=dirall, show other possible values as
comments
* targets.mk: Implement target `single´, temporarily set
ORGCM (overriding configuration). Show newly introduced
configuration variables with `check-*´.
* lisp/Makefile: Implement dispatch for compile based on ORGCM.
Output header that contains the target for easier debugging.
* Makefile: Document target `single´.