Commit graph

26222 commits

Author SHA1 Message Date
Ihor Radchenko fe92a3cedb
Provide a uniform way to inform users about missing third-party packages
* lisp/org-macs.el (org-require-package): New macro trying to load a
library and displaying custom error message or warning on failure.
The actual package (not library) name can be provided as optional
argument.

* lisp/ob-R.el (org-babel-R-initiate-session):
* lisp/ob-clojure.el (ob-clojure-eval-with-inf-clojure):
(ob-clojure-eval-with-cider):
(ob-clojure-eval-with-slime):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-haskell.el (org-babel-interpret-haskell):
(org-babel-haskell-initiate-session):
* lisp/ob-js.el (org-babel-execute:js):
(org-babel-js-initiate-session):
* lisp/ob-julia.el (org-babel-julia-initiate-session):
* lisp/ob-lisp.el (org-babel-execute:lisp):
* lisp/ob-ocaml.el (org-babel-prep-session:ocaml):
* lisp/ob-octave.el (org-babel-octave-initiate-session):
* lisp/ob-processing.el (org-babel-processing-view-sketch):
* lisp/ob-ruby.el (org-babel-execute:ruby):
(org-babel-ruby-initiate-session):
* lisp/ol-bbdb.el (org-bbdb-open):
(org-bbdb-complete-link):
(org-bbdb-anniv-export-ical):
* lisp/org-agenda.el:
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org.el:
* lisp/ox-ascii.el (org-ascii-table):
* lisp/ox-html.el (org-html-htmlize-generate-css):
* lisp/ox-org.el: Use the new macro.

* lisp/oc-csl.el: Add FIXME. oc-csl uses a custom function doing
similar job.

* lisp/ob-js.el (org-babel-js-initiate-session): Add FIXME noting that
the third-party package is outdated.
2023-02-17 17:09:23 +03:00
Ihor Radchenko 18a146a9d5
org-fold-core-previous-visibility-change: Fix edge case
* lisp/org-fold-core.el (org-fold-core-next-visibility-change): Take
into account that `previous-single-char-property-change' move the
point to the first position where the property is still unchanged.
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Ignore invisibility when skipping subtree.

Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
Link: https://orgmode.org/list/96becf12-9a5a-2fc2-0105-a41528be1f66@gmail.com
2023-02-17 14:58:32 +03:00
Ilya Chernyshov 715f74db36
org-manual.org: Update timestamp and timerange definitions
* doc/org-manual.org (Timestamps): Document that time specification of the
form <2023-02-17 Fri 10:00-12:00> is not a timestamp, but a timerange.
2023-02-17 14:08:37 +03:00
Ihor Radchenko fff9239dc1
Merge branch 'bugfix' 2023-02-17 13:41:18 +03:00
Ihor Radchenko eea8da0315
Fix some compiler warnings
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/org-agenda.el (org-agenda-format-item):
* lisp/org-element.el (org-element-cache-map): Do not use `eq' when
matching for equality by contents.
2023-02-17 13:38:54 +03:00
Rudolf Adamkovič 99c8ed09f8
ox-texinfo: Fix invalid syntax in Texinfo version detection code
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Fix the incorrect
syntax @displaymath{1 + 1 = 2} used to detect whether Texinfo supports
TeX "math mode".  Instead, use the correct syntax @math{1 + 1 = 2}.
2023-02-17 13:30:16 +03:00
Ihor Radchenko 74eb0f8bc9
Merge branch 'bugfix' 2023-02-15 18:31:04 +03:00
Ihor Radchenko be9280f68b
org-cycle-set-visibility-according-to-property: Fix folded newline before
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Make sure that folded newline before heading is revealed.

Reported-by: Daniel Hubmann <hubisan@gmail.com>
Link: https://orgmode.org/list/CAOX7s=3NTjpvnFDfwBdozLbLCWANLbCCyCbQNOnNsnMqqFEF3g@mail.gmail.com
2023-02-15 18:28:33 +03:00
Ihor Radchenko 6b0c2775f0
org-persist-associated-files:file: Fix when container has been deleted
* lisp/org-persist.el (org-persist-associated-files:file): Do not err
when `org-persist-read' returns nil (failed to read).
2023-02-14 23:08:58 +03:00
Jack Kamm e6353d5b9c ob-python: Remove debugging print statement
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Remove
old print statement that was added for debugging.
2023-02-11 13:18:09 -08:00
Ihor Radchenko 1f332d6c5c
* lisp/org-clock.el: Remove completed FIXME 2023-02-11 14:55:28 +03:00
Kevin Brubeck Unhammer d2952e14d9
org-clock-clocktable-language-setup: Add a Norwegian translation
* lisp/org-clock.el (org-clock-clocktable-language-setup): Add
Norwegian Nynorsk translation.

Link: https://orgmode.org/list/87k00z1090.fsf@fsfe.org
2023-02-11 14:55:05 +03:00
Kevin Brubeck Unhammer bd34cb3f95
org-export-dictionary: Add Norwegian translations
* lisp/ox.el (org-export-dictionary): Add some translations.

Link: https://orgmode.org/list/87ilgj2jza.fsf@fsfe.org
2023-02-11 14:50:18 +03:00
TEC 02ae908b03
oc: Add org-cite-processor function
* lisp/oc.el (org-cite-processor): As a counterpart to the other cite
information accessor functions, add `org-cite-processor`.
2023-02-11 01:38:41 +08:00
TEC 663e200f54
ox: Document the setting of :parse-tree
* lisp/ox.el (org-export--annotate-info,
org-export--collect-tree-properties): Mention in comments the setting of
:parse-tree.
2023-02-11 01:38:41 +08:00
TEC 4fbd302df6
ox: Split up the org-export-as function
* lisp/ox.el (org-export--annotate-info, org-export-as): Separate out
the info-collection phase of `org-export-as' into a new function,
`org-export--annotate-info'.
2023-02-11 01:32:33 +08:00
Ihor Radchenko 6d37d2a8e7
* mk/targets.mk(GITVERSION): Provide commit number for shallow clones
Fall back to using git describe --always when git describe fails in
Org repo.

See https://orgmode.org/list/87bkmve8qv.fsf@gmail.com
2023-02-10 16:18:51 +03:00
Ihor Radchenko 9e9669a271
Merge branch 'bugfix' 2023-02-10 14:43:41 +03:00
Ihor Radchenko af1bb1b06a
org-compat: Work around Emacs bug#60467
* lisp/org-compat.el (version<): Use stub version of
`combine-change-calls' when it does not exist yet in Emacs or when it
is known to have a critical bug.  Use `org-combine-change-calls'
instead of overwriting the macro system-wide.
* lisp/org-footnote.el (org-footnote-sort):
* lisp/org.el:
(org-demote-subtree):
(org-paste-subtree): Use the new macro name.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/87ilhq74j8.fsf@localhost
2023-02-10 14:37:09 +03:00
Alan Schmitt 666a61bcc8
lisp/ox-beamer.el: add labels to latex export
* ox-beamer.el (org-beamer-environments-default): add label escape to
some environments
(org-beamer--format-block): generate label string for label escape
(org-beamer-environments-extra): document label escape

A new escape %l is available to be used in `org-beamer-environments-*'
to insert the label of the current block, obtained using
`org-babel--get-label'
2023-02-10 13:55:18 +03:00
Aaron L. Zeng 739ccf6cbf
org--batch-store-agenda-views: Fix treatment of lambda functions
* org-agenda.el (org--batch-store-agenda-views): Fix treatment of
lambda functions used as custom agenda commands.
`org-agenda-custom-commands' entries may specify a custom function
instead of a symbol like `tags-todo'.  `org--batch-store-agenda-views'
behaved differently from `org-agenda' when that custom function was
defined as a lambda rather than a symbol, incorrectly treating the
lambda form as a list of agenda commands.  Instead, use the same test
as `org-agenda' does to determine whether the command is a series.

TINYCHANGE
2023-02-09 12:59:24 +03:00
Ihor Radchenko 5d548c34fa
org-manual.org: Clarify what org-timestamp-up'/org-timestamp-down' does
* doc/org-manual.org (Clocking commands): Fix and add missing findex
entries.  Explain that only clocks recorded during current Emacs
session are considered when adjusting neighboring timestamps.

Reported-by: Robert Nikander <robert.nikander@icloud.com>
Link: https://orgmode.org/list/830BAEAD-AA4C-4226-A93E-1329B41194D7@icloud.com
2023-02-09 12:55:50 +03:00
Ihor Radchenko 6cbbf4cdbf
org-link-abbrev-alist: Fix :safe predicate
* lisp/ol.el (org-link-abbrev-alist): Check every element in the
alist when considering :safe values.

Reported-by: Qiantan Hong <qthong@stanford.edu>
Link: https://orgmode.org/list/950326F5-F72D-4F51-A946-F37E96971B08@stanford.edu
2023-02-08 16:44:34 +03:00
Ihor Radchenko c8a5fef910
Preserve active region after structure edits
* lisp/org-list.el (org-list-indent-item-generic):
* lisp/org.el (org-do-promote):
(org-do-demote): Do not deactivate mark after edits.
(org-metadown):
(org-metaup): Do not deactivate mark and do not exchange point and
mark in region.
* etc/ORG-NEWS (Datetree structure headlines can now be complex):
Announce the change.
2023-02-04 16:49:54 +03:00
Ihor Radchenko b665f8de31
org-metaup, org-metadown: Move subtrees in active region
* lisp/org.el (org-metaup):
(org-metadown): When active region contains headings, move the
containing subtrees according to the selection.  Do not deactive
region.
* testing/lisp/test-org.el (test-org/move-subtree): Add test.
* etc/ORG-NEWS (~org-metaup~ and ~org-metadown~ now act on headings in
region): Announce the new features.
2023-02-04 16:49:30 +03:00
Ihor Radchenko 581df107b0
org-clock-sum: Fix Emacs 26 compatibility after 2e901ed23
* lisp/org-clock.el (org-clock-sum): Use backwards-compatible
`org-encode-time'.
2023-02-04 13:46:23 +03:00
Ihor Radchenko ec5d76bce1
Merge branch 'bugfix' 2023-02-03 18:01:47 +03:00
Ihor Radchenko 657cb58f10
org-set-modules: Fix when called before org-element is loaded
* lisp/org.el (org-set-modules): Add `require' needed to ensure that
`org-element-cache-reset' is available.
2023-02-03 17:57:38 +03:00
Ihor Radchenko 2e901ed236
org-clock-sum: Optimize performance
* lisp/org-clock.el (org-clock-sum): Do not re-parse the timestamps,
reusing already-parser element.
2023-02-03 15:10:45 +03:00
Ihor Radchenko 0522c1850b
org-read-property-value: Fix DEFAULT arg when values are not restricted
* lisp/org.el (org-read-property-value): Honor DEFAULT argument when
property can have arbitrary value.

Reported-by: Janek F <xerusx@pm.me>
Link: https://orgmode.org/list/hh0ohv2LgPq86aW2Kp4AFV1VZ3yLuZafFLFqWN_NCciQcy86rxDkcZryr7gyPXrNzjFdP8lhdC0GS4c_XQtVXjOKDD-lqkJjlswSGX7OWvo=@pm.me
2023-02-03 14:42:35 +03:00
Ihor Radchenko 562cba7aab
Merge branch 'bugfix' 2023-02-03 14:29:32 +03:00
Liu Hui 3e23b8976e
org-agenda: Fix `org-agenda-filter-by-category'
* lisp/org-agenda.el (org-agenda-filter-by-category): Use
`org-agenda-get-category' to get the category at current line.

Link: https://orgmode.org/list/CAOQTW-MHsnEak_Oj_iyKBsnm6_j4WzOgThM_58a__uu10KenbQ@mail.gmail.com
2023-02-03 14:28:22 +03:00
Ihor Radchenko a411192c11
Merge branch 'bugfix' 2023-02-03 14:21:11 +03:00
Ihor Radchenko f33d241082
org-manual: Fix typos
* doc/org-manual.org (Property Syntax):
(Bulk remote editing selected entries):
(The Export Dispatcher):
(Include Files):
(ODT export commands): Fix command names.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25527.22953.318527.300303@gargle.gargle.HOWL
2023-02-03 14:19:44 +03:00
Ihor Radchenko e455df4a07
org-persist: Improve commentary
* lisp/org-persist.el: Update top comment.
(org-persist--index-hash):
(org-persist--report-time): Update docstrings.
2023-02-02 23:32:00 +03:00
Pedro Andres Aranda Gutierrez 8ae8a8462f
org-clock-clocktable-language-setup: Fix Spanish translation
* lisp/org-clock.el (org-clock-clocktable-language-setup): Translate
leftover English string and use more accurate translation for clocked
time.
2023-02-02 14:01:53 +03:00
Ihor Radchenko c8d20d023f
Merge branch 'bugfix' 2023-02-01 15:04:38 +03:00
Ihor Radchenko b4a1133a18
org-babel-eval: Clarify the purpose of 4a751709b in code
* lisp/ob-eval.el (org-babel-eval): Add comment.
2023-02-01 15:03:50 +03:00
Matthew Trzcinski 81c03fb850
lisp/ob-eval.el: Append newline to source block query
* lisp/ob-eval.el (org-babel-eval): Newline facilitates working with
Windows cmdproxy.exe.

Reported-by: "Osher Jacob" <osherz5@gmail.com>
Link: https://list.orgmode.org/orgmode/CAGsxwFZ88cybALCVGgma=5gENMhUa0Rk6xNkBNS_HdsmBgYe6w@mail.gmail.com/
2023-02-01 14:58:30 +03:00
Andreas Gerler 2cf8430350
lisp/ob-sql.el: allow string in sql-connection-alist
* ob-sql.el (org-babel-find-db-connection-param): read
sql-connection-alist like sql.el/sql-connect and allow strings.

Signed-off-by: Andreas Gerler <baron@bundesbrandschatzamt.de>
2023-02-01 14:58:03 +03:00
Ihor Radchenko 9a00f6cd78
org-cite: Clarify how multiple bibliography sources are combined
* doc/org-manual.org (Citations): Clarify that all the global and
local bibliographies are used to search citation keys.

Link: https://orgmode.org/list/87fsc0gimd.fsf@uwaterloo.ca
2023-02-01 14:08:35 +03:00
Ihor Radchenko b363ec04a2
Merge branch 'bugfix' 2023-02-01 00:21:06 +03:00
Ihor Radchenko 32b64607ad
org-element-cache-map: Fix when inside indirect buffer
* lisp/org-element.el: Query cache variables from the base buffer.
They are only kept up-to-date there.
* testing/lisp/test-org.el (test-org/map-entries): Add test.

Reported-by: Hanno Perrey <hanno@hoowl.se>
Link: https://orgmode.org/list/87pmau4fi3.fsf@hoowl.se
2023-02-01 00:18:56 +03:00
Marco Wahl 0d01a198bc org-attach: Show Org Attach UI starting from top
* org-attach.el (org-attach): Move cursor to the top of the
UI-description buffer.

This matters when the buffer does not fit completely in the window for
display.  Without the change the user would see the bottom part.
2023-01-30 23:01:17 +01:00
Matthew Trzcinski 4a751709b5 lisp/ob-eval.el: Append newline to source block query
* lisp/ob-eval.el (org-babel-eval): Newline facilitates working with
Windows cmdproxy.exe.

Reported-by: "Osher Jacob" <osherz5@gmail.com>
Link: https://list.orgmode.org/orgmode/CAGsxwFZ88cybALCVGgma=5gENMhUa0Rk6xNkBNS_HdsmBgYe6w@mail.gmail.com/
2023-01-30 12:05:22 -05:00
Andreas Gerler 1f86003a5d
lisp/ob-sql.el: allow string in sql-connection-alist
* ob-sql.el (org-babel-find-db-connection-param): read
sql-connection-alist like sql.el/sql-connect and allow strings.

Signed-off-by: Andreas Gerler <baron@bundesbrandschatzamt.de>
2023-01-30 17:57:04 +01:00
Ihor Radchenko 0509a84786
Merge branch 'bugfix' 2023-01-30 12:06:49 +03:00
Ihor Radchenko c340e799f8
org-element-cache-map: Always continue after point set by FUNC
* lisp/org-element.el (org-element-cache-map): Never map over element
starting before the point manually moved (or set via
`org-element-cache-map-continue-from') by FUNC.
* testing/lisp/test-org.el (test-org/map-entries): Add tests.

Reported-by: Matthieu Caneill <matt@brokenwa.re>
Link: https://orgmode.org/list/Y9MKUzWWbErLFhmq@brokenwa.re
2023-01-30 12:05:29 +03:00
Jack Kamm aa48c80fe1 ob-python: Remove python-mode.el support
* lisp/ob-python.el (org-babel-python-mode): Moved to ob-compat.el,
and changed to a constant.
(org-babel-python-initiate-session-by-key): Remove code to support
python-mode.el.
(org-babel-python-send-string): Renamed from
`org-babel-python--send-string', turning it into a public function to
accommodate ob-python-mode-mode which advises this function. Also,
remove some code for python-mode.el.
(org-babel-python-evaluate-session): Update calls to renamed function
`org-babel-python-send-string'.
* lisp/ob-compat.el (org-babel-python-mode): Moved from ob-python.el,
and changed to a constant.
2023-01-27 11:30:51 -08:00
Ihor Radchenko 265e4a5747
Merge branch 'bugfix' 2023-01-27 13:35:28 +03:00