Commit Graph

16012 Commits

Author SHA1 Message Date
Nicolas Goaziou fb593f7556 Handle ".+" repeater with hours step
* doc/org-manual.org (Repeated tasks): Document new feature.
* lisp/org.el (org-auto-repeat-maybe): Repeat from now when ".+" is
used in conjunction of hours increment.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add tests.
2020-04-06 15:18:48 +02:00
Marco Wahl 31d1bf86a3 Merge branch 'maint' 2020-03-30 23:23:33 +02:00
Marco Wahl fe34a408f2 org-table: Fix formula at column insert
* lisp/org-table.el (org-table-insert-column): Fix the index.

Report and fix by Yu Han Quek.  https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00290.html

TINYCHANGE
2020-03-30 23:21:22 +02:00
Marco Wahl 50ae73854b ox-publish: Allow plain as lambda preparation/completion-function
* lisp/ox-publish.el (org-publish-projects): Check for function before
  check for cons to capture lambda's as such.

Reported by Arne Babenhauserheide
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00284.html

(cherry picked from commit fffba5b7fd)
2020-03-30 12:21:39 +02:00
Marco Wahl fffba5b7fd ox-publish: Allow plain as lambda preparation/completion-function
* lisp/ox-publish.el (org-publish-projects): Check for function before
  check for cons to capture lambda's as such.

Reported by Arne Babenhauserheide
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00284.html
2020-03-30 11:10:12 +02:00
Christian Hopps 8a99404c84 org-clock.el: add semimonth step for clocktables
* lisp/org-clock.el (org-clocktable-steps): Add a semimonth step for
producing clock tables.

Originally proposed "bimonth" as name; however, bimonthly is
ambiguous, as it can mean 2 different things, semimonthly or every 2
months.

TINYCHANGE
2020-03-26 21:03:17 -04:00
Nicolas Goaziou 7a78eb1be0 ol: Fix some corner cases when normalizing context in links
* lisp/ol.el (org-link--normalize-string): Handle blanks between
special characters.
(org-link-heading-search-string): Small refactoring.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-26 22:57:16 +01:00
Nicolas Goaziou 5b96988706 ol: Prettify suggested description for stored links
* lisp/ol.el (org-store-link): Remove statistics cookies and spurious
white spaces from description, if possible.
2020-03-24 12:32:21 +01:00
Nicolas Goaziou 6ea1ca51a8 ol: Refactor code for clarity
* lisp/ol.el (org-link--normalize-string): New function.
(org-link--squeeze-white-spaces, org-link--clear-syntax-from-context):
Remove functions (merged in the previous one).
(org-link-search):
(org-link-heading-search-string):
(org-store-link): Use new function.
2020-03-24 12:01:50 +01:00
Nicholas Vollmer 097b4e6ca0 Use defvaralias for priority variable aliases
* lisp/org.el (org-highest-priority):
(org-lowest-priority):
(org-default-priority): Define as a variable alias, not a function
alias.

When these variables were renamed in e11f50648 (2020-01-30), variable
aliases were defined for the old names, but these were incorrectly
switched to function aliases in e062ca719 (org.el: Use `defalias' for
priority aliases, 2020-02-24).

<https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00083.html>

TINYCHANGE
2020-03-23 23:48:39 -04:00
Mattias Engdegård b78583a1c1 Backport commit 770f76f05 from Emacs
Make regexps smaller and faster by removing terms that are superfluous
by virtue of standing next to another term that matches more.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html
for details.

* lisp/ob-core.el (org-babel-remove-result):
* lisp/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-compat.el (org-maybe-keyword-time-regexp):
* lisp/org-table.el (org-table-expand-lhs-ranges):
Remove subsumed repetitions.

Remove subsumed repetitions in regexps
770f76f050376bbd77a3cc8cf44db57cf855a27c
Mattias Engdegård
Thu Feb 20 16:05:18 2020 +0100
2020-03-15 22:51:31 -04:00
Mattias Engdegård 0c046aecf0 Backport commit 0c6c8aa00 from Emacs
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html .

* lisp/org-element.el (org-element--cache-sync-requests):
* lisp/org.el (org-sparse-tree):
Remove redundant backslashes.

Remove (or double) redundant backslashes in string literals
0c6c8aa002d321db61afdd14c70744f7bc27f268
Mattias Engdegård
Fri Jan 24 23:04:34 2020 +0100
2020-03-15 22:51:31 -04:00
Mattias Engdegård 7265f2864e Backport commit af085ef40 from Emacs
* lisp/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org-protocol.el (org-protocol-data-separator):
* lisp/org-table.el (org-table-number-regexp):
* lisp/ox-latex.el (org-latex-known-warnings):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.

Use regexp type for regexps in defcustom declarations
af085ef40b961ca3466e8b2dfb7f722573e5a4cc
Mattias Engdegård
Thu Dec 26 16:50:58 2019 +0100
2020-03-15 22:51:31 -04:00
Kyle Meyer fed3c07390 Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.4 to
Emacs 28.1.

Emacs 27 is nearing release.  A sync of 9.4 would be with the current
version for Emacs's master branch.
2020-03-15 22:51:24 -04:00
Kyle Meyer 852af41bd9 ox-html: Update a :package-version value
* lisp/ox-html.el (org-html-infojs-template): Update :package-version
for recent default value change, and drop :version in favor of mapping
via customize-package-emacs-version-alist.
2020-03-15 22:07:52 -04:00
Arne Babenhauserheide 661696036f ox-html: escape & in license magnets
* lisp/ox-html.el (org-html-scripts):
(org-html-infojs-template): & escaped as &amp;

This fixes xhtml validation while still being recognized by LibreJS as
valid license.

Reported-by: Colin Baxter <m43cap@yandex.com>
<87eett7bql.fsf@yandex.com>

TINYCHANGE
2020-03-15 20:06:35 -04:00
Nicolas Goaziou b6e3e8f2b6 ox-html: Add missing :package-version keyword
* lisp/ox-html.el (org-html-validation-link): Default value changed,
so update :package-version keyword.
2020-03-15 17:02:01 +01:00
Augustin Fabre 472a171b94 ox-html: Use HTTPS for link to W3 HTML validator
* lisp/ox-html.el (org-html-validation-link): Use HTTPS link to W3
HTML validator.

TINYCHANGE
2020-03-15 16:58:13 +01:00
Nicolas Goaziou d9b1fb1e8c org-compat: Add missing definition
* lisp/org-compat.el (org-maybe-keyword-time-regexp): New variable.

This is a followup to 209fb501bd.
2020-03-12 09:57:24 +01:00
Nicolas Goaziou 209fb501bd org-compat: Mark `org-maybe-keyword-time-regexp' as obsolete
* lisp/org-compat.el (org-maybe-keyword-time-regexp): Make obsolete.
2020-03-12 09:08:27 +01:00
Nicolas Goaziou 7e38f69178 Merge branch 'maint' 2020-03-11 21:53:25 +01:00
Nicolas Goaziou 685b2c4410 org-macro: Fix last commit
* lisp/org-macro.el (org-macro--set-template): Do not override value
with an empty one.

This is a followup to 965cdbfd4b.
2020-03-11 21:52:19 +01:00
Nicolas Goaziou 965cdbfd4b org-macro: Fix {{{author}}} expansion without AUTHOR keyword
* lisp/org-macro.el (org-macro--set-template): Allow setting a nil
value, which becomes an empty template.
* testing/lisp/test-org-macro.el (test-org-macro/author):
(test-org-macro/email):
(test-org-macro/title): New tests.

Reported-by: "Dauer, Michael" <michael.dauer@smartpm.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00094.html>
2020-03-11 16:24:26 +01:00
Nicolas Goaziou 4cf8ffdba6 org-macro: Fix {{{author}}} expansion without AUTHOR keyword
* lisp/org-macro.el (org-macro--set-template): Allow setting a nil
value, which becomes an empty template.
* testing/lisp/test-org-macro.el (test-org-macro/author):
(test-org-macro/email):
(test-org-macro/title): New tests.

Reported-by: "Dauer, Michael" <michael.dauer@smartpm.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00094.html>
2020-03-11 16:21:49 +01:00
Nicolas Goaziou e18415d02c ob: Fix case when replacing Noweb reference
* lisp/ob-core.el (org-babel-expand-noweb-references): Use FIXEDCASE.
* testing/lisp/test-ob.el (test-ob/noweb-expansion): Add test.

Reported-by: Sebastian Miele <sebastian.miele@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00070.html>
2020-03-09 23:10:04 +01:00
Nicolas Goaziou 8b67d79c3b org-clock: Small refactoring
* lisp/org-clock.el (org-clock-get-table-data): Use standard regexp
for statistics cookies.
2020-03-09 22:27:45 +01:00
Nicolas Goaziou 97e415c5df ol: Do not save tags when storing a link from a headline
* lisp/ol.el (org-link-heading-search-string): Assume optional
argument is already valid.  Remove TODO keyword, priority cookie,
COMMENT keyword, and tags.
(org-link-search): Remove COMMENT keyword.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-09 22:23:11 +01:00
Kyle Meyer 0a8faecb7f Merge branch 'maint' 2020-03-05 23:24:24 -05:00
Tim Visher 70c1eec559 org-attach.el: Use `force' arg everywhere in `org-attach-delete-all'
* lisp/org-attach.el (org-attach-delete-all): Use `force' arg
throughout function.

`org-attach-delete-all` advertised a `force` option but passing it
only forced its way past the initial "Really remove all…" query.  This
was unexpected and not properly documented.

This extends the use of the `force` argument to the `delete-directory`
call and documents its meaning in the docstring.

TINYCHANGE
2020-03-05 23:24:14 -05:00
Bastien a753bad1bf org-timer.el: Remove useless `or' conditional
* lisp/org-timer.el (org-timer--get-timer-title): Remove
useless `or' conditional.
2020-03-02 15:55:45 +01:00
Marco Wahl abf5ab0944 org-timer: Fix timer start from agenda
* lisp/org-timer.el (org-timer--get-timer-title): Return buffer-name
also for agenda lines without complete "org marker".

Reported by Ian Garmaise
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00004.html
2020-03-01 22:45:35 +01:00
Nicolas Goaziou 041138e47c Remove `org-export-link-as-file'
* lisp/ol.el (org-link-parameters): Remove reference to the function.
* lisp/ox.el (org-export-link-as-file): Remove function.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Remove test.

The current implementation is not satisfactory, and not useful in the
code base. Using a pre-export hook turning custom link type into
"file" is enough for now. See "attachement" links for an example.
2020-02-28 01:30:30 +01:00
Gustav Wikström 0e0df5abf3 attach: translate directly as file links during export
* lisp/org-attach.el (org-attach-expand-links): translate directly as
file links during export.
2020-02-28 01:27:47 +01:00
Nicolas Goaziou 7707f898a1 ol: Fix opening file link with a starred search option
* lisp/ol.el (org-link-open-as-file): Fix logic so initial regexp is
matched against the file-name only, not the search option.
2020-02-26 16:29:32 +01:00
Bastien 30d0b6e1f6 org.el: Tiny enhancements `org-format-latex-as-html'
* lisp/org.el (org-create-math-formula): Use `warn'.
(org-format-latex-as-html): Don't set a free variable, return
the string directly.
2020-02-24 11:43:45 +01:00
Bastien e062ca7199 org.el: Use `defalias' for priority aliases.
* lisp/org.el (org-highest-priority, org-lowest-priority)
(org-default-priority): Use `defalias'.
2020-02-24 11:41:33 +01:00
Bastien 3a543a981b Enhancements to `org-latex-to-html-convert-command'
* lisp/org.el (org-latex-to-html-convert-command): Fix option.

* etc/ORG-NEWS: Document `org-latex-to-html-convert-command'
as a new option.
2020-02-24 11:21:40 +01:00
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 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 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
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
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
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 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 9d58806fab Fix 5acf4d4692 2020-02-19 18:10:41 +01:00
Bastien 88d218a5a0 Fix 5acf4d4692 2020-02-19 18:10:26 +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 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
Bastien 093e65ecc7 Merge branch 'maint' 2020-02-19 00:35:34 +01:00
Bastien 7e52b76612 org-agenda: Fix logic of `org-agenda-filter-make-matcher'
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Fix
logic: only use 'or when including several categories as e.g.
'("+cat1" "+cat2").

This fixes 06cf532f4.
2020-02-19 00:35:20 +01:00
Bastien fae16ed8f5 Add `generated-autoload-file' buffer local variable
* lisp/org.el:
* lisp/org-num.el:
* lisp/org-macs.el:
* lisp/org-list.el:
* lisp/org-lint.el:
* lisp/org-keys.el:
* lisp/org-goto.el:
* lisp/org-duration.el:
* lisp/org-compat.el:
* lisp/org-colview.el:
* lisp/org-capture.el:
* lisp/org-agenda.el:
* lisp/ol.el: Add `generated-autoload-file' buffer local variable.

This is needed when compiling Org files within GNU Emacs.
2020-02-18 23:37:24 +01:00
Bastien 273a7775cd Various minor fixes
* mk/eldo.el: Update copyright year and fix formatting.

* lisp/ox-man.el: Don't set generated-autoload-file as a
buffer local variable.

* lisp/org-refile.el: Place ;;;###autoload correctly.

* lisp/ob-lilypond.el (org-babel-lilypond-switch-extension):
Formatting fix.
2020-02-18 23:24:09 +01:00
Bastien 6a1f6ee1f8 Tiny formatting fixes
* lisp/ox.el (org-export-table-dimensions):
* lisp/ox-texinfo.el (org-texinfo-template):
* lisp/ox-md.el (org-md-link):
* lisp/ox-icalendar.el (org-icalendar-use-UTC-date-time-p):
* lisp/ox-ascii.el (org-ascii-fixed-width):
* lisp/org.el (org-context):
* lisp/org-table.el (org-table-eval-formula)
(org-table-export):
* lisp/org-refile.el:
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
* lisp/org-num.el (org-num):
* lisp/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org-macro.el (org-macro):
* lisp/org-lint.el (org-lint):
* lisp/org-keys.el (org-keys):
* lisp/org-duration.el:
* lisp/org-clock.el (org-clock-get-last-clock-out-time)
(org-clock-update-mode-line, org-find-open-clocks):
* lisp/org-agenda.el (org-diary)
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
(org-agenda-highlight-todo, org-cmp-alpha)
(org-agenda-filter-by-category):
* lisp/ol.el (org-link-expand-abbrev, ol):
* lisp/ol-docview.el (ol-docview):
* lisp/ol-bibtex.el (org-execute-file-search-in-bibtex)
(org-bibtex, org-bibtex-read):
* lisp/ol-bbdb.el (org-bbdb-anniversary-description):
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org):
* lisp/ob-table.el (org-babel-table-truncate-at-newline):
* lisp/ob-stan.el:
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/ob-sql.el:
* lisp/ob-shen.el:
* lisp/ob-shell.el (org-babel-prep-session:shell)
(org-babel-prep-session:shell):
* lisp/ob-sed.el (org-babel-execute:sed)
(org-babel-execute:sed):
* lisp/ob-screen.el:
* lisp/ob-sass.el:
* lisp/ob-ruby.el (org-babel-prep-session:ruby)
(org-babel-prep-session:ruby):
* lisp/ob-ref.el (org-babel-ref-resolve, ob-ref):
* lisp/ob-python.el (org-babel-prep-session:python)
(org-babel-prep-session:python):
* lisp/ob-plantuml.el:
* lisp/ob-picolisp.el:
* lisp/ob-perl.el:
* lisp/ob-org.el:
* lisp/ob-octave.el (org-babel-prep-session:octave)
(org-babel-prep-session:octave)
(org-babel-octave-evaluate-session):
* lisp/ob-ocaml.el:
* lisp/ob-mscgen.el (org-babel-execute:mscgen)
(org-babel-execute:mscgen):
* lisp/ob-maxima.el:
(ob-maxima):
* lisp/ob-matlab.el:
* lisp/ob-makefile.el:
* lisp/ob-lua.el (org-babel-prep-session:lua)
(org-babel-prep-session:lua):
* lisp/ob-lisp.el:
* lisp/ob-ledger.el:
* lisp/ob-latex.el (org-babel-expand-body:latex)
(org-babel-expand-body:latex, ob-latex):
* lisp/ob-js.el:
* lisp/ob-java.el:
* lisp/ob-io.el (org-babel-prep-session:io)
(org-babel-prep-session:io):
* lisp/ob-hledger.el:
* lisp/ob-haskell.el:
* lisp/ob-groovy.el (org-babel-groovy-wrapper-method)
(org-babel-groovy-evaluate):
* lisp/ob-gnuplot.el:
* lisp/ob-fortran.el (org-babel-expand-body:fortran)
(org-babel-expand-body:fortran):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-exp.el (ob-exp):
* lisp/ob-eval.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-ebnf.el:
* lisp/ob-dot.el:
* lisp/ob-ditaa.el:
* lisp/ob-css.el:
* lisp/ob-core.el (org-babel-put-rownames):
* lisp/ob-coq.el:
* lisp/ob-comint.el:
* lisp/ob-calc.el:
* lisp/ob-awk.el:
* lisp/ob-asymptote.el:
* lisp/ob-abc.el:
* lisp/ob-R.el (org-babel-prep-session:R): Formatting fixes.
2020-02-18 22:57:37 +01:00
Bastien 325962c003 org.el: New option `org-startup-numeroted' and #+startup: num
* lisp/org.el (org-startup-numeroted): New option.
(org-startup-options): New "num" and "nonum" startup keywords.
(org-mode): Startup according `org-startup-numeroted' or the
local #+startup setup.

* doc/org-manual.org (Dynamic Headline Numbering)
(Summary of In-Buffer Settings): Document
`org-startup-numeroted' and #startup: num.

* etc/ORG-NEWS: Document the new startup option.

Thanks to Guillaume MULLER for this idea.
2020-02-18 13:27:33 +01:00
Bastien 44e17c420b Merge branch 'maint' 2020-02-18 10:31:49 +01:00
Stefan Kangas 2129ece3b5 org-agenda.el: Fix typo
* lisp/org-agenda.el (org-agenda-add-entry-text-descriptive-links):
Fix typo.
2020-02-18 10:31:37 +01:00
Bastien cb2774d1a8 org-capture.el: Fix possibly missing final newline
* lisp/org-capture.el (org-capture-finalize): When capturing
an entry, fix missing final newline when the user has deleted
it.

This continues the fix done in d8c51531c.
2020-02-18 01:25:59 +01:00
Bastien fc3f1e6b28 Revert "ob-python: Session returns empty string if no return value"
This reverts commit 5fc4576548.
2020-02-17 23:46:49 +01:00
Bastien b8a2ad9288 org-agenda.el: New hook `org-agenda-filter-hook'
* lisp/org-agenda.el (org-agenda-filter-hook): New hook.
(org-agenda-finalize): Enhance docstring.
(org-agenda-filter): Use the new hook.
(org-agenda-filter-expand-tags, org-agenda-filter-apply): ):
Fix docstrings.

* etc/ORG-NEWS: Document the new hook.
2020-02-17 18:40:11 +01:00
Jack Kamm 5fc4576548 ob-python: Session returns empty string if no return value
* lisp/ob-python.el (org-babel-python--eval-ast): Change sessions to
return an empty string, instead of None, if there is no return value.
2020-02-17 18:30:47 +01:00
Bastien a85f1603ec Merge branch 'maint' 2020-02-17 16:36:12 +01:00
Bastien 6accd0ef62 Fix fb188adda 2020-02-17 16:36:01 +01:00
Bastien cdf7d6414d Merge branch 'maint' 2020-02-17 16:29:38 +01:00
Bastien 016aa96f99 Revert "org-compat.el: Require 'org-agenda in a timely fashion"
This reverts commit 2f30ecffdf.
2020-02-17 16:29:21 +01:00
Bastien 19cdef520e Merge branch 'maint' 2020-02-17 14:51:47 +01:00
Bastien 2f30ecffdf org-compat.el: Require 'org-agenda in a timely fashion
* lisp/org-compat.el ("calendar"): Require 'org-agenda before
adding `org--setup-calendar-bindings' to `calendar-mode-hook'.

This fixes Emacs bug#38592.
2020-02-17 14:49:15 +01:00
Bastien f25b40621b Merge branch 'maint' 2020-02-17 14:23:00 +01:00
Bastien fb188adda0 org.el: Move `org-agenda-diary-file' to org-agenda.el
* lisp/org-agenda.el (org-agenda-diary-file): Move from org.el.
* lisp/org-colview.el (org-agenda-diary-file): Move to org-agenda.el.
2020-02-17 14:22:30 +01:00
Bastien 055742562c org-colview.el: Allow text rescaling
* lisp/org-colview.el (org-columns-header-line-remap): New
variable.
(org-columns--display-here): Don't rigidly inherit the :height
from the default face, allow text-scale-* to also rescale the
temporary column view header-line.
(org-columns-remove-overlays): If
`org-columns-header-line-remap' is non-nil, remove the
header-line face relative remapping.

* etc/ORG-NEWS (Allow text rescaling in column view): Document
the ability to scale text in column view.

Thanks to Marco Wahl for this suggestion.
2020-02-17 13:59:19 +01:00
Bastien 5dd7721242 Use `org-switch-to-buffer-other-window' in a few places
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org-attach.el (org-attach):
* lisp/ob-lilypond.el (org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-mark-error-line): Use
`org-switch-to-buffer-other-window' instead of
`switch-to-buffer-other-window'.
2020-02-17 09:04:19 +01:00
Bastien 915a8eade4 org-agenda.el/org-capture.el: Use `user-error' in two places
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-agenda.el (org-agenda-clock-out): Use `user-error'.
2020-02-17 08:55:19 +01:00
Bastien e8402f3cad org-agenda.el: Let `org-agenda-filter' consider group tags
* lisp/org-agenda.el (org-agenda-filter): Expand group tags.
(org-agenda-get-represented-tags): Consider group tags
represented when one tag of the group is represented.
2020-02-17 08:20:55 +01:00
Kyle Meyer 1a7e4627fa org-link-open: Fix typo in recent docstring change
* lisp/ol.el (org-link-open): Fix docstring typo.
2020-02-16 20:51:24 -05:00
Bastien 10cd894b23 ob-clojure.el: More minor refinements
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Inline
namespace setting.
(org-babel-clojure-cider-current-ns): Delete.
(ob-clojure-inf-clojure-filter-out): New variable.
(ob-clojure-inf-clojure-output): Use it.
(ob-clojure-eval-with-inf-clojure): Update the filter variable
depending on the current namespace.
2020-02-17 02:38:02 +01:00
Bastien 41c5fe0be8 org-agenda.el: Fix call to `org-agenda-finalize-hook'
* lisp/org-agenda.el (org-agenda-finalize): Run functions in
`org-agenda-finalize-hook' at the very end.
2020-02-17 00:45:28 +01:00
Bastien dfa7a3397b org-agenda.el: Fix call to `org-agenda-finalize-hook'
* lisp/org-agenda.el (org-agenda-finalize): Run functions in
`org-agenda-finalize-hook' at the very end.
2020-02-17 00:45:13 +01:00
Nicolas Goaziou 8f540c4db4 org-list: Optimize `org-at-radio-list-p'
* lisp/org-list.el (org-at-radio-list-p): Call only one "heavy"
function.  Do not require "ox.el" function.  Use defun instead of
defsubst since this is a non-trivial function.  For consistency with
other parameters, :radio accepts any value except nil.
2020-02-17 00:31:39 +01:00
Bastien 409bd498d1 ob-clojure.el: Enhancements and refactoring, removed session code
* lisp/ob-clojure.el (ob-clojure-inf-clojure-output): Filter
out spurious strings.
(ob-clojure-with-temp-expanded): New macro.
(ob-clojure-string-or-list, ob-clojure-eval-with-inf-clojure)
(ob-clojure-eval-with-cider, ob-clojure-eval-with-slime): New
functions.
(org-babel-execute:clojure): Use new functions.
(org-babel-execute:clojurescript): Fix docstring.
(org-babel-edit-prep:clojure)
(org-babel-clojure-initiate-session)
(org-babel-prep-session:clojure)
(org-babel-clojure-var-to-clojure)
(org-babel-variable-assignments:clojure): Delete function.
2020-02-16 23:46:49 +01:00
Nicolas Goaziou 427f1a2d03 Merge branch 'maint' 2020-02-16 23:33:48 +01:00
Nicolas Goaziou 8f6ce817d8 ox-html: Fix author meta-data
* lisp/ox-html.el (org-html--build-meta-info): Prevent duplicates in
author meta-data.
2020-02-16 23:33:13 +01:00
Bastien e2203692b7 ob-clojure.el: Support using inf-clojure.el
* lisp/ob-clojure.el (org-babel-clojure-backend): Allow to use
inf-clojure.el and set to nil by default.
(ob-clojure-inf-clojure-output): New function.
(org-babel-execute:clojure): Support using inf-clojure.el.
Remove the :show-process parameter.
(org-babel-execute:clojurescript)
(org-babel-edit-prep:clojure): Fix docstrings.
(org-babel-clojure-initiate-session): Make the session
parameter mandatory.  Initiate a cider session if needed.
2020-02-16 11:16:00 +01:00
Bastien 4eaddab3dd org-list.el: Fix `org-at-radio-list-p'
* lisp/org-list.el (org-at-radio-list-p): Don't choke the list
is at the beginning of the buffer.
2020-02-16 11:12:28 +01:00
Nicolas Goaziou 833753abcf ol: Tiny refactoring
* lisp/ol.el (org-link-open): Improve docstring.  Tiny refactoring.
2020-02-15 18:34:16 +01:00
Kyle Meyer e361c64043 ob-clojure: Drop recently added if-let* for compatibility
* lisp/ob-clojure.el (org-babel-edit-prep:clojure): Rewrite without
if-let*, which isn't available until Emacs 26.
2020-02-14 21:09:12 -05:00
Bastien 0fa69d2f1a Merge branch 'maint' 2020-02-14 10:32:44 +01:00
Bastien 27e4d7ce48 Prevent infinite loop when showing new time in agenda
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Don't use
an overlay to make the task invisible, use text properties.
(org-agenda--mark-blocked-entry): Add text property
'org-filter-type to later use `org-agenda-filter-hide-line' if
necessary.
(org-agenda-filter-hide-line): Fix docstring.

The related bug was first reported in 2013 by Matt Lundin here:
https://lists.gnu.org/archive/html/emacs-orgmode/2013-08/msg00072.html

Then Andrew Hyatt reported it again, and provided a minimal recipe on
how to reproduce it consistently.

Thanks a lot to both of them.
2020-02-14 10:32:35 +01:00
Bastien fb3ec41dac Merge branch 'maint' 2020-02-14 08:38:03 +01:00
Bastien 29f44df758 Fix fa24cd541 again 2020-02-14 08:36:54 +01:00
stardiviner 003a7fc0b4 * lisp/ob-clojure.el: Add more ClojureScript src block support.
* lisp/ob-clojure.el: Add ClojureScript src block tangle extension and
header arguments support.

* lisp/ob-clojure.el (org-babel-edit-prep:clojure): Auto inject src
block :ns header argument into editing temporary src block buffer local.

TINYCHANGE
2020-02-13 16:56:02 +01:00
Robert Hambrock d37fc58150 * lisp/ob-clojure.el: Support for clojurescript src block execution.
* lisp/ob-clojure.el (org-babel-execute:clojurescript): New function to
Execute ClojureScript src block.

TINYCHANGE
2020-02-13 16:55:57 +01:00
Bastien 937ac9b777 lisp/org-refile.el (org-refile-get-location): Small refactoring
* lisp/org-refile.el (org-refile-get-location): Small refactoring.
2020-02-13 11:44:10 +01:00
Bastien 66810d2121 Bump version to 9.3.6 2020-02-13 08:47:28 +01:00
Bastien da97799a1d org-refile.el: Fix commit 63fd0c09ca
* lisp/org-refile.el (org-refile-get-location): Set
`org-refile-history' correctly.
2020-02-13 08:45:01 +01:00
Bastien e22bfc2866 org-clock.el: Small enhancements
* lisp/org-clock.el (org-clock-resolve): Small message
enhancement, inline a function and use `org-time-subtract'
instead of `time-subtract'.
2020-02-13 08:06:54 +01:00
Dan Drake 554a3fc643 org-clock.el: Add `t' option to `org-clock-resolve'
* org-clock.el (org-clock-resolve): add `t' option.  This works like
`k', but asks the user to specify a time instead of a number of
minutes.

TINYCHANGE

Often when you are interrupted at a task and get back to it, you know
what time the interruption happened. This option makes it easy to tell
org-resolve-clocks about that. For example, say you clocked into task A
at, say, 9:37:

    * original task A
      :LOGBOOK:
      CLOCK: [2020-01-21 Mon 09:37]
      :END:

While working on task A, you get a phone call. When the call is done,
you'd like to update your time logging to reflect the phone call. Your
phone says the call was at 11:09.

With C-c C-x C-z, you can use the `K' option, but you need to figure out
the number of minutes to keep. It's easier to look at the phone, or to
mentally note the time when an interruption starts. With the new option,
you can select `T', and just specify a time of 11:09. The state is now:

    * original task A
      :LOGBOOK:
      CLOCK: [2020-01-21 Mon 09:37]--[2020-01-21 Mon 11:09] => 1:32
      :END:

You add the phone call to your org buffer and do C-c C-x C-i to clock
in. Org asks you to start the time from when the previous task ended,
you say yes, and the state is now:

    * original task A
      :LOGBOOK:
      CLOCK: [2020-01-21 Mon 09:37]--[2020-01-21 Mon 11:09] => 1:32
      :END:
    * task B, phone call
      :LOGBOOK:
      CLOCK: [2020-01-21 Mon 11:09]
      :END:

At this point, you can clock back into task A, or any other task.

The key feature here is to be able to just type in a time -- in any
format accepted by org-read-date -- instead of specifying a number of
minutes.
2020-02-13 07:48:04 +01:00
Bastien 32a5fa0b6c Revert "org-clock.el: Allow to tell time you got back when resolving"
This reverts commit 57841b5264.
2020-02-13 07:37:49 +01:00
Kyle Meyer ea94a0da43 Merge branch 'maint' 2020-02-13 00:04:16 -05:00
Alan Mackenzie 5056a48ff5 Backport commit 530067463 from Emacs
* lisp/org-attach.el (org-attach-unset-directory): Replace "different
than" by "different from".

Correct "different than" to "different from" where appropriate
530067463bffc982f02dcc4f2805d389704575b4
Alan Mackenzie
Sun Feb 9 14:33:14 2020 +0000
2020-02-13 00:03:19 -05:00
Mattias Engdegård 7c63da6fb9 Backport commit 32763dac4 from Emacs
Since 'add-to-list', being a plain function, cannot access lexical
variables, such use must be rewritten for correctness.
(Some instances actually do work thanks to a compiler macro,
but it's not something code should rely on.)

* lisp/org.el (org-reload): Replace add-to-list with push.

Replace add-to-list to lexical variable with push (bug#39373)
32763dac46e61cc34e8fe4d19df4905d09c1a27f
Mattias Engdegård
Sat Feb 1 22:27:23 2020 +0100
2020-02-13 00:02:47 -05:00
Bastien 57841b5264 org-clock.el: Allow to tell time you got back when resolving
* lisp/org-clock.el (org-clock-resolve): Allow to tell at what
time (i.e. a HH:MM string) you "got back".

Thanks to Dan Drake for suggesting this.
2020-02-13 01:25:26 +01:00
Bastien 63fd0c09ca org-refile.el: Small refactoring, fix a minor bug
* lisp/org-refile.el (org-refile-get-location): Small
refactoring and fix a minor bug, duplicating refile targets
available for completion.

Thanks to Gustavo Barros for the detailed explanations about
this bug.
2020-02-13 00:28:51 +01:00
Bastien 9712d1cdff Only fontify emphasis markers when they are visible
* lisp/org.el (org-do-emphasis-faces): Only fontify emphasis
markers when they are visible.

Thanks to d.williams for provided a bug report and this fix.
2020-02-13 00:10:33 +01:00
Bastien be93859c78 org.el (org-babel-load-file): Load emacs-lisp and elisp src blocks
* lisp/org.el (org-babel-load-file): Load both "emacs-lisp"
and "elisp" source blocks.

* lisp/ob-tangle.el (org-babel-tangle-file)
(org-babel-tangle, org-babel-tangle-collect-blocks): Use a
regular expression to match the language(s) to tangle.

Thanks to Troy Hinckley for reporting this.
2020-02-12 22:40:45 +01:00
Bastien ee1f73ee1e ob-screen.el: Fix compiler warning
* lisp/ob-screen.el (org-babel-screen-test): Use `message'
instead of `format'.
2020-02-12 22:25:15 +01:00
Bastien dd3b23afd5 ob-sql.el: Silent compiler warning
* lisp/ob-sql.el (sql-set-product): Declare function.
2020-02-12 22:23:27 +01:00
Bastien 8b6060a9bb Merge branch 'maint' 2020-02-12 21:33:19 +01:00
Bastien 18b3eb0062 ob-gnuplot.el: Fix broken links
* lisp/ob-gnuplot.el: Fix broken links.
2020-02-12 21:33:00 +01:00
Bastien c0d08b7efe org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug
* lisp/org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug
when matching the text at the end of the line.

Thanks to Nathan Neff for reporting and investigating this bug.
2020-02-12 20:00:29 +01:00
Yann Esposito (yogsototh) da62654cb1 ox-html.el: Use CUSTOM_ID for outline-container-* div id
* lisp/ox-html.el (org-html-headline): When CUSTOM_ID is set, use it
to set the outline-container-* <div> id.

TINYCHANGE

When exporting HTML the exporter generate ids for references.
Unfortunately those id are not stable in the sense that exporting
twice generate two different set of ids.

Using CUSTOM_ID one could already use have fixed anchors in the
generated HTML. So for example we could share URL with
...index.html#my-section-id and it will be the same URL even if we
export the HTML again.

Unfortunately, this CUSTOM_ID is not used for the outline ids.  And
thus if we expose the html in a git repository for example.  Each
export will generate a big diff that "pollute" the diff because it
will show changes for all org items while most of them could still be
unchanged.

With this PR, HTML export will use CUSTOM_ID for both the headers id
and the org outline ids. For Items without CUSTOM_ID the behavior will
stay identical as before.
2020-02-12 19:00:42 +01:00
Bastien 73445c0fab Merge branch 'maint' 2020-02-12 17:56:43 +01:00
Bastien fa24cd541d org.el (org-babel-load-file): Don't get fooled by symlinks
* lisp/org.el (org-babel-load-file): Don't get fooled by symlinks.
2020-02-12 17:43:02 +01:00
Bastien bfe2f919fa Fix 2508dfa6 2020-02-12 11:54:49 +01:00
Bastien ea47d9ebb4 Merge branch 'maint' 2020-02-12 11:27:55 +01:00
Bastien a03e57cdaf Bump version for 9.3.5 2020-02-12 11:27:01 +01:00
Bastien a066a7a103 Merge branch 'maint' 2020-02-12 11:24:44 +01:00
Bastien b1f564b4b6 ob-clojure.el: Fix let binding expansion and comments removal
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Remove
comment while expanding the body of the source block.
(org-babel-expand-body:clojure): Don't quote the value of src
block variables.
2020-02-12 11:24:07 +01:00
Bastien 254f45d5ed Merge branch 'maint' 2020-02-12 09:58:06 +01:00
Bastien 22a42fe30e ol-gnus.el: Remove references to Gmane
* lisp/ol-gnus.el (org-gnus-prefer-web-links)
(org-gnus-group-link, org-gnus-article-link): Remove
references to Gmane, as Gmane's web service is off.
2020-02-12 09:57:43 +01:00
Bastien 76ac192c4f Fix previous commit 2020-02-12 09:36:04 +01:00
Bastien 04e9d848ed Fix org-attach dispatch enhancement 2020-02-12 09:24:33 +01:00
Bastien d614c89f5d Merge branch 'maint' 2020-02-12 09:16:49 +01:00
Bastien c964cf79bc org-element.el: Fix bug about short captions
* lisp/org-element.el
(org-element--collect-affiliated-keywords): Save match data when
setting the main value for keywords.

This fixes a bug about defining short captions.  Thanks to Anthony
Cowley for reporting this and suggesting this fix.
2020-02-12 09:14:30 +01:00
stardiviner 7cd9ad8f75 Allow postgres as an alias for postgresql
* lisp/ob-sql.el (org-babel-edit-prep:sql): New function to
set SQL product.
(org-babel-execute:sql): Make "postgres" an alias for
"postgresql".

TINYCHANGE
2020-02-12 09:03:44 +01:00
Bastien eaa220f6a7 Small code enhancement
* doc/org-manual.org (Checkboxes): Minor update.

* lisp/org-list.el (org-at-radio-list-p): Respect the
attributes #+ATTR_* syntax.
2020-02-12 08:40:46 +01:00
Bastien 4028cc731b Use "#+attr_org: :radio" before lists to enable radio buttons
* doc/org-manual.org (Checkboxes): Document the use of
"#+attr_org".

* lisp/org.el (org-ctrl-c-ctrl-c): When the list at point is
preceded by "#+attr_org: :radio" use `org-toggle-radio-button'
instead of `org-toggle-checkbox'.

* lisp/org-list.el (org-at-radio-list-p): New defsubst.
(org-toggle-checkbox): Use it.

* etc/ORG-NEWS: Document the use of "#+attr_org".
2020-02-12 01:51:46 +01:00
Bastien 561feb128d Add `org-toggle-radio-button' and related minor mode
* doc/org-manual.org (Checkboxes): Document the new minor mode
and command.

* lisp/org-keys.el (org-mode-map): Bind C-c C-x C-r to
`org-toggle-radio-button'.

* lisp/org-list.el (org-list-checkbox-radio-mode): New minor
mode to let C-c C-c call `org-toggle-radio-button' instead of
`org-toggle-checkbox'.
(org-toggle-radio-button): New command.

* lisp/org.el (org-ctrl-c-ctrl-c): Use `org-toggle-radio-button'.

* etc/ORG-NEWS: Document the new minor mode and command.

Thanks to Phil Sainty for sharing this idea and links to similar
implementations.
2020-02-11 23:55:53 +01:00
Bastien 8f59e01aa8 Fix code typo in commit 0c72a1c4 2020-02-11 23:52:17 +01:00
Bastien fe46c02afa Fix code typo in commit 2508dfa6 2020-02-11 23:52:00 +01:00
Bastien 99f5f0ce1e org-table.el: Don't run table header mode with a timer
* lisp/org-table.el (org-table-header-set-header): Don't run
with a timer.
2020-02-11 21:42:54 +01:00
Nicolas Goaziou a70fff50d0 Merge branch 'maint' 2020-02-11 19:02:53 +01:00
Nicolas Goaziou 1af8c5a0df ox: Fix extra character deletion after link
* lisp/ox.el (org-export--update-included-link): Account
for :post-blank property when inserting back the link.
* testing/lisp/test-ox.el (test-org-export/expand-include/links): Add
test.

Fixes bug#39173.
2020-02-11 18:59:52 +01:00
Bastien 78ec8da52a org-capture.el: Conditionally throw an error on missing annotation
* lisp/org-capture.el (org-capture-fill-template): Throw a
user error when :immediate-finish is `t' and when the %a
template could not be expanded.

Thanks to Leo Gaspard for this idea.
2020-02-11 14:45:19 +01:00
Bastien 20ab65482a Merge branch 'maint' 2020-02-11 14:40:17 +01:00
Bastien 713c8d5aba ob-core.el: Respect `org-babel-tangle-uncomment-comments'
* lisp/ob-core.el (org-babel-expand-noweb-references): Respect
`org-babel-tangle-uncomment-comments'.

Thanks to Immanuel Litzroth for reporting this.
2020-02-11 14:35:30 +01:00
Bastien 9447287521 Merge branch 'maint' 2020-02-11 12:28:40 +01:00
Brian Carlson 5acf4d4692 ox-latex.el: Fix the display of checkbox items
* lisp/ox-latex.el (org-latex-item): Fix the display of
checkbox items.

TINYCHANGE
2020-02-11 12:28:02 +01:00
Bastien e01b335ee3 ob-scheme.el: Fix interpreter output sometimes being nil
* lisp/ob-scheme.el (org-babel-scheme-execute-with-geiser):
Fix interpreter output sometimes being nil.

Thanks to Vladimir Nikishkin for reporting this and proposing a
similar fix.
2020-02-11 12:19:34 +01:00
Bastien efd754e474 Fix 68fa5e589 2020-02-11 12:03:38 +01:00
Bastien 0330efc865 Merge branch 'maint' 2020-02-11 10:08:14 +01:00
Bastien 95ff24dfc4 org.el: Fix bug occurring when setting effort value
* lisp/org.el (org-refresh-property)
(org-refresh-category-properties): Tiny docstring or comment
fixes.
(org-set-effort): Fail early when the effort value is wrong.

Thanks to Firmin Martin for reporting this.
2020-02-11 10:06:13 +01:00
Bastien 68fa5e589f ox-html.el: Enhance Javascript scripts display of the license
* lisp/ox-html.el (org-html-scripts)
(org-html-infojs-template): Enhance the display of the
licenses for Javascript scripts.

Thanks to Arne Babenhauserheide for suggesting this.
2020-02-11 09:45:48 +01:00
Bastien 3ce509b855 ox-html.el: Build HTML links correctly
* lisp/ox-html.el (org-html-link): Add the possibility to use
an empty HTML extension, building HTML links to accordingly.
2020-02-11 09:30:57 +01:00
Bastien 0c72a1c413 ox-html.el: No trailing dot when HTML extension is empty
* lisp/ox-html.el (org-html-export-to-html)
(org-html-publish-to-html): Don't add a trailing dot when HTML
extension is empty.
2020-02-11 09:26:20 +01:00
Bastien 968117b19d Merge branch 'maint' 2020-02-11 08:51:43 +01:00
Bastien 52320f942b lisp/ob-lilypond.el: Fix initialization bug
* lisp/ob-lilypond.el (org-babel-lilypond-commands): Fix the :set
function.

Thanks to Victor A. Stoichita for reporting this.
2020-02-11 08:51:30 +01:00
Bastien e83b2b50df Merge branch 'maint' 2020-02-11 07:54:47 +01:00
Bastien f7175e4878 org.el: Fix bug about cycling
* lisp/org.el (org-cycle-internal-local): Handle
`org-cycle-include-plain-lists'.

Thanks to Bruce Tulloch for reporting this.
This fixes a bug introduced in commit c2aebcee.
2020-02-11 07:54:36 +01:00
Bastien 2508dfa644 Factor out org-scroll and use it in ox.el, org-agenda/attach.el
* lisp/ox.el (org-export--dispatch-ui): Update message in the
header line to promote the use of C-v and M-v while SPC and
DEL are still allowed for backward compatibility reasons.

* lisp/org-macs.el (org-scroll): New function.

* lisp/org-attach.el (org-attach): Use `org-scroll'.

* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Allow C-v, M-v, C-n and C-p to scroll.

This change adverize C-v, M-v, C-n and C-p as the default keys
for scrolling the window, while SPC and DEL are still available
in the export dispatch window.

In particular, don't use SPC as a way to scroll the window in
the agenda commands dispatch window, as this key might be used
for a custom agenda command.
2020-02-11 01:04:28 +01:00
Bastien 185e184e15 ox.el: Remove obsolete comment
* lisp/ox.el: Remove obsolete comment.
2020-02-11 01:00:05 +01:00
Bastien ceb8086301 Small refactoring
* lisp/org-macs.el (org-scroll): New function.

* lisp/ox.el (org-export--dispatch-action):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Use the new function.
2020-02-10 23:22:51 +01:00
Marco Wahl 1c6336652b org: Tiny refactoring
* lisp/org.el (org-redisplay-inline-images): Save one line
of code.  Also make the docstring more precise.
2020-02-10 13:10:08 +01:00
Bastien 63ca986bea Fix e3b79ad2b 2020-02-10 08:48:55 +01:00
Bastien e4be72d14b org.el: Fix typo in docstring
* lisp/org.el (org-startup-truncated): Fix typo in docstring.
2020-02-10 00:33:54 +01:00
Bastien 2096c9c76f org.el: Tiny code cleanup
* lisp/org.el (org-fixup-indentation): Remove redundant
`save-excursion'.
2020-02-09 18:25:35 +01:00
Bastien 97269bc6fa Merge branch 'maint' 2020-02-09 17:48:41 +01:00
Bastien a0f3bbd3c2 Revert "org.el: Fix `org-indent-region' bug in source block"
This reverts commit 321b119c44.
2020-02-09 17:48:19 +01:00
Bastien e3b79ad2bf Allow a new value for `org-adapt-indentation'
* doc/org-manual.org (Hard indentation): Add a footnote
mentioning the new value for `org-adapt-indentation'

* etc/ORG-NEWS: Mention the new value for
`org-adapt-indentation'.

* lisp/org.el (org-logbook-drawer-re): New constant.
(org-adapt-indentation): Allow 'headline-data as a new value
to only adapt indentation for headline data.
(org-fixup-indentation, org--get-expected-indentation): Handle
`org-adapt-indentation' set to 'headline-data.

* lisp/org-indent.el (org-indent-mode)
(org-indent-add-properties): Handle `org-adapt-indentation'
set to 'headline-data.

* lisp/org-clock.el (org-clock-in): Call `org-indent-line'
after clock timestamp insertion.
2020-02-09 17:30:42 +01:00
Bastien a62751a6a5 Add `org-clock-toggle-auto-clockout'
* doc/org-manual.org: Document the new command.

* lisp/org-clock.el (org-clock-toggle-auto-clockout): New
command.
2020-02-09 11:17:42 +01:00
Bastien 88794cab06 New option `org-clock-auto-clockout-timer'
* etc/ORG-NEWS (New option ~org-clock-auto-clockout-timer~):
Mention the new option `org-clock-auto-clockout-timer'.

* doc/org-manual.org (Clocking out automatically after some
idle time): Document `org-clock-auto-clockout-timer'.

* lisp/org.el (org-clock-auto-clockout-insinuate): New
function to add a hook for auto-clocking out the current tasks
after `org-clock-auto-clockout-timer' seconds.

* lisp/org-clock.el (org-clock-auto-clockout-timer): New option.
(org-clock-auto-clockout): New function, use the new option.
2020-02-09 11:05:12 +01:00
Bastien 3de19f7c91 org.el: Minor refactoring
* lisp/org.el (org-indent-line): Minor refactoring.
2020-02-09 00:15:30 +01:00
Bastien 08815085fe org-agenda.el: Enhance docstrings
* lisp/org.el (org-loop-over-headlines-in-active-region):
Mention `org-agenda-loop-over-headlines-in-active-region'.

* lisp/org-agenda.el (org-agenda-do-in-region): Use the
`region' face for the selected headline.
(org-agenda-loop-over-headlines-in-active-region): Mention
`org-loop-over-headlines-in-active-region'.
2020-02-08 17:05:50 +01:00
Bastien b7c654575c org-table.el: Use a smaller timer for org table header
* lisp/org-table.el (org-table-header-set-header): Use a
smaller timer, as the header line may not be correctly deleted
otherwise.
2020-02-08 16:16:42 +01:00
Bastien 0e75ebc523 Implement and document looping over headlines in agenda
* doc/org-manual.org (Execute commands in the active region):
New section, documenting both
`org-loop-over-headlines-in-active-region' and
`org-agenda-loop-over-headlines-in-active-region' options.

* etc/ORG-NEWS (Looping agenda commands over headlines): Add
an entry about "Looping agenda commands over headlines".

* lisp/org-agenda.el (org-agenda-do-in-region): New function.
(org-agenda-maybe-loop): New macro.
(org-agenda-kill, org-agenda-archive-default)
(org-agenda-archive-default-with-confirmation)
(org-agenda-archive, org-agenda-archive-to-archive-sibling)
(org-agenda-archive-with, org-agenda-todo)
(org-agenda-set-property, org-agenda-set-effort)
(org-agenda-toggle-archive-tag, org-agenda-date-prompt)
(org-agenda-schedule, org-agenda-deadline)
(org-agenda-add-entry-to-org-agenda-diary-file): Use
`org-agenda-maybe-loop' to DTRT when the region is active.
(org-agenda-loop-over-headlines-in-active-region): New option.
2020-02-08 12:17:40 +01:00
Bastien 64ef211647 org-agenda.el: Fix indentation 2020-02-08 12:17:40 +01:00
Bastien c8947f9b33 org-agenda.el: Fix comment typo
* lisp/org-agenda.el (org-agenda-mark-clocking-task): Fix
comment typo.
2020-02-08 08:30:42 +01:00
Bastien 4e7c3f45b2 Merge branch 'maint' 2020-02-08 07:55:02 +01:00
Robertson, Seth 7e4e34db1d ox-latex.el (org-latex--format-spec): Add :subtitle
* lisp/ox-latex.el (org-latex--format-spec): Add :subtitle.

TINYCHANGE
2020-02-08 07:54:46 +01:00
Jack Kamm c08ce3e2b1 org-faces.el: Add foreground color to org-table-header face
* lisp/org-faces.el (org-table-header): Add foreground color to
org-table-header face, to ensure readability when using a dark theme.
2020-02-08 07:25:29 +01:00
Bastien b13cf9deff Fix 62b9b63af 2020-02-08 07:23:17 +01:00
Bastien 4fe4d12a79 Merge branch 'maint' 2020-02-07 20:44:31 +01:00
Bastien 5fc950a494 org-capture.el: Fix entry template insertion
* lisp/org-capture.el (org-capture-place-entry): Place point
correctly before narrowing the buffer.

* testing/lisp/test-org-capture.el (test-org-capture/entry):
Fix test.

Thanks to Bernt Hansen for reporting this.
2020-02-07 20:43:50 +01:00
Bastien 62b9b63af8 org-table.el: Fix removal of the table header
* lisp/org-table.el (org-table-header-set-header): Ensure the
table header overlay is correctly deleted.  Lessen the timer.
2020-02-07 17:06:38 +01:00