Commit Graph

22891 Commits

Author SHA1 Message Date
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 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
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 6381fc96cf Delete obsolete utilities
mk/fake_change_log.pl
mk/git-changelog
mk/make_emacs_changelog
mk/set-version.pl
2020-02-18 23:46:22 +01:00
Bastien 45f6844cdf mk/org-fixup.el: Create autoloads from ol*.el files too
* mk/org-fixup.el (org-make-org-loaddefs): Create autoloads from
ol*.el files too.
2020-02-18 23:46:10 +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
Nicolas Goaziou 2d21d2080c org-list: Add tests for `org-at-radio-list-p'
* testing/lisp/test-org-list.el (test-org-list/at-radio-list-p): New
test.
2020-02-17 00:50:10 +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 1d8d83d875 etc/ORG-NEWS: Add more details on ob-clojure.el enhancements 2020-02-17 00:12:48 +01:00