Commit Graph

23725 Commits

Author SHA1 Message Date
Ihor Radchenko 14fb761d78
Do not use mark-whole-buffer noninteractively
* lisp/org.el (org-fill-element): `mark-whole-buffer' introduced in
7b85a64da is only for interactive use and causes compiler warning.
Replace it using noninteractive commands.
2021-09-27 22:28:45 +08:00
Bastien d13556e5ed lisp/org.el (org-return): Enable `delete-selection'
* lisp/org.el (org-return): Enable `delete-selection'.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
<https://list.orgmode.org/87zgvz6lz7.fsf@gmail.com/>
2021-09-27 14:47:11 +02:00
Bastien 529a1bd829 doc/org-manual.org: Reintroduce lost footnote definition.
* doc/org-manual.org (Footnotes): Reintroduce lost footnote
definition.

Reported-by: Tim Landscheidt <tim@tim-landscheidt.de>
<https://list.orgmode.org/877dhx2qzj.fsf@vagabond.tim-landscheidt.de/>
2021-09-27 12:01:07 +02:00
TEC 6a558fc17b
org: Fix potential modified src match-data issue
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): When this is run on
a src block, a "leaky" major mode called in
`org-src-font-lock-fontify-block' can modify the match data.
This is problematic, as the match data already set is important for
font-lock.  To protect ourselves from this behaviour, we can wrap
`org-src-font-lock-fontify-block' in `save-match-data' to ensure that
the match data for the src block is conserved.
2021-09-26 19:00:47 +08:00
Ihor Radchenko 05ee1e6ee0 Do not rely on M-q binding for filling src-block
* lisp/org.el (org-fill-element): Use `fill-paragraph' instead of
simulating "M-q" binding.
(org-fill-paragraph): Return t as described in `fill-paragraph'
docstring.

Fixes https://orgmode.org/list/CAH7LOt0PO3js6_+Cbinm6EYNx0KFvpfiSS7Dwc1EXsfHfHkHVA@mail.gmail.com/
2021-09-26 09:04:46 +02:00
Ihor Radchenko 0b4e357d62 Avoid creating ID property during tangling
* lisp/ob-tangle.el (org-babel-tangle-single-block,
org-babel-tangle-comment-links): Suppress org-id-link-to-org-use-id
during tangling.  The links used during tangle process are transient
and do not really need to use ID.  Using ID may create unexpected
edits in the tangled Org buffer when org-id-link-to-org-use-id is set
to t.  Fixes [1].

[1] https://orgmode.org/list/9eb31da73b12fcaf6820484834cc8cd3@libre.brussels/T/#t
2021-09-26 08:59:24 +02:00
Ihor Radchenko f7d6db1bf6 org-bibtex-read: Do not add nil when there is no entry at point
* lisp/ol-bibtex.el (org-bibtex-read): Previously, when there is no
entry at point, `nil' would be added to `org-bibtex-entries' causing
errors later, i.e. upon calling org-bibtex-write.  Now, nil is never
pushed to `org-bibtex-entries'.

Fixes https://orgmode.org/list/874kd3288n.fsf@yandex.com
2021-09-26 08:57:16 +02:00
Bastien dbbb93dfdf lisp/org-table.el: Fix positioning of "#+TBLFM:
* lisp/org-table.el (org-table-store-formulas): Fix positioning of
"#+TBLFM:".

Reported-by: tbanelwebmin <tbanelwebmin@free.fr>
<http://list.orgmode.org/43910853-03cb-c226-f46d-4736d0e6cca6@free.fr>
2021-09-26 08:53:36 +02:00
Ihor Radchenko aea7cab707 Fix duplicate logbook entry for repeated tasks
* lisp/org.el (org-add-log-setup): Always run `org-add-log-note' via
`post-command-hook'.  Otherwise, there is no way to know if a note was
requested for `this-command'.  Running `org-add-log-note' directly
would, for example, break `org-auto-repeat-maybe' as reported in [1].

[1] https://orgmode.org/list/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com
2021-09-26 08:24:58 +02:00
Ihor Radchenko e23815ba61 Correctly handle org-log-note-clock-out non-interactively
* lisp/org-clock.el (org-clock-out): Delay log popup to
after-command-hook to avoid messing up non-interactive calls.
`org-add-log-setup' without 'note argument would raise interactive
note buffer immediately, so we do pass the 'note argument.
2021-09-26 08:02:15 +02:00
Ihor Radchenko 97de19f659 Fix not updating org-clock-marker after refiling from indirect buffer
* lisp/org.el (org-check-and-save-marker): Save markers in base buffer
of indirect buffer in addition to markers in current buffer.

Fixes bug reported in https://orgmode.org/list/CABa5=g4bvYQoTbBn96tFi9K827u_A+MweqYWWpib_tyFLBdG3g@mail.gmail.com/T/#t
2021-09-25 23:09:37 +02:00
Nicholas Vollmer d8b9bd05ba Fix byte-comp function warnings
* (org.el, org-table.el org-keys.el) Declare functions for byte compiler.
2021-09-25 21:30:32 +02:00
Marco Wahl bf22d98f99 CONTRIBUTE: Update to follow the new structure of doc/ 2021-09-25 21:30:20 +02:00
Ihor Radchenko 399481bad1 Do not ignore user-defined display-buffer-alist in org-insert-link
* lisp/ol.el (org-insert-link): Handle case when *Org Links* window is
not created.
* lisp/org-macs.el (org-no-popups): Do not override
`display-buffer-alist'. Use `pop-up-windows' instead.
2021-09-25 18:17:32 +02:00
Max Nikulin ec7c16a060 ox-latex: Allow percent sign in 'src-block' caption
* lisp/ox-latex.el (org-latex-src-block): Prevent leak of percent sign
from caption to `format' first argument causing export failure due to
insufficient argument number.  The fix covers only the case of verbatim
environment.
* testing/lisp/test-ox.el
(test-org-export/latex-src-block-verbatim-caption): New test for src
block LaTeX export with cases of various formatting of caption and
verbatim environment.  Check that percent signs in caption and source
block body do not lead to errors.

Reported-by: Charest, Luc <charest.luc@hydroquebec.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2021-08/msg00017.html>
2021-09-25 18:02:08 +02:00
Ihor Radchenko 6a2c48704b Avoid infinite loop in org-agenda-dim-blocked-tasks
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): When the blocked
task is the last line in agenda buffer and no trailing newline is
present, (move-beginning-of-line 2) would not move the point causing
infinite loop.  Now, such case is handled correctly.
2021-09-25 17:16:38 +02:00
Maxim Nikulin 3f5605e66c org-agenda.el: Avoid dependency on subr-x
* lisp/org-agenda.el (org-agenda-highlight-todo): Do not use `string-empty-p'.

Restore compatibility with Emacs-24.3.
2021-09-25 15:53:07 +02:00
Bastien 413060b471 CONTRIBUTE: Fix merge leftover 2021-09-25 15:24:57 +02:00
Bastien a33ad982f5 CONTRIBUTE: Fix link for cloning as a contributor 2021-09-25 15:22:43 +02:00
TEC 4a11766cac docs: Update outdated code.orgmode.org links
* CONTRIBUTE, docs/org-manual.org, docs/ORG-NEWS: Replace mentions
of https://code.orgmode.org with references to the new repository
on Savannah (https://git.savannah.gnu.org).
2021-09-25 15:13:25 +02:00
Bastien bea172ae99 mk/default.mk: Use the Emacs manual css 2021-09-25 11:36:39 +02:00
Bastien 268a4330ad mk/server.mk: Use a new path
This prepares the migration out of the current orgmode.org server.
2021-09-25 11:19:26 +02:00
Bastien 4be129f543 doc/Makefile: Clean up *.info files too
Continue 9802877fb by cleaning up *.info files and removing
duplicate *.html pattern.
2021-09-12 18:05:37 +02:00
Nicolas Goaziou dcc3a84a98 keys: Re-instate some RET bindings
* lisp/org-keys.el (org-mode-map): Re-instate S-RET and M-S-RET, which
are not translated from S-<return> and M-S-<return>, unlike
M-<return>/M-RET.

This is a followup to ee652a47df.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
2021-07-31 10:55:01 +02:00
Amin Bandali 1ee52c5eb6 Backport commit 348b2aed0 from Emacs
Update IRC-related references to point to Libera.Chat
348b2aed0c8c3630be4c15c8e70acf7ea9c023af
Amin Bandali
Sat Jul 3 23:39:18 2021 -0400
2021-07-11 22:40:57 -04:00
Nicolas Goaziou ee652a47df org-keys: Remove fancy RET keybindings
There is no such binding as "S-RET", and "ESC ..." is translated to
"M-..." in both GUI and TUI. Finally, "M-<return>" is translated to
"M-RET" so we shouldn't use the former.
2021-07-02 16:01:05 +02:00
Nicolas Goaziou 565361eb69 org-keys: Do not bind <tab>, ever
Fixes: `org-mode-map` binds `<tab>` which is unnecessary and harmful,
since it takes precendence over bindings of TAB even in keymaps with
higher precedence.

Reported-by: Daniel Mendler <mail@daniel-mendler.de>
2021-07-01 12:11:28 +02:00
Ingo Lohmar 80374642e2 agenda: Fix timestamp agenda setting global agenda name
* lisp/org.el (org-follow-timestamp-link): Do not set global agenda name.

The tmp value for the agenda buffer name is used in `org-agenda-list'
to set `org-agenda-buffer-name'.  Wrap the call in a let-binding for
this symbol (like the agenda dispatcher does), since otherwise it
inadvertently sets the global value.
2021-06-30 22:02:57 +02:00
Nicolas Goaziou c09356548f agenda: Fix `org-get-time-of-day' on empty string
* lisp/org-agenda.el (org-get-time-of-day): Ensure S is not empty
before calling `get-text-property'.

This regression was introduced in aba1f2066.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>
2021-06-20 18:07:01 +02:00
Nicolas Goaziou 15badb32b7 agenda: Fix org-duration-to-minutes error (take 4)
* lisp/org-agenda.el (org-get-time-of-day): Fix regexp.

This is a followup to aba1f20661.
2021-06-18 14:12:08 +02:00
Nicolas Goaziou aba1f20661 agenda: Fix org-duration-to-minutes error (take 3)
* lisp/org-agenda.el (org-agenda-format-item): Call
`org-get-time-of-day' twice. Once to get proper time information, and
a second time to format it.
(org-get-time-of-day): Remove an optional argument.  Extend the one
left, and document it.  Rewrite function.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<https://orgmode.org/list/87lf84408r.fsf@ucl.ac.uk/>
2021-06-17 19:23:36 +02:00
Nicolas Goaziou 093c94e31b texinfo: Fix off-by-one error
* lisp/ox-texinfo.el (org-texinfo--menu-entries): Fix off-by-one
error.

This is a follow-up to f99f26306c.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg01290.html>
2021-06-02 17:21:15 +02:00
Bhavin Gandhi 37f69bf86d org-refile: Fix double slashes in the refile targets
* org-refile.el (org-refile-get-location): When we generate the `tbl'
variable, we add extra slash depending on the value of
`org-refile-use-outline-path'.  This patch updates some locations which
add another extra slash assuming the target did not have it.

`org-refile--get-location' does lookup for entries with and without
slash, so it was not causing any issues before.  It works as it is now
as well.

Thanks to Gustavo Barros for a very detailed bug report.

TINYCHANGE
2021-05-25 02:13:43 +02:00
Sun Lin 21eb69c413 org-agenda-files: Work with relative file paths
* lisp/org.el (org-agenda-files): Make sure org-agenda-files work with relative
file paths.

TINYCHANGE
2021-05-21 18:30:06 +02:00
Nicolas Goaziou 13c78a5900 footnote: Allow new footnotes in empty cells
* lisp/org-footnote.el (org-footnote--allow-reference-p): allow
inserting new footnotes in empty cells.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add
tests.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00940.html>
2021-05-20 15:44:27 +02:00
Bastien 6524301288 mk/server.mk: Complete and fix 9802877fb 2021-05-19 14:26:26 +02:00
Bastien ab9f2af34f lisp/org.el: Bump version number
* lisp/org.el: Bump version number.
2021-05-19 14:16:18 +02:00
Sébastien Miquel 857ae366b3 org.el (org-src--contents-for-write-back): Indent blank lines
* lisp/org.el (org-src--contents-for-write-back): Indent blank lines.
* lisp/org-src.el (org-return): Revert part of commit bfda3cc7df.
2021-05-18 16:06:27 +02:00
Bastien a34d71560b Revert "lisp/org-agenda.el: Let tags-todo searches include DONE keywords"
This reverts commit 823f9744e9.
2021-05-17 07:18:35 +02:00
Bastien 823f9744e9 lisp/org-agenda.el: Let tags-todo searches include DONE keywords
* lisp/org-agenda.el (org-agenda, org-agenda-run-series): Don't
set the todo-only parameter to '(4) when calling `org-tags-view'.

Reported-by: Stig Brautaset <stig@brautaset.org>
Link: https://orgmode.org/list/m2ftazm3l1.fsf@brautaset.org/

This completes 2fb129b5c, as per Kyle's analysis here:
https://orgmode.org/list/87r1ufmw72.fsf@kyleam.com/
2021-05-17 00:49:32 +02:00
Bastien c670379adf Fix `org-agenda-todo' undo behavior when logging (not adding note)
* lisp/org.el (org-log-setup): New variable.
(org-auto-repeat-maybe): Check against `org-log-setup' if we are
currently logging.
(org-add-log-setup): Only use `post-command-hook' when logging a
note, otherwise use `org-log-setup'.
(org-add-log-note): Reset `org-log-setup' to nil.
(org-store-log-note): Remove useless code.

* lisp/org-agenda.el (org-agenda-bulk-action): Check
`org-log-setup' instead of `post-command-hook'.

This is a more correct fix that supersedes the previous attempt with
08a47b09 for the same problem.

Reported-by: Warren Lynn <wrn.lynn@gmail.com>
Link: https://orgmode.org/list/87v98a8mes.fsf@gnu.org/
2021-05-17 00:14:31 +02:00
Sébastien Miquel a9af1faaa1 org-src.el (org-edit-src-exit): Fix write-back-buf not getting killed
* lisp/org.el (org-edit-src-exit): Fix write-back-buf not getting
killed
2021-05-16 21:52:15 +02:00
Nicholas Savage 8cf704e3fe lisp/org.el: Fix org-update-statistics-cookies error
* lisp/org.el (org-update-statistics-cookies): Replace
usage of `org-map-entries' with `org-map-region' to prevent bug where
an error was thrown if the current buffer had not yet been saved to disk.

Formatted from a patch proposal by mail@kisaragi-hiu.com
Reported-by: mail@kisaragi-hiu.com
2021-05-16 21:41:32 +02:00
Sébastien Miquel d65ae82f4b lisp/org-src.el: Continue the previous fix (d02ad1f2)
* lisp/org-src.el (org-src--contents-for-write-back): Shorten the
first line of the docstring.
(org-edit-src-exit): Conditionnally kill the write-back buffer.
2021-05-16 14:10:04 +02:00
Sébastien Miquel d02ad1f207 lisp/org-src.el: Use `replace-buffer-contents'
* lisp/org-src.el (org-src--contents-for-write-back): Use a write
back buffer.

* lisp/org-src.el (org-edit-src-exit, org-edit-src-save): Use
`replace-buffer-contents'.

Reported-by: "Sébastien Miquel" <sebastien.miquel@posteo.eu>
Link: https://orgmode.org/list/603f9c4e-c621-7592-5b20-a7354c11d5d2@posteo.eu/
2021-05-16 14:01:57 +02:00
Bastien 9802877fbe doc/Makefile: Use the .info extension for org.info and orgguide.info
* doc/Makefile (install): Use the .info extension when generating
info files (org.info and orgguide.info).
2021-05-16 10:36:02 +02:00
Nicolas Goaziou 8846ea71fa element: Fix drawer parsing
* lisp/org-element.el (org-element-drawer-parser): A single ":END:"
line should not be recognized as a drawer.
* testing/lisp/test-org-element.el (test-org-element/drawer-parser):
Add test.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00819.html>
2021-05-16 10:14:54 +02:00
Nicolas Goaziou 589962b730 lisp/org.el: Fix bug in `org-sort-remove-invisible'
* lisp/org.el (org-sort-remove-invisible): Rewrite using
`org-element-interpret-data' to clean invisible parts more
rigorously.

Link: https://orgmode.org/list/87a6qg1rjx.fsf@posteo.net/
2021-05-16 07:48:01 +02:00
Bastien e860fbf22a lisp/org-list.el: Fix bug wrt updating statistics
* lisp/org-list.el (org-update-checkbox-count): Don't update
statistics when toggling a checkbox witin a heading that has
COOKIE_DATA set to "todo".

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
Link: https://orgmode.org/list/CALn3zohYfoyDm6w-AYWsVRSbOCndBPZQyb+YvHcaEby3JEhWMw@mail.gmail.com
2021-05-15 22:03:47 +02:00
mosquito-magnet 307e722dd9 org-agenda.el: Fix clocking issues regex
* org-agenda.el (org-agenda-show-clocking-issues): Fix regex
to prevent false-positive clocking issue detection.

Regex was missing a grouping to restrict the alternative \| to the
literal parentheses.

TINYCHANGE
2021-05-15 16:18:58 +02:00