Commit Graph

22924 Commits

Author SHA1 Message Date
Matt Huszagh 860cfe7f13 Add an option to convert LaTeX fragments to HTML
* lisp/org.el (org-latex-to-html-convert-command): New option to
convert a LaTeX fragment directly into HTML.
(org-format-latex): Use the new option.
(org-format-latex-as-html): Do the conversion and return HTML.
* lisp/ox-html.el (org-html-with-latex): Document the 'html symbol.
(org-html-format-latex): This custom HTML conversion, like MathJax,
doesn't require preprocessing.
(org-html-latex-fragment): Use the new option.

This allows you to set a custom command
`org-latex-to-html-convert-command' that will take as input a LaTeX
fragment and use it to generate HTML for export.  This is very
open-ended in the sense that you can use any shell-command you
want.  This has been added in order to use latexml, but you could
use any other tool that generates HTML output text.
2020-02-24 11:16:01 +01:00
Bastien 14a56eb915 Merge branch 'maint' 2020-02-24 10:42:36 +01:00
Bastien 46886f22d9 doc/org-manual.org (Completion): Fix documentation
* doc/org-manual.org (Completion): Fix documentation.
2020-02-24 10:34:46 +01:00
Bastien f56f2b323a org-id.el: Fix typo in comment
* lisp/org-id.el (org-id-find-id-file): Fix typo in comment.
2020-02-23 14:30:02 +01:00
Bastien 38928848c7 org-id.el: Fix typo in comment
* lisp/org-id.el (org-id-find-id-file): Fix typo in comment.
2020-02-23 14:29:38 +01:00
Nicolas Goaziou a63073ec04 Move obsolete aliases into "org-compat.el" 2020-02-23 12:57:07 +01:00
Nicolas Goaziou ee0dba6402 Small fix to headline search string
* lisp/ol.el (org-link-heading-search-string):
(org-link-search):
* lisp/ox.el (org-export-search-cells): Replace statistics cookies
with a space before squeezing spaces so as to handle properly, e.g.,
"wordCOOKIEword".
2020-02-23 12:51:07 +01:00
Nicolas Goaziou fe5962ce9b Fix some time stamps regexps
* lisp/org.el (org-ts--internal-regexp): New variable.
(org-ts-regexp):
(org-ts-regexp-inactive):
(org-ts-regexp-both): Use new variable.
(org-maybe-keyword-time-regexp): Remove variable.
(org-logbook-drawer-re): Simplify regexp.

Also move "Timestamp" section higher in the library (topological
order). This change should pacify "Relint" checks.
2020-02-23 12:41:33 +01:00
Nicolas Goaziou 2ab655fb6e org-manual: Fix typo
* doc/org-manual.org (Subscripts and Superscripts): Do not use quote
for symbols.
2020-02-23 11:59:10 +01:00
Nicolas Goaziou 83518daf11 Small fix
* lisp/org.el (org-set-tags-command): Also avoid using `looking-back',
in particular without a LIMIT argument.  This silences the
byte-compiler.
2020-02-23 10:30:22 +01:00
Bastien d9d877491b org-archive.el: Add :package-version to an option
* lisp/org-archive.el (org-archive-subtree-save-file-p): Add
:package-version.
2020-02-23 09:42:02 +01:00
Bastien 4d23aa19d5 etc/ORG-NEWS: Tiny rephrasing and formatting fixes 2020-02-23 09:42:02 +01:00
Jack Kamm 194a85d689 org-manual.org: Remove outdated information about ob-python results
* doc/org-manual.org (Results of Evaluation): Remove incorrect
information about how python session blocks extract results (outdated
since cc89d5523), and about how python session output differs from
non-session output (the examples no longer differ since b506bb68d).
2020-02-22 09:37:33 -08:00
Nicolas Goaziou 42ec2462a0 Do not leak "attachment" links
* lisp/ol.el (org-link-open): Remove "attachment" for special cases.
* lisp/org-attach.el (org-attach-expand-links):
(org-attach-follow): New functions.
(org-attach-link-expand): Remove function.
* lisp/org-element.el (org-element-link-parser):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex--inline-image):
(org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-inline-image-rules):
(org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-inline-image-rules):
(org-texinfo-link): Remove "attachment" from special cases.
2020-02-22 14:22:49 +01:00
Bastien 08428fed78 ob-shell.el: Delete `org-babel-shell-return-value-is-exit-status'
* lisp/ob-shell.el (org-babel-sh-evaluate): Return the output
by default.  Return exit status as the "value" when :result is
explicitely set to "value".

* lisp/ob-shell.el
(org-babel-shell-return-value-is-exit-status): Delete option.

* doc/org-manual.org (Collection): Be more accurate.

See the whole thread here:
https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00715.html

Thanks to everyone in this discussion.
2020-02-22 10:58:55 +01:00
Bastien 5dee070fb2 lisp/ol-bbdb.el (org-bbdb-anniversaries): Enhance docstring
* lisp/ol-bbdb.el (org-bbdb-anniversaries): Enhance docstring.

Thanks to Andrés Ramírez for suggesting this.
2020-02-22 10:33:07 +01:00
Bastien e360cd8f3a Change the default values for several options
* doc/org-manual.org (Execute commands in the active region):
Update the manual given the new defaults.

* etc/ORG-NEWS (New default settings for some options): New
section.

* lisp/org.el (org-loop-over-headlines-in-active-region):
Change the default value to `t'.
(org-fontify-done-headline): Ditto.

* lisp/org-agenda.el
(org-agenda-loop-over-headlines-in-active-region): Ditto.

* lisp/org-src.el (org-src-tab-acts-natively): Ditto.
2020-02-21 16:35:56 +01:00
Bastien 450452de4b org.el: Two minor fixes
* lisp/org.el (org-set-tags-command): Fix point position after
setting tag at the beginning of a blank heading.
(org-kill-line): Prevent from throwing an error when killing
the headline while point is right after the * chars.
2020-02-21 16:12:28 +01:00
Bastien 05f294ec5b org.el: Two minor fixes
* lisp/org.el (org-set-tags-command): Fix point position after
setting tag at the beginning of a blank heading.
(org-kill-line): Prevent from throwing an error when killing
the headline while point is right after the * chars.
2020-02-21 16:12:11 +01:00
Bastien 4cd497416f org-agenda.el: Rename two options
* lisp/org-agenda.el (org-sort-agenda-notime-is-late): Make an
obsolete alias to `org-agenda-sort-notime-is-late'.
(org-sort-agenda-noeffort-is-high): Make an obsolete alias to
`org-agenda-sort-noeffort-is-high'.
(org-agenda-finalize-entries, org-cmp-effort, org-cmp-time)
(org-cmp-ts, org-agenda-compare-effort): Use the new names.
2020-02-21 08:29:42 +01:00
Bastien 0c02928eb2 ob-shell.el: Rename `ob-shell-return-value-is-exit-status'
* lisp/ob-shell.el
(org-babel-shell-return-value-is-exit-status): Rename from
`ob-shell-return-value-is-exit-status'.
(org-babel-execute:shell, org-babel-sh-evaluate): Use new name.
(org-babel--variable-assignments:bash_assoc): Fix indentation.
2020-02-21 08:26:37 +01:00
stardiviner 97d0514b0b contrib/lisp/ob-php.el: Support change evaluate command specify options.
* contrib/lisp/ob-php.el (org-babel-php-command): Add new customizable
option `org-babel-php-command` to change default command.

* contrib/lisp/ob-php.el (org-babel-php-command-options): Add new
customizable option `org-babel-php-command-options` to specify
command options.

* contrib/lisp/ob-php.el (org-babel-execute:php): Use new commands in
execute function.
2020-02-20 18:48:35 +01:00
D. Williams 1b2de14d84 org-indent.el: Deprecate `org-hide-leading-stars-before-indent-mode'
* lisp/org-indent.el (org-indent-mode): Make `org-hide-leading-stars'
buffer local and revert it back to it's global value when exiting the
mode without storing it's global value manually.
(org-hide-leading-stars-before-indent-mode): Remove declaration.

This commit implements my suggestion from the mailing list
(https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00759.html)
to rely on Emacs' native mechanisms for restoring a buffer-local
variable to it's global default value instead of storing the global
value in a temporary variable (in this case:
`org-hide-leading-stars-before-indent-mode').

TINYCHANGE
2020-02-20 15:17:21 +01:00
Nicolas Goaziou 5d2075abad org-manual: Stick to typographic conventions
* doc/org-manual.org (Subscripts and Superscripts): Use ~...~ markup
for symbols and capital letters for keywords. Also prefer direct voice
and present tense whenever possible.
2020-02-20 09:57:38 +01:00
Eric Abrahamsen 6de5bcee87 Skip entries with no ID when updating ID locations
* lisp/org-id.el (org-id-update-id-locations): Saves a little chatter
about duplicate "nil" IDs.
2020-02-19 22:37:25 +01:00
Bastien 86cbaff2b8 org-manual.org: Enhance the "Subscripts and Superscripts" section
* doc/org-manual.org (Subscripts and Superscripts): Be more
explicit about the interaction between the relevant options.
2020-02-19 22:27:44 +01:00
Bastien 6f943b1da5 org.el (org-use-sub-superscripts): Remove old comment in docstring
* lisp/org.el (org-use-sub-superscripts): Remove old comment
in docstring.
2020-02-19 22:26:47 +01:00
Bastien bc75b75d9f org.el (org-special-ctrl-k): Enhance docstring
* lisp/org.el (org-special-ctrl-k): Enhance docstring.

Thanks to Marco Wahl for suggesting this change.
2020-02-19 21:43:31 +01:00
Nicolas Goaziou 0c55d3f421 Remove special syntax from context in file links
* lisp/ol.el (org-link--clear-syntax-from-context): New function.
(org-store-link): Use new function.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou 12c09be3a6 Refactor context part in file links
* lisp/ol.el (org-link--context-from-region):
(org-link--squeeze-white-spaces): New functions.
(org-link-heading-search-string): Refactor code. Always start with an asterisk.
(org-store-link): Use new functions.
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead):
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
Update tests.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou 8c4e270df2 ol: Refuse to define reserved internal link types
* lisp/ol.el (org-link-set-parameters): Raise an error when trying to
define reserved internal link types.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou f4bed78a19 Move custom links to new tooling
* contrib/lisp/ol-bookmark.el (org-bookmark-open):
* contrib/lisp/ol-elisp-symbol.el (elisp-symbol-open):
* contrib/lisp/ol-git-link.el (org-gitbare-open):
(org-git-open):
* contrib/lisp/ol-man.el (org-man-open):
* contrib/lisp/ol-mew.el (org-mew-open):
* contrib/lisp/ol-notmuch.el (org-notmuch-open):
(org-notmuch-search-open):
(org-notmuch-tree-open):
* contrib/lisp/ol-vm.el (org-vm-open):
(org-vm-imap-open):
* contrib/lisp/ol-wl.el (org-wl-open):
* contrib/lisp/org-mac-link.el (org-mac-together-item-open):
(org-mac-addressbook-item-open):
(org-mac-skim-open):
(org-mac-acrobat-open):
(org-mac-outlook-message-open):
(org-mac-evernote-note-open):
(org-devonthink-item-open):
(org-mac-message-open):
* contrib/lisp/org-mairix.el (org-mairix-open):
* lisp/ol-bbdb.el (org-bbdb-export):
(org-bbdb-open):
* lisp/ol-bibtex.el (org-bibtex-open):
* lisp/ol-docview.el (org-docview-open):
* lisp/ol-eshell.el (org-eshell-open):
* lisp/ol-eww.el ("eww"):
* lisp/ol-gnus.el (org-gnus-open):
* lisp/ol-info.el (org-info-open):
* lisp/ol-irc.el (org-irc-visit):
* lisp/ol-mhe.el (org-mhe-open):
* lisp/ol-rmail.el ("rmail"):
(org-rmail-open):
* lisp/ol.el (org-link--open-doi):
(org-link--open-elisp):
(org-link--open-help):
(org-link--open-shell):
* lisp/org-id.el (org-id-open):
* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe): Use
new tooling.
* doc/org-manual.org (Adding Hyperlink Types): Adapt example.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou afd3b04ecc ol: Extend open tooling in link parameters
* lisp/ol.el (org-link-parameters): Extend :follow parameter to handle
a second argument.
(org-link-open): Call custom-link functions after internal ones.
(org-link-open-as-file): New function.
(org-link-parameters): Reference new function.
(org-link-open): Use new function.
2020-02-19 18:42:47 +01:00
Nicolas Goaziou ab9166ad29 Extend export tooling in link parameters
* lisp/ol.el (org-link-parameters): Allow a fourth "info" argument for
`:export' property.  Expound docstring.
* lisp/ox.el (org-export-custom-protocol-maybe): Accept a fourth
optional argument.
* lisp/ox-ascii.el (org-ascii--describe-links):
(org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link):
* contrib/lisp/ox-groff.el (org-groff-link): Provide expected fourth
argument.
* lisp/ox.el (org-export-link-as-file): New function.
* lisp/ol.el (org-link-parameters): Add reference to new function in docstring.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Add tests.
(test-org-export/custom-protocol-maybe): Update tests.
2020-02-19 18:41:37 +01:00
Bastien fcf018a2c4 Delete mk/eldo.el
This has been moved to worg.
2020-02-19 18:32:23 +01:00
Bastien 9d58806fab Fix 5acf4d4692 2020-02-19 18:10:41 +01:00
Bastien 88d218a5a0 Fix 5acf4d4692 2020-02-19 18:10:26 +01:00
Bastien ac1498ec6e etc/ORG-NEWS: Document `ob-shell-return-value-is-exit-status'
* etc/ORG-NEWS: Document `ob-shell-return-value-is-exit-status'.
2020-02-19 16:57:15 +01:00
Bastien 4533d783c2 ob-shell.el: New option `ob-shell-return-value-is-exit-status'
* lisp/ob-shell.el (ob-shell-return-value-is-exit-status): New
option.
(org-babel-execute:shell, org-babel-sh-evaluate): Use it.

In a shell source code block, when there is no :results header or when
the :results header is "value", the code block should return the value
of the source block, called in "functional mode", i.e. with the code
being called as a function and returning a value.  See this part of
the manual:

‘value’
     Default.  Functional mode.  Org gets the value by wrapping the code
     in a function definition in the language of the source block.  That
     is why when using ‘:results value’, code should execute like a
     function and return a value.  For languages like Python, an
     explicit ‘return’ statement is mandatory when using ‘:results
     value’.  Result is the value returned by the last statement in the
     code block.

Strictly speaking, the "return value" of a shell source code block
should be the exit status of the last command in the block.  As the
manpage for bash says: "the return value of a simple command is its
status".

This patch allows this strict interpretation of "value" for shell
blocks, while sticking to the current behavior of returning the shell
output of the code block.

Thanks to Vladimir Nikishkin for asking a question about this and to
Eric Fraga and Tim Cross for their inputs on this issue.
2020-02-19 16:57:15 +01:00
stardiviner 4f31aa2d3b ob-python.el: Fix session initiation when using python-mode.el
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Fixes
new session initiation when org-babel-python-mode is
python-mode.el.
2020-02-19 07:39:28 -08:00
Bastien 39f1c1f1e1 Merge branch 'maint' 2020-02-19 14:35:05 +01:00
Bastien 10607d45ae org.el: Fix typo in docstring
* lisp/org.el (org-special-ctrl-k): Fix typo in docstring.
2020-02-19 14:34:58 +01:00
Bastien 5af2d215ff Revert "org-capture.el: Conditionally throw an error on missing annotation"
This reverts commit 78ec8da52a.
2020-02-19 13:37:24 +01:00
Bastien 0b9fcc603f Revert "org-capture.el: Don't throw an error abusively"
This reverts commit 26ba4f7d7f.
2020-02-19 13:37:17 +01:00
Bastien 26ba4f7d7f org-capture.el: Don't throw an error abusively
* lisp/org-capture.el (org-capture-fill-template): Don't throw
a user error when immediately finishing a template from which
an initial annotation is missing, warn instead.

This fixes 78ec8da52a.  Thanks to Eric Fraga for reporting this.
2020-02-19 13:32:49 +01:00
Bastien 4150832d43 Merge branch 'maint' 2020-02-19 10:56:20 +01:00
Bastien f90642e828 test-ob.el: Fix and enhance tests
* testing/lisp/test-ob.el (test-ob/string-to-number): Fix and
enhance tests.
2020-02-19 10:56:10 +01:00
Bastien d0018ce62c ob-core.el: Fix `org-babel--string-to-number'
* lisp/ob-core.el (org-babel--string-to-number): Prevent
strings containing whitespaces after being trimmed to be
interpreted as numbers.
2020-02-19 10:55:36 +01:00
Bastien 09877e5be2 Merge branch 'maint' 2020-02-19 10:39:51 +01:00
Bastien 6b2a7cb20b ob-core.el: Correctly interpret all numbers
* lisp/ob-core.el (org-babel--string-to-number): Correctly
interpret all numbers.

Thanks to Vladimir Nikishkin for reporting this.
2020-02-19 10:39:37 +01:00