Commit Graph

25978 Commits

Author SHA1 Message Date
Ihor Radchenko f1fd1f22f4
Update version number for the 9.6.4 release 2023-04-15 13:53:24 +02:00
Ihor Radchenko 07508fb097
org-assert-version: Skip version check when Org is a part of Emacs
* lisp/org-macs.el (org--built-in-p): New constant indicating if Org
source is a part of Emacs source tree.
(org-assert-version): Skip check when Org is built-in.
2023-04-15 13:50:42 +02:00
TEC 6a96054f05
ob-tangle: Edit default file mode to match docstr
* lisp/ob-tangle.el (org-babel-tangle-default-file-mode): The docstring
states that it the default value is read-write for the user, read only
for everyone else.  This is not consistent with the default value which
is actually read-*execute* for the user, read only for everyone else.
The default value is updated to be read-write for the user, as stated in
the docstring.

Reported-by: Ruijie Yu <ruijie@netyu.xyz>
Link: https://list.orgmode.org/orgmode/sdv3554xtat.fsf@fw.net.yu
2023-04-13 08:59:47 +02:00
TEC 81fc8c06ce
ob-tangle: Fix interpretation of rw-r--r-- modes
* lisp/ob-tangle.el (org-babel-interpret-file-mode): When specifying a
file mode in the "rw-r--r--" style, this is interpreted by splicing the
user, group, and other compenents into a "u=rw,g=r,o=r" style string and
applying `file-modes-symbolic-to-number`.  For correct interpretation,
we need to ensure the dashes are removed in this process.
2023-04-13 08:59:27 +02:00
Ihor Radchenko 5ac1ebaa15
org-latex--protect-texttt: Fix "---"
* lisp/ox-latex.el (org-latex--protect-texttt): Fix >2 consecutive
dashes.

Reported-by: Garid Zorigoo <garidzorigoo@gmail.com>
Link: https://orgmode.org/list/CAEDgBW44j4NpYUpppLpOA5Pmmsfi-GbCzDH4rTmRjf-F64mSaA@mail.gmail.com
2023-04-12 10:57:34 +02:00
Ihor Radchenko 60ce29dc41
org-odt-plain-text: Fix when text contains leading spaces
* lisp/ox-odt.el (org-odt-plain-text): Do not count leading spaces
twice.

Reported-by: Damien Cassou <damien@cassou.me>
Link: https://orgmode.org/list/87v8i3y135.fsf@cassou.me
2023-04-11 12:25:13 +02:00
Ihor Radchenko 56dd046da8
* doc/org-manual.org: Add a link to Diary section of Emacs manual
(Timestamps): Add a link to Emacs manual when explaining diary style
sexp timestamps.

Reported-by: David Masterson <dsmasterson@gmail.com>
Link: https://orgmode.org/list/SJ0PR03MB5455892B11B07344346194B9A2959@SJ0PR03MB5455.namprd03.prod.outlook.com
2023-04-10 19:22:49 +02:00
Ihor Radchenko 072ddbc975
org-element-cache: Disable extra consistency checks
* lisp/org-element.el (org-element--cache-self-verify): Switch to nil
by default, disabling costly cache self-verification.  This is
relatively safe as no relevant bug reports have been submitted for a
while.  Also, the most critical cache failures are still monitored.
2023-04-09 13:13:25 +02:00
Aaron L. Zeng 19b0d0e5aa
org-table: Fix incorrect input when used with evil-escape
* org-table.el (org-self-insert-command): Use `last-command-event'
instead of `last-input-event'.  Using `last-input-event' causes
problems in the presence of `evil-escape'.  Consider a buffer that has
`orgtbl-mode' enabled while evil-escape is in use.  Assume the
evil-escape sequence is "fd".  Typing "f RET" will instead insert "RET
RET" into the buffer, since `last-input-event' is "RET", but
`last-command-event' is "f".

TINYCHANGE
2023-04-07 12:35:43 +02:00
Aaron L. Zeng 54a743cd72
org-table: Refactor away unnecessary variable
* org-table.el (orgtbl-self-insert-command): Remove unnecessary
intermediate variable.  `(cdr nil)` is nil.

TINYCHANGE
2023-04-07 12:35:42 +02:00
Ihor Radchenko f2949d4d1d
org-babel-comint-with-output: Fix edge case for partial prompts
* lisp/ob-comint.el (org-babel-comint-with-output): Do not try to
filter out prompts in `comint-output-filter-functions'.  The prompts
may arrive there arbitrarily - multiple prompts together, partial
prompts, full prompts, etc.  For example "ghci> " prompt may arrive as
"gh" + "ci> " with second part still matching `comint-prompt-regexp'.
As a result, if we keep using `comint-output-filter-functions', the
split prompts may sometimes retain their initial part, littering the
results.  Now, we postpone filtering to after receiving the output,
still making sure that agglomerated prompts gets filtered using a
custom regexp derived from `comint-prompt-regexp'.
2023-04-02 12:15:10 +02:00
Ihor Radchenko 7fa9e9a4b3
org-babel-comint-with-output: Handle agglomerated prompts better
* lisp/ob-comint.el (org-babel-comint-with-output): Consider that
comint can sometimes agglomerate multiple prompts together even within
a single output increment as passed to
`comint-output-filter-functions'.

Example in GHC comint buffer:

GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> ghci> :{
main :: IO ()
main = putStrLn "Hello World!"
:}

main
"org-babel-haskell-eoe"
ghci| ghci| ghci| ghci> ghci> Hello World!
ghci> "org-babel-haskell-eoe"
ghci>
2023-04-02 12:15:06 +02:00
Ihor Radchenko f9bbc79d62
Update version number for the 9.6.3 release
This release is mostly a bugfix for 9.6.2 release tag, which was not
signed and was not annotated.  See
https://orgmode.org/worg/org-maintenance.html#release-tags
2023-04-02 10:36:55 +02:00
Ihor Radchenko 638e0ecc0b
Fix some compiler warnings
* lisp/org.el (org-remove-timestamp-with-keyword): Use `delete-char'
instead of for-interactive-use-only `backward-delete-char'.
(org-fast-tag-selection): Remove unnecessary `condition-case'.
(org-delete-backward-char): Make it explicit that we fall back to
normal interactive call.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62518
2023-03-29 16:58:43 +02:00
Stephen J. Eglen fcd813c406
lisp/org.el: Docstring fixes
* lisp/org.el (org-hide-emphasis-markers)
(org-hide-macro-markers)
(org-pretty-entities-include-sub-superscripts): Follow elisp
convention for docstrings: 'Non-nil means ...'.
2023-03-27 13:11:08 +02:00
Ihor Radchenko c1e8e2ffc7
Update version number for the 9.6.2 release 2023-03-26 11:33:48 +02:00
Ihor Radchenko 4c01eba265
org-texinfo-supports-math-p: Fix CI test failures
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Consider
compilation error as indication that math is not supported.  texinfo
compiler throws "unknown command `displaymath'" error in such case,
causing `org-texinfo-compile' to err as well.

Fixes CI tests failures when testing with Texinfo versions with no
math support.

https://builds.sr.ht/~bzg/job/959487
2023-03-19 13:58:07 +01:00
Ihor Radchenko 92471e5303
org-agenda-run-series: Fix `org-agenda-list' call
* lisp/org-agenda.el (org-agenda-run-series): Fix arguments in the
call.  "agenda*" should include appointments and thus HOURS argument
should be non-nil.  See `org-agenda' for analogous call.
2023-03-18 13:01:58 +01:00
Ihor Radchenko 6fc420167c
org-persist: Fix file path calculation
* lisp/org-persist.el (org-persist-read:file):
(org-persist-read:url): Use `org-file-name-concat' instead of simple
`concat'.
2023-03-14 14:45:00 +01:00
Pedro Andres Aranda Gutierrez 3eb51d8dbc
* lisp/ox-latex.el (org-latex-generate-engraved-preamble): Fix typo 2023-03-14 13:20:29 +01:00
Xi Lu a8006ea580
* lisp/ob-latex.el: Fix command injection vulnerability
(org-babel-execute:latex):
Replaced the `(shell-command "mv BAR NEWBAR")' with `rename-file'.

TINYCHANGE
2023-03-12 12:23:46 +01:00
Ihor Radchenko dd25e2704f
org-src--construct-edit-buffer-name: Fix docstring
* lisp/org-src.el (org-src--construct-edit-buffer-name): Fix the
docstring to conform to the existing buffer name pattern.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/20230302140224.6169-1-salutis@me.com
2023-03-10 12:08:44 +01:00
Rudolf Adamkovič eb6379a417
Fix LaTeX spelled as Latex
etc/ORG-NEWS (Non-floating minted listings in LaTeX export):
* lisp/ob-latex.el: (org-babel-execute:latex):
* lisp/org-element.el:
* lisp/ox-ascii.el:
* lisp/ox-html.el:
* lisp/ox-latex.el:
* lisp/ox-md.el:
* lisp/ox-odt.el:
* testing/examples/ob-maxima-test.org (LaTeX output):
* testing/lisp/test-org-element.el (test-org-element/cache): Spell LaTeX
correctly.
2023-03-07 14:08:40 +01:00
Rudolf Adamkovič 4f6bf89547
Fix BibTeX spelled as Bibtex
* lisp/ol-bibtex.el: Spell BibTeX correctly
* etc/ORG-NEWS (Org-BibTeX -- major improvements): Spell BibTeX correctly
2023-03-07 14:06:01 +01:00
Xi Lu 8f8ec2ccf3
* lisp/ob-latex.el (org-babel-execute:latex): Fix command injection vulnerability
Link: https://orgmode.org/list/tencent_5C4D5D0DEFDDBBFC66F855703927E60C7706@qq.com

TINYCHANGE
2023-03-07 13:26:13 +01:00
Rudolf Adamkovič 3d817c52c9
org-clock: Add a trailing space to the mode line string
* lisp/org-clock.el (org-clock-get-clock-string): End the mode line
element in a space, instead of beginning with space, to make it play
well with other mode line strings, which typically end a space.  For
reference, see the mode line string of the Display Time mode.
2023-03-05 13:20:30 +01:00
Max Nikulin 233a8479ca
orgcard.tex: Fix `org-force-cycle-archived' binding
* doc/orgcard.tex (Capture): Fix `org-force-cycle-archived' binding.

Changed in the release 9.4 to avoid conflict with tab-bar.el, see

9092c289b 2020-06-01 14:39:28 +0200 Bastien: Bind `org-force-cycle-archived' to C-c C-TAB
2023-03-05 13:07:52 +01:00
Gerard Vermeulen e8010e8a91
org.el: Sync org-babel-load-languages with Babel files in Org
* lisp/org.el (org-babel-load-languages): Sync with Babel files

(org-babel-load-languages): Synchronize the defcustom with the rest of
the code base, group languages by Org Babel file, and spell languages
using camel case (the current fashion).

Link: https://list.orgmode.org/712f2ef5b4edb2d9b565f6467e582030@posteo.net/
2023-03-03 15:55:14 +01:00
Ihor Radchenko 911d6a1027
org-manual: Clarify that :eval yes obeys `org-confirm-babel-evaluate'
* doc/org-manual.org (Limit code block evaluation): Clarify :eval yes
value.

Reported-by: Dan Drake <dan.drake@gmail.com>
Link: https://orgmode.org/list/CAKqbAeFRGDzQQQkXHKvDPtgM7NYybWgxpJj3yoRKnuD2bSwyVw@mail.gmail.com
2023-02-28 13:34:45 +03:00
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