* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Prefer format-prompt
when it is fboundp.
Use format-prompt for many more prompts
66409422214a0a90e1d2a12ef2c4ebf86f2c01a9
Stefan Kangas
Tue Oct 5 03:44:56 2021 +0200
* lisp/org-refile.el (org-refile):
* lisp/org-capture.el (org-capture-store-last-position):
Pass `format` arg to `with-demoted-errors`.
(with-demoted-errors): Warn on missing `format` arg
d52c929e31f60ff0462371bfe27ebd479e3e82bd
Stefan Monnier
Fri Feb 4 19:39:53 2022 -0500
[km] with-demoted-errors has had a format argument since Emacs 24.4.
Passing it avoids an error when compiling with Emacs's current
master (bug#54225). Once that bug is resolved, it will prevent a
warning.
* lisp/org-capture.el (org-capture-fill-template): Changed to use
completing-read-multiple.
* lisp/org.el (org-set-tags-command): Changed to use
completing-read-multiple.
(org-change-tag-in-region): Changed to use a simple completion table.
* testing/lisp/test-org.el (test-org/set-tags-command): Fixed tests.
Change various places which use `completing-read' to read tags using a
custom completion function to instead use `completing-read-multiple'
with a completion table instead.
This makes tab completion play better with alternative completion
frameworks such as vertico, selectrum, etc.
`org-change-tag-in-region' only reads a single tag, so it is changed
to use a completion table with `completing-read'. This also makes it
play better with alternative completion frameworks.
Note that there is still one use for `org-tags-completion-function',
which is for completing tag matches. Completing tag matches is
different from completing lists of tags since the separators (+, -,
etc) have semantic meaning. This commit does not address that use
case.
* lisp/org-capture.el (org-capture-set-target-location): Bind
org-end-time-was-given around the org-read-date call to get a return
value that uses the start time rather than doing custom adjustment of
the return value.
If org-capture-set-target-location detects that the answer to
org-read-date has a time range, it strips the end time from the answer
and calls org-read-date-analyze again. (org-read-date already calls
it underneath.) The regexp it uses, however, can easily match a date,
leading to a bogus result.
org-read-date-analyze is already capable of processing the time range
in a way that matches org-capture-set-target-location's intent: when
org-end-time-was-given is bound, org-read-date-analyze splits off the
end value of the range and stores it in org-end-time-was-given. Drop
the custom logic and let org-read-date-analyze handle the range.
Reported-by: Richard Lawrence <richard.lawrence@berkeley.edu>
Ref: https://orgmode.org/list/87h7obh4ct.fsf@aquinas
* lisp/org-agenda.el: Remove `generated-autoload-file' local
variable.
* lisp/org-capture.el: Ditto.
This is a continuation of a4e6a6fa7 which fixes fae16ed8f.
Reported-by: Andrii Kolomoiets <andreyk.mad@gmail.com>
* lisp/org-capture.el (org-capture-templates): Enhance description and
add 'month' value for :tree-type in description.
* doc/org-manual.org: Fix typo for displaying 'month' in :tree-type
property.
TINYCHANGE
* lisp/org-capture.el (org-capture-place-entry): Fix heading's
position when inserting a template "here" with C-0 M-x org-capture.
Reported-by: david wen riccardi-zhu <dwrz@dwrz.net>
Ref: https://orgmode.org/list/877dscaila.fsf@dwrz.net/
* lisp/org-capture.el (org-capture-templates): Add package-version
keyword for recent changes, removing the now out of date and
unnecessary version keyword.
This option changed in both d06aa486d (Add in support for filling in
the bare link in org capture, 2020-09-14) and 83c93e6fe
(org-capture.el: Give a default value when prompting for a property,
2020-09-23).
* lisp/org-capture.el (org-capture-templates)
(org-capture-fill-template): Enable declaring a default value
when prompting for a property during capture.
* lisp/org.el (org-read-property-value): Add parameter DEFAULT
for an initial/default/suggested property value.
* doc/org-manual.org: Document declaring a default value for a
prompted property during capture.
* doc/org-manual.org: Document new %L capture template formatting
directive.
* lisp/org-capture.el (org-capture-templates): Document new %L capture
template formatting directive.
* lisp/org-capture.el (org-capture-fill-template): Add in support for
%L, bare link formatting, in org-capture-fill-template.
TINYCHANGE
* lisp/org-capture.el (org-capture-finalize): Update
`org-capture-plist' with local-value before finalizing.
We use the global-variable `org-capture-plist' to populate the
local-variable `org-capture-current-plist' on the init of the
`org-capture' buffer. However, we do not do the opposite (i.e. update
the global-variable with the local-variable) on
`org-capture-finalize'.
This is fine for the majority of `org-capture-finalize', since we’re
using the LOCAL arg of `org-capture-get' to read
`org-capture-current-plist' instead of `org-capture-list', but this
trick does not work for `org-capture-after-finalize', since the hook
is run after the `org-capture-buffer' has been closed.
This causes problem with `:kill-buffer t', and it limits what can be
done with cleanup functions in `org-capture-after-finalize'.
See <https://orgmode.org/list/87h7tv9pkm.fsf@hidden/> for details.
* lisp/org-capture.el (org-capture-place-entry): Prevent breaking the
following headline inside the capture buffer. This should match the
behavior from 9.3.
(org-capture-finalize): Reverts cb2774d1a, which solves a similar
problem but only in the finalize stage, so the subtree structure would
still be broken in the middle of editing the capture.
* org-capture.el (org-capture-place-template): Allow
`org-capture-current-plist' access during `org-capture-mode-hook'
Ensure consistency between org-capture's hooks.
`org-capture-after-finalize-hook' is now the only hook that cannot
access `org-capture-current-plist' because the capture buffer is
killed when it is run.
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
* 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.
* 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.
* 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.
* 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.