Commit graph

17500 commits

Author SHA1 Message Date
Bastien bee31004bc Merge branch 'bugfix' 2022-04-19 11:27:03 +02:00
Bastien 69c588947d lisp/org.el: Bump version to 9.5.3 2022-04-19 11:24:07 +02:00
Bastien 8aff825682 Revert "org-faces.el: Use fixed-pitch"
This reverts commit 667cb6f1ae.
2022-04-19 11:23:35 +02:00
Ihor Radchenko bebf0bd42d
Merge branch 'bugfix' 2022-04-18 22:58:10 +08:00
Ihor Radchenko 1f617727f1
org-at-timestamp-p: Fix invalid regexp groups for 'agenda scope
* lisp/org.el (org-at-timestamp-p): Make sure that match groups follow
the docstring in `agenda' scope.  Update docstring explaining return
values for sexp timestamps.

Reported in https://orgmode.org/list/CAKJdtO8bqdbW5N6pRFNQRATjm2daEBDCpJj0njwcd4fmhSJSKQ@mail.gmail.com
2022-04-18 22:54:28 +08:00
Kyle Meyer 0ea476ad75 Merge branch 'bugfix' 2022-04-17 15:27:33 -04:00
Kyle Meyer 682ccdfffe org.el: Silence byte-compiler under 'make single' 2022-04-17 15:22:27 -04:00
Ihor Radchenko 685d78f63c
Merge branch 'bugfix' 2022-04-16 18:05:16 +08:00
Ihor Radchenko fa5c832e9b
org-cite-basic--key-completion-table: Reuse bibliography for speed
* lisp/oc-basic.el (org-cite-basic--key-completion-table): Supply the
pre-calculated bibliography entries when getting entry fields.  This
avoids excessive file change checks inside
`org-cite-basic--parse-bibliography'.
2022-04-16 18:04:02 +08:00
Ihor Radchenko 7ddc5b57c0
oc-basic: Speed up cached bibliography retrival
* lisp/oc-basic.el (org-cite-basic--file-id-cache): New variable
storing hash of bibliography file contents.
(org-cite-basic--parse-bibliography): Skip buffer hash calculation
when bibliography file is unchanged on disk.  Calculating buffer hash
on every call is slow when bibliography file is large.

* lisp/org-compat.el:
(org-file-has-changed-p--hash-table, org-file-has-changed-p): Define
`file-has-changed-p' from Emacs 29 if necessary.

See https://list.orgmode.org/LO2P265MB1758E12E04832DC712F5A8E9DC149@LO2P265MB1758.GBRP265.PROD.OUTLOOK.COM/T/#t
2022-04-16 18:04:02 +08:00
Bastien f6813dbea9 lisp/org.el: Don't use lexical scope for diary related evals
* lisp/org.el (org-diary-sexp-entry): Don't use lexical scope for eval
sexps.

This commit partially reverts 6d73cd34a.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
2022-04-07 14:51:26 +02:00
Karl Fogel d80aa2776c
lisp/org-macs.el: Fix spelling of `org-truly-invisible-p'
* lisp/org-macs.el (org-truly-invisible-p): Fix spelling of name.
* lisp/org-compat.el (org-truely-invisible-p): Add compatibility
  alias for the old name.
2022-04-07 12:43:36 +08:00
TEC cbe3f2d697
org-src: add toml and desktop lang aliases
* lisp/org-src.el (org-src-lang-modes): It is reasonable to assume that
src blocks with the "toml" and "desktop" lang should use
`conf-toml-mode' and `conf-desktop-mode', respectively.
2022-04-03 01:01:04 +08:00
Stefan Monnier 6d73cd34a0 Replace all uses of the old defadvice with the new advice-add
* lisp/org.el (org-run-like-in-org-mode): Strength reduce `eval`
to `cl-progv`.
(org--check-org-structure-template-alist): Strength reduce `eval`
to `symbol-value`.
(org-map-entries, org-eval-in-calendar, org-diary-sexp-entry):
Make sure we use the new lexically scoped dialect.
(org--math-always-on): New function, extracted from advice.
(org-cdlatex-mode): Use it with `advice-add`.
(org-self-insert-command): Simplify `and`+`listp` into `consp`.
(org-submit-bug-report):
Make sure we use the new lexically scoped dialect.

* lisp/org-protocol.el (org-protocol-convert-query-to-plist):
Use `cl-mapcan`.
(org--protocol-detect-protocol-server): New function, extracted
from advice.
(server-visit-files): Use it with `advice-add`.

* lisp/org-mouse.el (org--mouse-dnd-insert-text): New function, extracted
from advice.
(dnd-insert-text): Use it with `advice-add`.
(org--mouse-dnd-open-file): New function, extracted from advice.
(dnd-open-file): Use it with `advice-add`.
(org--mouse-open-at-point): New function, extracted from advice.
(org-mode-hook): Advise `org-open-at-point` with `advice-add`.

* lisp/org-ctags.el (org--ctags-load-tag-list): New function, extracted
from advice.
(visit-tags-table): Use it with `advice-add`.
(org--ctags-set-org-mark-before-finding-tag): New function, extracted
from advice.
(xref-find-definitions): Use it with `advice-add`.

* lisp/org-compat.el (org-bookmark-jump-unhide): Accept (unused) args.
(save-place-find-file-hook): Use `advice-add`.
(org--ecb-show-context): New function, extracted from advice.
(ecb-method-clicked): Use it with `advice-add`.
(org-mark-jump-unhide): Accept (unused) args.
(pop-to-mark-command, exchange-point-and-mark, pop-global-mark):
Use `advice-add`.

Along the way, remove some redundant `:group` args
(redundant because they specify the same group as would be used by
default anyway) and make a few other simplifications.
Also don't bother putting `advice-add` within an eval-after-load
since the advice machinery already takes care of handling it.
2022-04-01 07:50:01 +02:00
Bastien d7cae14953 Merge branch 'bugfix' 2022-03-31 17:47:54 +02:00
Bastien 64ee5c2c47 lisp/org-table.el: Fix bug in `org-table-row-get-visible-string'
* lisp/org-table.el (org-table-row-get-visible-string): Don't use
`backward-char' in a function called in a post-command hook.
2022-03-31 17:31:50 +02:00
Bastien 971eb6885e Merge branch 'bugfix' 2022-03-28 14:35:53 +02:00
Bastien 1354e872a7 lisp/ox-html.el: Fix `org-html-style-default'
* lisp/ox-html.el (org-html-style-default): Remove faulty .org-svg css
class specifications.

Reported-by: Yuchen Guo <Guoyuc@students.uni-marburg.de>
2022-03-28 14:34:11 +02:00
Bastien 1bdacbe729 Merge branch 'bugfix' 2022-03-28 14:26:44 +02:00
Nick Dokos 7caae6c088 Fix typo in doc string
* lisp/org-agenda.el (org-todo-list): Fix typo in doc string.
2022-03-28 14:26:26 +02:00
Ihor Radchenko 6304afcaa4
Merge branch 'bugfix' 2022-03-26 15:20:22 +08:00
Ihor Radchenko b1a570b3b4
org-agenda: Fix regression when diary sexp timestamps are ignored
* lisp/org.el (org-at-timestamp-p): Return non-nil on sexp timestamps
when called with 'agenda argument.
* testing/examples/agenda-file.org (test sexp timestamp inside properties):
* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
Add new test checking sexp timestamp inside properties drawer.
2022-03-26 15:17:45 +08:00
Nicolas Goaziou c5ea195c76 Merge branch 'bugfix' 2022-03-23 23:38:50 +01:00
Nicolas Goaziou 667fa06646 oc-biblatex: Remove \relax hack after multicite commands
* lisp/oc-biblatex.el (org-cite-biblatex--multi-arguments): Do not try
to be smart and add \relax{} after multicite commands, as it breaks
csquotes.

Reported-by: Zac E <zac.endter@gmail.com>
<https://list.orgmode.org/8E381952-2AE5-45BF-B142-91DB4B18A26E@gmail.com/T/#t>
2022-03-23 23:18:05 +01:00
Ihor Radchenko c9c0b9d004
Merge branch 'bugfix' 2022-03-22 17:40:49 +08:00
Ihor Radchenko d9bf64f064
org-agenda: Match timestamps inside node properties
* lisp/org-agenda.el (org-agenda-get-timestamps): Use
`org-at-timestamp-p' instead of org-element to check if at valid
timestamp.  Agenda should consider timestamps inside node properties
even though they are not parsed by org-element.

* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
Add new test checking active timestamp inside property drawer.

* testing/examples/agenda-file.org (test timestamp inside properties):
Add heading for `test-org-agenda/property-timestamp'.

Reported in https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com
2022-03-22 17:37:47 +08:00
Ihor Radchenko b7c32d873d
Merge branch 'bugfix' 2022-03-21 15:26:37 +08:00
Samim Pezeshki 847e332301
lisp/org-agenda.el: Fix bug in `org-agenda-highlight-todo'
* lisp/org-agenda.el (org-agenda-highlight-todo): Skip formatting
the to-do keyword when `org-agenda-todo-keyword-format' is the
empty string.

TINYCHANGE
2022-03-21 15:25:13 +08:00
Ihor Radchenko 7e78f664b2
Merge branch 'bugfix' 2022-03-19 16:07:58 +08:00
Ihor Radchenko af6f1298b6
org-mouse: Fix keyword selection menu
* lisp/org-mouse.el (org-mouse-keyword-menu): Fix void-variable error
when selecting todo keyword.

Reported in https://list.orgmode.org/CAFChFyjzuBtr8BeGTb195AVoGbUKFtXf35vvv-r0mzOy0wvZ2Q@mail.gmail.com/T/#u
2022-03-19 16:07:01 +08:00
Kyle Meyer 91681fc033 Merge branch 'bugfix' 2022-03-02 23:04:59 -05:00
Stefan Monnier 668205f769 Backport commit d52c929e3 from Emacs
* 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.
2022-03-02 23:02:50 -05:00
Nicolas Goaziou ef66660cf4 Merge branch 'bugfix' 2022-02-28 15:46:06 +01:00
Nicolas Goaziou bafeaf161c element: Fix parsing of inline footnotes
* lisp/org-element.el (org-element--pair-round-table):
(org-element--pair-square-table):
(org-element--pair-curly-table): De-activate all but one pair of
parenthesis.
* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
Add test.

Reported-by: Greg Minshall <minshall@umich.edu>
<http://lists.gnu.org/r/emacs-orgmode/2022-02/msg00369.html>
2022-02-28 15:45:25 +01:00
Kyle Meyer e822291aca Merge branch 'bugfix' 2022-02-27 23:45:32 -05:00
Kyle Meyer 33543d2aa8 org-link-descriptive: Fix docstring typo
* lisp/ol.el (org-link-descriptive): Drop extra word from docstring.
2022-02-27 23:43:59 -05:00
Kyle Meyer 57362f7414 org-copy-visible: Respect buffer-invisibility-spec
* lisp/org.el (org-copy-visible): Decide whether text is invisible by
calling invisible-p rather than checking whether the invisible
property at point is non-nil.

Text may have a non-nil invisible property but _not_ be hidden from
the user (and thus should be copied by org-copy-visible).  For
example, the link itself is shown when org-link-descriptive is nil,
but it still has an invisible property of `org-link'.
2022-02-27 23:43:59 -05:00
Kyle Meyer f2833ff255 org-copy-visible: Fix handling of adjacent invisible text
* lisp/org.el (org-copy-visible): Don't copy invisible text that
follows invisible text with a different property value.

If org-copy-visible sees that the left bound position has a non-nil
invisible property, it uses next-single-char-property-change to find
the new bound.  However, next-single-char-property-change may just
find a bound that still has a _different_ non-nil invisible property.

Reported-by: "Максим Бабушкин" <maxbabushkin@gmail.com>
Link: https://debbugs.gnu.org/49967
2022-02-27 23:43:59 -05:00
Nicolas Goaziou bb6830409d Merge branch 'bugfix' 2022-02-26 10:25:06 +01:00
David Lukes 83c6eccaee oc-basic: Better handling of CSL-JSON dates
* lisp/oc-basic.el (org-cite-basic--parse-json): Make date-parsing and
year extraction more resilient.  Provide more informative errors when it
fails.

A string-based date is not only indicated by the key 'raw, but also
possibly by the key 'literal.

String-based dates come in various formats, not necessarily yyyy-mm-dd.
So extracting the first sequence of 4 digits is arguably a better
heuristic for getting the publication year than splitting the string on
- and getting the car of that.

On error, include `value' in the message, which contains the original
value with actionable information, whereas the previously included
`date' is always nil in that case.

TINYCHANGE
2022-02-26 10:24:36 +01:00
Juan Manuel Macias 1291e89d2d ox-latex: Add a t' value for :float' in tables and figures
* org-latex--inline-image: default `figure' environment
* org-latex--decorate-table: default table environment
* doc/org-manual.org (Tables in LaTeX export): add `t' and arbitrary
`:float' values
* doc/org-manual.org (Images in LaTeX export): add `t' and arbitrary
`:float' values
2022-02-22 20:10:58 +01:00
Kyle Meyer 6e080e5786 Merge branch 'bugfix' 2022-02-20 14:14:24 -05:00
Kyle Meyer ea6b7451b8 ox: Escape a docstring apostrophe
* lisp/ox.el (org-export-with-smart-quotes): Escape an apostrophe to
prevent it from being displayed as a curved quote in the help buffer.
2022-02-20 13:53:28 -05:00
Ihor Radchenko c5a0113367
org-element-org-data-parser: Fix when invoked from indirect buffer
* lisp/org-element.el (org-element-org-data-parser): Consider base
buffer file name when calculating Org buffer category.
2022-02-20 15:26:11 +08:00
Nicolas Goaziou 37d8bc801e oc-basic: Fix `org-cite-basic--get-author'.
* lisp/oc-basic.el (org-cite-basic--get-author): Allow optional RAW argument.
(org-cite-basic--get-year):
(org-cite-basic--key-completion-table): Make use of new argument.
2022-02-16 13:55:08 +01:00
Ihor Radchenko bc8c3e7795
org-export-link--remote-local-copy: Update docstring
* lisp/ox.el (org-export-link-localise): Make sure that docstring is
narrower than 80 chars.  Clarify the return value when LINK is not a
remote link.
2022-02-14 12:42:57 +08:00
Ihor Radchenko 0cb0760206
org-persist-write:elisp: Do not use `buffer-local-boundp'
* lisp/org-persist.el (org-persist-write:elisp): Use manual
implementation of `buffer-local-boundp' to make things work in Emacs
<28.

Reported in https://list.orgmode.org/87k0dyqy3d.fsf@kyleam.com/T/#u
2022-02-14 12:41:37 +08:00
Nicolas Goaziou fe4a60dffa oc-basic: Fallback to editor when author is not available
* lisp/oc-basic.el (org-cite-basic--get-author): New function.
(org-cite-basic--get-year):
(org-cite-basic--print-entry):
(org-cite-basic--format-author-year):
(org-cite-basic-export-citation):
(org-cite-basic--key-completion-table): Use new function.

Suggested-by: psychosis <psychosis@disroot.org>
<http://lists.gnu.org/r/emacs-orgmode/2022-02/msg00006.html>
2022-02-13 22:27:47 +01:00
Nicolas Goaziou 6ac5e0adc8 Merge branch 'bugfix' 2022-02-13 22:14:55 +01:00
Nicolas Goaziou 17e4fe9093 lint: Fix false positive with inline footnote definitions
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template):
Take into consideration inline definitions.
* testing/lisp/test-org-lint.el (test-org-lint/undefined-footnote-reference):
Add test.

Reported-by: Timothy <tecosaur@gmail.com>
2022-02-13 22:13:41 +01:00