Commit Graph

25949 Commits

Author SHA1 Message Date
Damien Cassou f9aeba5dd7
org.el: Avoid crash in `org-file-contents' in case of network failure
* lisp/org.el (org-file-contents): Wrap the
`url-retrieve-synchronously' call into a `condition-case' block to
avoid throwing an error when NOERROR is non-nil.

TINYCHANGE
2023-02-26 14:42:13 +03:00
Ihor Radchenko 7a90f596d9
org-clock-timestamps-change: Fix when on opening timestamp
* lisp/org-clock.el (org-clock-timestamps-change): Do not rely on
global `org-last-changed-timestamp'.
*
testing/lisp/test-org-clock.el (test-org-clok/org-clock-timestamps-change):
Add new test.

Reported-by: sting.startup-0y@icloud.com
Link: https://orgmode.org/list/2380D54F-DE06-4CBE-88AC-5906A6E9253A@gmail.com
2023-02-22 13:19:06 +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 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 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
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
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 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
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 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
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
Ihor Radchenko c45a058928
org-follow-timestamp-link: Fix when org-agenda is not yet loaded
* lisp/org.el (org-follow-timestamp-link): Explicitly require
org-agenda.

Reported-by: Michael Maurer <maurer.michael@gmail.com>
Link: https://orgmode.org/list/CAH-0+bBaYEWLkQ3XVuuO+qiXDwQC+9JB0D2y9nti-a5uvNzEeA@mail.gmail.com
2023-01-27 13:34:22 +03:00
Arash Esbati 65ca7bc6a7
lisp/ox.el: Pacify compiler warning
* lisp/ox.el (org-export-to-buffer): Escape single quote in the
example given in docstring.
Add missing '.' after the abbreviation.
2023-01-26 12:18:49 +03:00
Ihor Radchenko 1bcab6c04f
org-assert-version: Clarify that Org loading is aborted
* lisp/org-macs.el (org-assert-version): Explicitly state that Org
loading is aborted.  Some users otherwise assume that the warning can
be ignored.  Also, remove sentence about `load-path' as it is
explained later in the warning text.
2023-01-24 23:12:32 +03:00
Ihor Radchenko 20ee7b85eb
fixup! org-fix-agenda-info: Fix Emacs <28 compatibility 2023-01-24 21:08:49 +03:00
Ihor Radchenko 5bbb97f3df
org-fix-agenda-info: Fix Emacs <28 compatibility
* lisp/org-agenda.el (org-fix-agenda-info): Do not use `string-pad'
that is only available since Emacs 28.  Instead, use the expression
used as default value of `calendar-iso-date-display-form'.

Reported-by: Aaron L. Zeng <me@bcc32.com>
Link: https://orgmode.org/list/20230124025259.1301063-1-me@bcc32.com
2023-01-24 12:16:19 +03:00
Ihor Radchenko a1c7cedd28
test-ob-octave: Fix tests failing on Debian CI (followup)
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file-space): Do
not assert absence of warnings.  See 59228e513.
2023-01-23 15:47:08 +03:00
Ihor Radchenko 59228e5134
test-ob-octave: Fix tests failing on Debian CI
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session): Do not assert that octave must not
emit warnings.  Just test the file created by side effect.

We currently have no reliable way to disambiguate warnings from
non-zero exit code when using `org-babel-eval'.  Warnings are ok, as
long as they do not result in the file not being created in the test.

Link: https://orgmode.org/list/87mt6m5n6u.fsf@localhost
2023-01-23 13:28:00 +03:00
Kyle Meyer e37e9b692e org-persist: Silence recent byte-compiler warning
* lisp/org-persist.el: Bind pp-use-max-width to silence byte-compiler
warning about unused lexical variable.

Note that loading pp.el upfront rather than relying on the pp function
being autoloaded would also eliminate the warning, but that would only
work on Emacs 29 or later because earlier versions do not have the
pp-use-max-width option.
2023-01-22 21:45:57 -05:00
Kyle Meyer 6ae5430962 Merge branch 'km/from-emacs-29' into bugfix 2023-01-22 21:33:37 -05:00
Dmitry Gutov ebaf1c9c04 Backport commit 347933377 from Emacs
* lisp/ob-ruby.el: Fix outdated comments.

lisp/org/ob-ruby.el: Fix outdated comments.
34793337783489297313c67d4a56682514877597
Dmitry Gutov
Fri Jan 20 23:32:21 2023 +0200
2023-01-22 21:33:13 -05:00
Stefan Kangas 0ab9bc138f Backport commit 920a7d38e from Emacs
; Fix typos
920a7d38e96134289393b7bfcc3a7b88be73925b
Stefan Kangas
Sun Jan 15 02:14:19 2023 +0100

[km] These were likely not typos but intended as an abbreviation for
     "if and only if".  However, using "if" works fine in these spots,
     so let's just go along with the change.  (These may end up being
     reverted on Emacs's side; see emacs-devel
     <83a62k72lx.fsf@gnu.org>, 01-15.)
2023-01-22 21:33:13 -05:00
Ihor Radchenko 15c519b84c
Do not assume that `org-string-width' preserves match data
* lisp/org-table.el (org-table-blank-field):
(org-table-clean-line): Avoid `org-string-width' modifying match data.

As long as `org-string-width' creates a new window buffer, third-party
modes and Emacs distributions might modify the match data in buffer
hooks.  Hence, we cannot assume that match data is not modified even
though `org-string-width' code itself does not alter the match data.

Note: Adding `save-match-data' around function calls is generally a
good practice when the surrounding code relies on the match data being
intact.  Elisp conventions don't prohibit functions to modify match
data without notice in their docstring.

Reported-by: Thomas Schneider <qsx@chaotikum.eu>
Link: https://orgmode.org/list/wwufsc7edzu.fsf@chaotikum.eu
2023-01-20 12:01:24 +03:00
Ihor Radchenko ecdb442044
org-persist: Work around Emacs bug#58687
* lisp/org-persist.el (org-persist--write-elisp-file): Bind
`pp-use-max-width' to nil when using `pp'.  Otherwise, printing
quickly becomes slow.

Reported-by: Michael Eliachevitch <m.eliachevitch@posteo.de>
Link: https://orgmode.org/list/87wn8tb3zp.fsf@posteo.de
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58687
2023-01-20 11:44:57 +03:00
Ihor Radchenko cbb288eaa5
ob-core: Do not use `temporary-file-directory' function
* lisp/ob-core.el (org-babel-temporary-stable-directory): Use
`temporary-file-directory' variable instead of function.  The function
returns value depending on the `default-directory' at Org startup time
thus creating unpredictable temporary babel locations that may
sometimes litter current directory.

Reported-by: bhrgunatha <bhrgunatha@gmail.com>
Link: https://orgmode.org/list/93b040e1-6dc6-487f-de89-a4cea9a560ff@gmail.com
2023-01-18 12:16:19 +03:00
Ihor Radchenko 5d9c9c27c6
* lisp/org-agenda.el: require 'org-element
Load org-element for agenda instead of relying on org-element being
loaded when agenda is ran.

Reported-by: zimoun <zimon.toutoune@gmail.com>
Link: https://orgmode.org/list/86r0vszn3w.fsf@gmail.com
2023-01-18 11:52:08 +03:00
Ihor Radchenko c7b976a052
org: Bump the minimal required Emacs version
* lisp/org.el: Bump required Emacs version to 26.1.

See https://orgmode.org/worg/org-maintenance.html#emacs-compatibility
2023-01-17 15:05:11 +03:00
Ihor Radchenko 12bcd322d0
Improve documentation for agenda starting day
* doc/org-manual.org (Weekly/daily agenda):
* lisp/org-agenda.el (org-agenda-start-on-weekday):
(org-agenda-start-day): Document that `org-agenda-start-on-weekday'
takes precedence over `org-agenda-start-day' when agenda span is 7 or
14 days.

Reported-by: Eppo Math <eppolito.math@gmail.com>
Link: https://orgmode.org/list/878ri67plt.fsf@localhost
2023-01-16 13:35:11 +03:00
Ihor Radchenko df4a5d86d8
org-fold: Fix isearch when `org-fold-core-style' is 'overlays
* lisp/org-fold-core.el (org-fold-core--isearch-show): Make sure that
the actual isearch match is revealed.  This relies on undocumented
behavior of isearch that point is at the match when
'isearch-open-invisible is called.
(org-fold-core-region): Disable 'isearch-open-invisible-temporary
features when `org-fold-core-style' is 'overlays.  This is to work
around the undocumented requirement of isearch to _not_ delete the
overlay passed to 'isearch-open-invisible-temporary function.  Since
`org-fold-show-set-visibility' may destroy overlays arbitrarily, we
cannot currently support isearch `org-fold-show-context-detail' in
full.

Reported-by: Matt Lundin <mdl@imapmail.org>
Link: https://orgmode.org/list/87zgb6tk6h.fsf@localhost
2023-01-16 12:21:57 +03:00
Ihor Radchenko 2e22a8b827
org-export-dictionary: Fix typo
* lisp/ox.el (org-export-dictionary): Fix encoding keyword.

Reported-by: Rafael Bento <rafael.bentoe.silva@gmail.com>
Link: https://orgmode.org/list/adda99a7-b21f-a33b-571d-b7bfd6d743e2@gmail.com
2023-01-14 16:28:49 +03:00
Ihor Radchenko 97a235cf1c
org-clock-timestamps-change: Preserve point position
* lisp/org-clock.el (org-clock-timestamps-change): Try harder to
preserve point position.  `save-excursion' is not sufficient here,
when the timestamp gets deleted in the process.

Reported-by: Johannes Dahl <muusik@gmail.com>
Link: https://orgmode.org/list/CAHuokSbJxM4kqjdT94aHmjnKqzOvpJpq3tJqOEqdswaBC=JnfA@mail.gmail.com
2023-01-13 11:57:19 +03:00
Ihor Radchenko cd967ce006
org-odt-plain-text: Fix `fill-column' value
* lisp/ox-odt.el (org-odt-plain-text): Use `most-positive-fixnum' to
unfill plain text elements.  `point-max' is not a safe large value
because, for example, Han script symbols often occupy two columns.

Reported-by: Cantoraz Chou <cantoraz@gmail.com>
Link: https://orgmode.org/list/CAJg5Zf00e+A_kuBmRh+h68u+3g_Cb_bLqRhR4rpFH=nenXvTdw@mail.gmail.com
2023-01-13 11:10:54 +03:00
Ihor Radchenko a52d0f0918
org-export-as: Fix subtree export when metadata ends right before heading
* lisp/ox.el (org-export-as): Only include first newline after heading
line when the metadata is non-empty.
* testing/lisp/test-ox.el (test-org-export/export-scope): Add test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
Link: https://orgmode.org/list/CAFyQvY1d=UEJ-6ZPG1X+st=fCfBAnTfgbVNhxyxH_xKcLGG4cQ@mail.gmail.com
2023-01-12 12:23:19 +03:00
Ihor Radchenko 89d13998bd
org-element-fixed-width-parser: Fix when :value is empty
* lisp/org-element.el (org-element-fixed-width-interpreter): Interpret
fixed-width element with :value "" as ":\n", not as empty string.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-interpreter):
Fixed the test.

The previous test, albeit intentionally asserting "" result, breaks
reversibility of parse-interpret sequence.
2023-01-12 12:23:19 +03:00
Bastien 630f86dfc4 Update version number for the 9.6.1 release 2023-01-11 16:00:12 +01:00
Ihor Radchenko a6523f1aa0
org-export-output-file-name: Remove redundant `cond' clause
* lisp/ox.el: Remove `cond' clause equivalent to t.
2023-01-07 15:13:52 +03:00
Ihor Radchenko 5a8a1d4ff9
org-compile-file: Expand "~" in SOURCE
* lisp/org-macs.el (org-compile-file): Expand "~" in the source before
passing it as quoted shell argument.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25528.42190.53674.62381@gargle.gargle.HOWL
2023-01-07 15:12:41 +03:00
Leo Butler 41ebc2e40c
test-ob-octave.el: wrap get-buffer in buffer-live-p
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Wrap GET-BUFFER in BUFFER-LIVE-P.
This ensures that a killed buffer does not cause an incorrect failure
of a test.

Link: https://orgmode.org/list/87bknh5nva.fsf@localhost
2023-01-06 18:01:37 +03:00
Ihor Radchenko 28a9664844
org-manual.org: Clarify that `org-insert-property-drawer' is not a command
* doc/org-manual.org (Drawers): Emphasize that
`org-insert-property-drawer' is not interactive command, but a
function.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/tp3pbi$dk$1@ciao.gmane.io
2023-01-06 16:30:42 +03:00
Ihor Radchenko 93339de71b
org-babel-shell-initialize: Fix `org-babel-prompt-command'
* lisp/ob-shell.el (org-babel-shell-initialize): Do not search shell
name string by `eq' in `org-babel-shell-set-prompt-commands' alist.
Use `assoc' that is comparing by `equal' instead.

Reported-by: Matt <matt@excalamus.com>
Link: https://orgmode.org/list/87h6x8kluc.fsf@localhost
2023-01-05 11:26:40 +03:00
Ihor Radchenko 58aeb1af15
org-persist-unregister: Fix when ASSOCIATED is 'all
* lisp/org-persist.el (org-persist-unregister): Do not try to
normalize 'all ASSOCIATED.  It is not a valid association that should
be handled specially.  Previously, an error was thrown.
2023-01-03 10:58:02 +03:00
Ihor Radchenko ce6f1799cc
org-options-keywords: Add missing keyword
* lisp/org.el: Add missing "EXPORT_FILE_NAME" that is mentioned in
13.2 Export Settings section of the manual.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25521.58663.963178.927459@gargle.gargle.HOWL
2023-01-02 12:07:17 +03:00
Ihor Radchenko 3454021483
Revert "org-babel-read: Obey `org-confirm-babel-evaluate'"
This reverts commit 10e857d428.

* lisp/ob-core.el:
(org-babel-merge-params):
(org-babel-process-params):
(org-babel-read):
* lisp/org-table.el: Add FIXME comments to places where arbitrary code
execution may happen.

The extra query is reverted until we develop a better code execution
safety system for Org.  The commit introduced too many user queries,
making the whole idea of asking users to execute code from Org files
not useful.

Link: https://orgmode.org/list/878rinadlq.fsf@localhost
2023-01-02 10:49:45 +03:00
Ihor Radchenko 1cd39c9e30
org-mode: Fix element cache updates when aligning tables during startup
* lisp/org.el (org-mode): Do not suppress modification hooks when
aligning tables.  Otherwise, cache state may become invalid.

Reported-by: Stefan <org@stefan.failing.systems>
Link: https://orgmode.org/list/87tu1wse45.fsf@localhost
2023-01-02 10:26:52 +03:00
Kyle Meyer 563a4396b6 org-assert-version: Deleting trailing whitespace
Otherwise this fails Emacs's pre-commit check.
2023-01-01 22:23:43 -05:00
Kyle Meyer a43866e1cf Update remaining copyright years
Most copyright years were updated with the port of Emacs's cae528457
in e0815d754.  Update the remaining copyright years for files that
have Free Software Foundation as the copyright holder but aren't
included in the Emacs repo.
2023-01-01 13:13:15 -05:00
Kyle Meyer 58e93869b7 Touch up copyright lines from cae528457
A few files had a copyright date of "2020-2020", and cae528457 (ported
by e0815d754) updated these to "2020, 2023-2020".  Correct these
spots.
2023-01-01 13:12:52 -05:00
Kyle Meyer 2f15b3c528 Merge branch 'km/from-emacs-29' into bugfix 2023-01-01 12:45:33 -05:00