Commit Graph

16005 Commits

Author SHA1 Message Date
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
Bastien b694c2fd7a Fix org menu initialization
* lisp/org-mobile.el: Add mobile commands to org menu.

* lisp/org-refile.el: Add refile commands to org menu.

* lisp/org.el (org-mode): Remove `org-menu-define'.
(org-org-menu): Delete.
2020-02-07 16:26:31 +01:00
Bastien ec6d01fd49 org-table.el: Implement org table header mode using an overlay
* lisp/org-table.el (org-table-row-get-visible-string): Update
docstring.
(org-table-header-set-header): Use an overlay instead of the
header line.
2020-02-07 03:08:08 +01:00
Bastien 9672a8da98 org-table.el: Use a local hook for table header minor mode
* lisp/org-table.el (org-table-header-set-header): Refactoring.
(org-table-header-line-mode): Use a local hook.
2020-02-07 00:11:33 +01:00
Gustav Wikström a24c8c481f Refactor attachment path expansion
* lisp/org-attach.el (org-attach-link-expand): New function for link
  element expansion.

* lisp/org-element.el (org-element-link-parser): Remove info about
  expanded attachment paths from link elements.

* lisp/ol.el (org-link-open)
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use new link
  expansion function from org-attach.el instead of (now removed)
  custom link property from org-element.el.
2020-02-06 22:09:18 +01:00
Bastien 7d74b5b769 org-table.el: Handle horizontal scrolling for table header
* lisp/org-table.el (org-table-header-set-header): Handle
horizontal scrolling.
2020-02-06 14:19:30 +01:00
Bastien 8f8eac002c Merge branch 'maint' 2020-02-06 07:39:41 +01:00
Bastien 44e7e34ed3 org-agenda.el: Partially revert 19676dce
* lisp/org-agenda.el (org-agenda-show-new-time): Don't use
`org-agenda-previous-line'.

Thanks to Matt Lundin for reporting this.
2020-02-06 07:39:32 +01:00
Bastien beae40edfe Merge branch 'maint' 2020-02-05 15:52:20 +01:00
Bastien f636cf91b6 New org-refile.el file with refile definitions
* lisp/org-refile.el: New file.

* lisp/org.el (org-refile, org-directory)
(org-default-notes-file, org-reverse-note-order)
(org-log-refile, org-refile-targets)
(org-refile-target-verify-function, org-refile-use-cache)
(org-refile-use-outline-path)
(org-outline-path-complete-in-steps)
(org-refile-allow-creating-parent-nodes)
(org-refile-active-region-within-subtree)
(org-refile-target-table, org-refile-cache)
(org-refile-markers, org-refile-marker)
(org-refile-cache-clear, org-refile-cache-check-set)
(org-refile-cache-put, org-refile-cache-get)
(org-outline-path-cache, org-refile-get-targets)
(org--get-outline-path-1, org-get-outline-path)
(org-format-outline-path, org-display-outline-path)
(org-refile-history, org-after-refile-insert-hook)
(org-capture-last-stored-marker, org-refile-keep, org-copy)
(org-refile, org-refile-goto-last-stored)
(org-refile--get-location, org-refile-get-location)
(org-refile-check-position, org-refile-new-child)
(org-olpath-completing-read): Move to org-refile.el.
(org-menu-define): Display Org refile comands only when
'org-refile is featured.

* lisp/org-keys.el (org-refile-copy, org-mode-map): Declare
functions.

* lisp/org-capture.el: Require 'org-refile.

* lisp/org-agenda.el: Require 'org-refile.
2020-02-05 15:34:06 +01:00
Nicolas Goaziou 362cb3cd5d org-element: Fix docstring
* lisp/org-element.el (org-element-at-point): Remove :parent from the
list of always available properties.  This is not true for,
e.g. headlines.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
2020-02-05 15:33:02 +01:00
Bastien c524b7f51a Bump version 2020-02-05 09:36:55 +01:00
Bastien 4e7bd17899 Merge branch 'maint' 2020-02-05 09:10:48 +01:00
Bastien 164d30f5ab org-agenda.el: Fix call to `recenter'
* lisp/org-agenda.el (org-agenda-list): Fix call to `recenter'
when `org-agenda-buffer-name' is not known.
2020-02-05 09:10:40 +01:00
Bastien a645fd8043 org-table.el (org-table-header-set-header): Tiny refactoring
* lisp/org-table.el (org-table-header-set-header): Tiny refactoring.
2020-02-05 09:06:43 +01:00
Bastien c2bc481e3d org-table.el: Enhance `org-table-header-set-header'
* lisp/org-table.el (org-table-header-set-header): Take
scroll-bar into account.

Thanks to Eric Fraga for reporting this.
2020-02-05 08:07:40 +01:00
Bastien 524a6102e5 Merge branch 'maint' 2020-02-05 07:51:55 +01:00
Bastien 07e9ad2aa2 org-agenda.el: Fix for `org-agenda-open-link'
* lisp/org-agenda.el (org-agenda-open-link): Fix opening links
that moves the point in the link buffer.

Thanks to Ihor Radchenko for reporting this.
2020-02-05 07:51:19 +01:00
Bastien e48d106696 Continue previous commit 2020-02-05 01:53:34 +01:00
Bastien c452dc38dc org-table.el: Enhancements to table header mode
* lisp/org-faces.el (org-table-header): New face.

* lisp/org-table.el (org-table-header-set-header): Rename from
`org-table-header-set-line'.  Use the new face.
2020-02-05 01:20:54 +01:00
Bastien ddab73ab54 Fix previous commit 2020-02-05 00:51:09 +01:00
Bastien c1297652be org-table.el (org-table-header-line-mode): Add a lighter
* lisp/org-table.el (org-table-header-line-mode): Add a lighter.
2020-02-05 00:45:17 +01:00
Bastien 280e804ffc Merge branch 'maint' 2020-02-05 00:37:42 +01:00
Bastien 19676dce75 org-agenda.el: Fix `org-agenda-show-new-time'
* lisp/org-agenda.el (org-agenda-show-new-time): Fix infinite
loop while trying to show new time in hidden lines.

Thanks to Andrew Hyatt for reporting this.
2020-02-05 00:36:42 +01:00
Bastien 6ceba7b98f Merge branch 'maint' 2020-02-05 00:14:05 +01:00
Bastien d8c51531c0 org-capture.el: Fix narrowing when placing an entry
* lisp/org-capture.el (org-capture-place-entry): Fix narrowing
boundaries.

Thanks to Gustavo Barros for the detailed bug report.
2020-02-05 00:13:24 +01:00
Bastien 6ec3b993fd Merge branch 'maint' 2020-02-04 19:09:55 +01:00
Bastien 6c895f1466 org-capture.el (org-capture-templates): Fix typos in docstring
* lisp/org-capture.el (org-capture-templates): Fix typos in docstring.
2020-02-04 18:34:25 +01:00
Bastien 04cb76571d org-table.el: Various fixes and enhancements
* lisp/org.el (org-mode): Obey `org-table-header-line-p'.

* lisp/org-table.el (org-table-row-get-visible-string): Fix
handling of shrunk cells.
(org-table-header-set-line): Minor enhancements.  Rename from
`org-table-set-header-line-format'.
(org-table-header-line-mode): Use `org-table-header-set-line'.
2020-02-04 18:14:29 +01:00
Bastien c3d5547642 Merge branch 'maint' 2020-02-04 17:05:34 +01:00
Bastien 321b119c44 org.el: Fix `org-indent-region' bug in source block
* lisp/org.el (org-indent-region): Use `save-window-excursion'
to restore point after indenting region in source blocks.

Thanks to Gustavo Barros for reporting this bug.
2020-02-04 17:04:15 +01:00
Jack Kamm 9b22f597a0 ob-python: Remove unused variable
* lisp/ob-python.el (org-babel-python-evaluate-session): Remove unused
lexical variable `last-indent' that was causing a compilation warning
2020-02-04 06:53:58 -08:00
Bastien 39ead741b3 org.el: Don't hide emphasis markers in comments
* lisp/org.el (org-do-emphasis-faces): Don't hide emphasis
markers in comments.

Thanks to Sebastian Miele for suggesting this.
2020-02-04 09:51:02 +01:00
Bastien 328c9a1af3 org.el: Enhance menus
* lisp/org.el (org-menu-define): New function.
(org-mode): Use it to set up Org menus.
2020-02-04 09:39:13 +01:00
Bastien c46ee2be86 Merge branch 'maint' 2020-02-04 09:24:22 +01:00
Bastien 2cfcdeab96 org.el: Fix `org-[scheduled|deadline]-time-hour-regexp'
* lisp/org.el (org-deadline-time-hour-regexp)
(org-scheduled-time-hour-regexp): Also match habits.

Thanks to Damian for reporting this.
2020-02-04 08:58:15 +01:00
Jack Kamm cc89d5523f ob-python: Fix several issues with :session :results value
* lisp/ob-python.el (org-babel-python-evaluate-session): Fix a few
related issues with :session :results value blocks, including broken
if-else statements, indented blocks with blank lines, and returning
the wrong value when underscore has been used.
(org-babel-python--eval-ast): New constant variable, a string
consisting of Python code to execute a source block using ast.

Previously, python blocks with parameters ":session :results value"
were entered line-by-line into the Python session, which could cause
issues around indentation and new lines.  Now, such python blocks are
written to temp files, then the built-in ast python module is used to
parse and execute them, and to extract the last line separately to
return as a result.  Introduces a change in behavior, requiring that
the last line must be a top-level expression statement if its result
is to be saved (otherwise, the result is None).
2020-02-03 21:17:38 -08:00
Bastien e076ed6e85 Merge branch 'maint' 2020-02-03 21:49:03 +01:00
Bastien cb19f5c94e org-agenda.el: Fix `org-agenda-get-blocks'
* lisp/org-agenda.el (org-agenda-get-blocks): When both dates
are of the same value, assume this is a time to display for
each date in the range.

Thanks to David Masterson for reporting this.
2020-02-03 21:48:06 +01:00
Bastien 917917092d org-table.el: Restore window configuration when debugging formula
* lisp/org-table.el (org-table-eval-formula): Restore window
configuration when debugging table formula is done.

Thanks to Eric Fraga for reporting this.
2020-02-03 20:47:23 +01:00
oldk1331 0eae7a5613 ob-scheme: Handle :epilogue params
Hi all,

This is a simple change that adds support for :epilogue in ob-scheme.

Best wishes,
Qian

==========

* lisp/ob-scheme.el (org-babel-expand-body:scheme): Add :epilogue
  param support.

TINYCHANGE
2020-02-03 20:25:34 +01:00
Bastien 1a29c0eee8 org.el (org-submit-bug-report): Enhance the message
* lisp/org.el (org-submit-bug-report): Enhance the message.
2020-02-03 20:18:57 +01:00
Bastien eace60ad39 Merge branch 'maint' 2020-02-03 18:24:35 +01:00
Bastien 298d633222 org-tempo.el: Fix bug
* lisp/org-tempo.el (org-tempo-add-block): Remove the '>
element of the template to avoid editing the source block
while inserting it through tempo.

Thanks to Ihor and Bram for reporting this and suggesting
the proper fix.
2020-02-03 18:22:55 +01:00
Bastien 77968ce3a3 Revert "org-src.el: Enhance `org-edit-src-code'"
This reverts commit cad2a6a588.
2020-02-03 18:21:26 +01:00
Bastien 7d61bc5bcb org-table.el: Enhance `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Use
'line-number face if relevant.
2020-02-03 13:24:34 +01:00
Bastien 5922dab4b9 Merge branch 'maint' 2020-02-03 13:12:05 +01:00
Bastien cad2a6a588 org-src.el: Enhance `org-edit-src-code'
* lisp/org-src.el (org-edit-src-code): Don't throw an error
when trying to find the source language in a non-interactive
call, typically when called for template expansion.

Thanks to Tyler Smith and Jack Kamm for reporting a related bug.
2020-02-03 13:09:34 +01:00
Bastien a557cfcfc6 org-table.el: Fix `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Skip
non-data rows correctly.
2020-02-03 10:05:52 +01:00
Bastien 06d36ee60b Silent compiler warning 2020-02-02 20:09:17 +01:00
Bastien 4843030b45 Merge branch 'maint' 2020-02-02 20:08:53 +01:00
Bastien 5c72d60d44 Silent compiler warning 2020-02-02 20:07:18 +01:00
Bastien 9ece54ee64 Merge branch 'maint' 2020-02-02 19:39:40 +01:00
Bastien a2b69c58f8 org-agenda.el: Add `org-agenda-end-of-line'
* lisp/org-agenda.el (org-agenda-mode-map): Remap
'move-end-of-line to 'org-agenda-end-of-line.
(org-agenda-end-of-line): New command.

This fixes this bug: when moving to the end of line, if the next
line is hidden, changing the timestamp of the current headline would
not display the new time. This is also safer when archiving subtrees
and when performing actions on agenda headlines in general.
2020-02-02 19:39:26 +01:00
Bastien 8aa206583b org-agenda.el: Fix `org-agenda-filter-hide-line'
* lisp/org-agenda.el (org-agenda-filter-hide-line):
Temporarily set `buffer-invisibility-spec' to `nil'.
2020-02-02 19:30:25 +01:00
Bastien f7bb9ec9b3 Merge branch 'maint' 2020-02-02 17:38:37 +01:00
Bastien efbf96389a org-agenda.el: Fix display of agenda new time
* lisp/org-agenda.el (org-agenda-show-new-time): Compute the
width relatively to the text scale.
2020-02-02 17:38:09 +01:00
Bastien 34b6b425ed Merge branch 'maint' 2020-02-02 14:04:03 +01:00
Bastien 2a5f879c81 org-table.el: Fix message
* lisp/org-table.el (org-table-toggle-coordinate-overlays):
Fix the message sent when coordinates are not displayed.
2020-02-02 14:03:20 +01:00
Bastien eb5ff71c16 org-table.el: Enhance `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Skip
lines setting column widths with <[0-9]+>.

Thanks to Bernard Hugueney for suggesting this.
2020-02-02 12:54:06 +01:00
Bastien d303b6af29 org-table.el: Don't use `if-let' to avoid requiring subr-x.el
* lisp/org-table.el (org-table-row-get-visible-string): Don't
use `if-let' to avoid requiring subr-x.el.
2020-02-01 21:58:28 +01:00
Kisaragi Hiu 4d5731bb33 org.el: Correct docstring
* lisp/org.el (org-effort-property): Correct docstring, as the
previous description of the format was inaccurate.

TINYCHANGE
2020-02-01 17:44:17 +01:00
Bastien 2ba8430b93 Fix previous commit 2020-02-01 17:34:33 +01:00
Bastien fbd8aea6d2 org-table.el: Fixes to `org-table-set-header-line-format'
* lisp/org-table.el (org-table-row-get-visible-string): New
function.
(org-table-set-header-line-format): Use it to handle shrunk
columns.  Also fix handling of `display-line-numbers-mode'.
2020-02-01 17:21:34 +01:00
Bastien 4dcfd7e9db Fix previous commit 2020-02-01 13:18:15 +01:00
Bastien 340bd61777 org-table.el: Check `display-line-numbers-mode' availability
* lisp/org-table.el (org-table-set-header-line-format): Check
whether the `display-line-numbers-mode' command is available.
2020-02-01 13:14:26 +01:00
Jack Kamm dcdb470177 Add inline remote image display
* lisp/org.el (org-display-inline-images): Add inline remote image
display. Remote image display is controlled by the new option
`org-display-remote-inline-images'.
2020-02-01 11:50:08 +01:00
Bastien f704904737 Merge branch 'maint' 2020-02-01 10:16:13 +01:00
No Wayman f33167a0e5 lisp/org-macs.el (org-mks): Respect case
* lisp/org-macs.el (org-mks): Respect case.

This fixes a bug regarding the selection of capture templates.

TINYCHANGE
2020-02-01 10:15:20 +01:00
Bastien 110b034151 Replace "org-table-electric-header" by "org-table-header-line"
* lisp/org-table.el (org-table-header-line-p)
(org-table-header-line-mode): Replace
"org-table-electric-header" by "org-table-header-line".

* doc/org-manual.org (Miscellaneous): Ditto.

Thanks to Samuel Wales for suggesting this name.
2020-02-01 09:52:57 +01:00
Bastien 8651e3ff15 Merge branch 'maint' 2020-02-01 09:45:38 +01:00
Bastien 39c656870c org-agenda.el: Fix handling of one-time delays
* lisp/org-agenda.el (org-agenda-get-scheduled): Fix handling
of one-time delays.

Thanks to hhkg for reporting this.
2020-02-01 09:44:14 +01:00
Bastien c83f889826 org-table.el: Adapt `org-table-set-header-line-format' again
* lisp/org-table.el (org-table-set-header-line-format): Adapt
to `display-line-numbers-mode'.
2020-01-31 21:24:12 +01:00
Bastien fb9eb697d6 org-table.el: Fix `org-table-set-header-line-format' for org-indent-mode
* lisp/org-table.el (org-table-set-header-line-format): When
`org-indent-mode' is turned on, adapt the header's left space
to size of the line prefix.
2020-01-31 21:19:45 +01:00
Bastien 6e944086fb org.el: Tiny formatting fix 2020-01-31 21:17:15 +01:00
Bastien 499cff10ef Merge branch 'maint' 2020-01-31 17:22:01 +01:00
Bastien 04bd110b2b Small fixes
* lisp/ox-odt.el (org-odt--format-timestamp): Fix timestamp
display.

* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Remove
useless code.
2020-01-31 17:21:43 +01:00
Bastien 5e9c3c0794 org.el: Enhance docstrings
* lisp/org.el (org-get-priority)
(org-priority-get-priority-function): Enhance docstring.
2020-01-31 17:12:46 +01:00
Bastien 3d0282ef87 New option `org-archive-subtree-save-file-p'
* lisp/org-agenda.el (org-agenda-archive-with): Bind
`org-archive-from-agenda' to `t' when archiving from agenda.

* lisp/org-archive.el (org-archive-subtree-save-file-p): New option.
(org-archive-subtree): Use the new option.

* doc/org-manual.org (Moving a tree to an archive file):
Mention the new option.

Thanks to Russ Allbery for suggesting a similar idea.
2020-01-31 10:42:40 +01:00
Bastien c9d2f12094 org-agenda.el: Use `user-error'
* lisp/org-agenda.el (org-agenda-priority): Use `user-error'.
2020-01-31 08:36:00 +01:00
Bastien 4f98694bf7 Allow numeric values for priorities
* lisp/org.el (org-priority-highest, org-priority-default):
Allow integer.
(org-priority-get-priority-function): Tiny docstring change.
(org-priority-to-value): New defsubst.
(org--setup-collect-keywords, org-priority-regexp)
(org-priority, org-get-priority): Allow numeric values.

* doc/org-manual.org (Priorities): Illustrate the use of
numeric values for priorities.
2020-01-30 23:01:29 +01:00
Bastien 3942ccec87 ob-screen.el: Silence compiler warning
* lisp/ob-screen.el (org-babel-screen-test): Use `message'.
2020-01-30 18:29:26 +01:00
Bastien 11734ba22a Merge branch 'maint' 2020-01-30 15:41:22 +01:00
Bastien 1d97b730d2 Delete unused variable 2020-01-30 15:40:22 +01:00
Bastien e11f506484 Continue previous commit and document it in etc/ORG-NEWS
* lisp/org.el (org-priority-enable-commands)
(org-priority-highest, org-priority-get-priority-function):
Define aliases.

(org-priority): Use `org-priority-show'.

* lisp/org-agenda.el (org-agenda-priority, org-agenda-menu):
Ditto.
2020-01-30 15:16:44 +01:00
Bastien 1de5e80adf Rename `org-x-priority' functions and variables to `org-priority-x'
* lisp/org.el (org-priority-enable-commands)
(org-priority-start-cycle-with-default)
(org-set-regexps-and-options, org-sort-entries, org-priority)
(org-get-priority, org-entry-properties)
(org-property-get-allowed-values, org-shiftup, org-shiftdown):
Rename `org-[x]-priority' functions and variables to
`org-priority-[x]'.

* lisp/org-pcomplete.el (org-priority-default)
(org-priority-highest)
(pcomplete/org-mode/file-option/priorities): Ditto.

* lisp/org-mouse.el (org-mouse-get-priority)
(org-mouse-priority-list): Ditto.

* lisp/org-agenda.el (org-agenda-fontify-priorities)
(org-agenda-format-item, org-agenda-priority): Ditto.

* lisp/ox-icalendar.el (org-icalendar--vtodo): Ditto.

* doc/org-manual.org (Priorities, Summary of In-Buffer Settings): Ditto.

* testing/lisp/test-org.el (test-org/set-regexps-and-options)
(test-org/entry-properties): Ditto.
2020-01-30 14:56:38 +01:00
Bastien 7b1077def7 Tiny enhancements to priority handling
* lisp/org.el (org-font-lock-add-priority-faces): Use
`org-priority-regexp'.
(org-priority-regexp): Match multiple characters.

* lisp/org-agenda.el (org-agenda-fontify-priorities): Use
`org-priority-regexp'.

This commit paves the way for more flexibility in priority handling.
For example, `org-priority-[up/down]' could deal with priorities as
numbers (e.g. [#1]) instead of letters.
2020-01-30 12:05:07 +01:00
Bastien 759c1567b1 org-table.el: Silence compiler warnings 2020-01-30 11:54:51 +01:00
Bastien 8c943b8403 org-agenda.el: Don't always display a message when removing filters
* lisp/org-agenda.el (org-agenda-filter-remove-all): Only display
a message when called interactively.
2020-01-30 10:24:42 +01:00
Bastien 9fe7dbfd15 org-agenda.el: Small `org-agenda-filter' enhancement
* lisp/org-agenda.el (org-agenda-filter): Use existing filters as
the initial prompt input.
2020-01-29 22:12:55 +01:00
Bastien a7770e6333 Merge branch 'maint' 2020-01-29 21:49:22 +01:00
Bastien 2820c2c4aa org-agenda.el: Minor fixes
* lisp/org-agenda.el (org-agenda-filter): Tiny formatting fix.
(org-agenda-filter-completion-function): Fix docstring typo.
2020-01-29 21:48:58 +01:00
Bastien db3758da92 Merge branch 'maint' 2020-01-29 21:44:05 +01:00
Bastien c2aebcee27 org.el: Fix bug about visibility cycling
* lisp/org.el (org-cycle-internal-local): When cycling visibility
on a subtree, don't take a list has a child.

These two subtrees should cycle the same way:

* A subtree

A Paragraph.

* A subtree

- A list.

Before the fix, the second subtree would cycle through three steps
instead of two.

Thanks to Samuel Wales for reporting this.
2020-01-29 21:39:52 +01:00
Bastien 0aff90f499 Run `org-table-electric-header-mode' with a tiny timer
* lisp/org-table.el (org-table-electric-header-mode): Autoload and
run with timer.
2020-01-29 21:35:04 +01:00
Bastien 57721a1cb0 Handle header line scaling for `org-table-electric-header-mode'
* lisp/org-table.el (org-table-temp-header-remapping): New variable.
(org-table-set-header-line-format): Scale the header line properly.
(org-table-electric-header-mode): Don't run outside `org-mode'.
2020-01-29 17:14:12 +01:00
Bastien b476ffd266 Implement the `org-table-electric-header-mode' minor mode
* lisp/org-table.el (org-table-electric-header-p): New option.
(org-table-temp-header-line, org-table-electric-header-mode): New
variables.
(org-table-set-header-line-format)
(org-table-electric-header-mode): New minor mode to display the
table's current first row as the header line when this first row
is not visible anymore.

* doc/org-manual.org (Miscellaneous): Document
`org-table-electric-header-mode'.
2020-01-29 15:17:32 +01:00
Bastien 0f86a14af3 Silence compiler warning 2020-01-29 15:10:19 +01:00
Bastien 70ef811001 Silence compiler warning 2020-01-29 15:08:33 +01:00
Bastien 241750b3c2 Use `number-to-string' instead of `int-to-string'
* lisp/org.el (org-end-of-subtree): Use `number-to-string' instead
of `int-to-string'.

* lisp/org-table.el (org-table-edit-field)
(org-table-fix-formulas, org-table-analyze, orgtbl-make-binding)
(org-table-field-info): Ditto.

* lisp/org-macs.el (org-shorten-string): Ditto.

* lisp/org-agenda.el (org-get-time-of-day): Ditto.
2020-01-28 20:19:24 +01:00
Bastien e9526b5a79 Enhance C-c C-c in agenda buffers
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c): Don't try to
deactivate columns as `org-columns-toggle-or-columns-quit' is
already bound to `C-c C-c' when the column view is active.

* lisp/org.el (org-ctrl-c-ctrl-c): Update docstring.
2020-01-28 12:44:27 +01:00
Marco Wahl 82ebc73b92 agenda: Refactor key defining section towards more consitency
Unify spaces and use the function quote.
2020-01-28 09:53:15 +01:00
Marco Wahl be0865603a Merge remote-tracking branch 'origin/master' 2020-01-28 09:38:08 +01:00
Kyle Meyer 95a91df825 org-clock: Fix typos in org-show-notification-timeout's docstring
* lisp/org-clock.el (org-show-notification-timeout): Fix docstring
typos.
2020-01-27 23:25:37 -05:00
Marco Wahl 4a43cd983b agenda: Refactor use uniform key definition 2020-01-28 00:38:51 +01:00
Marco Wahl 45a0fe531c agenda: C-c C-c deactivates columns
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c):  New function.

This is to unify and thereby harmonize the behavior of C-c C-c with
regard to Org files and columns.
2020-01-28 00:00:05 +01:00
Marco Wahl b3d1e54877 Merge remote-tracking branch 'origin/master' 2020-01-27 23:46:10 +01:00
Bastien 32eba0f0a6 Merge branch 'maint' 2020-01-27 23:41:56 +01:00