Commit graph

25402 commits

Author SHA1 Message Date
Daniel Fleischer 7135982022 lisp/ob-latex.el: Remove duplicate line.
* lisp/ob-latex.el (org-babel-header-args:latex): duplicate line.
2022-07-05 17:00:12 +03:00
Ihor Radchenko 080462198f
ob-gnuplot.el: Make :cache argument work with :var assignments
* lisp/ob-core.el (org-babel-temporary-stable-directory): New variable
holding a temporary directory name that does not change between Emacs
sessions.
(org-babel-remove-temporary-stable-directory): New function removing
`org-babel-temporary-stable-directory' on Emacs shutdown.
(org-babel-temp-stable-file): Generate stable temporary file name for
object storage.  The file name is constant for equal objects.
(org-babel-execute-src-block): Explicitly identify that if the result
is cached.
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): Make use of
`org-babel-stable-file' to make expanded body stable with respect to
:var assignments.

Fixes https://orgmode.org/list/87mtn1o5mn.fsf@ucl.ac.uk
2022-07-04 21:03:16 +08:00
Ihor Radchenko ad304faea1
org-attach-attach: Avoid linking to path starting with ~
* lisp/org-attach.el (org-attach-attach): Auto-expand ~ in the file
patch when using symlink (`lns') attach method.

Fixes https://orgmode.org/list/CAN_Dec_LyTKgSN_kiftee9GULM7FPER5frQFant3n_2C3cwM-g@mail.gmail.com
2022-07-04 21:01:43 +08:00
Sébastien Miquel 4e42500613 org.el: Fix the filling of regions containing lists
* lisp/org.el (org-setup-filling): Set fill-forward-paragraph-function.
(org--single-lines-list-is-paragraph): New internal variable.  Whether
a list with single lines items should be considered a single
paragraph.
(org--paragraph-at-point): use org--single-lines-list-is-paragraph.
(org-fill-paragraph): When an active region contains a list ensure
every item get filled.
* testing/lisp/test-org.el (test-org/fill-paragraph):
(test-org/fill-region): Test behaviour of fill-paragraph and
fill-region with an active region containing a list.

When filling paragraphs in a region, do not treat a list with single
lines items as a single paragraph.
2022-07-04 12:43:09 +02:00
Stefan Kangas 0ed0dea229
Delete some Emacs 24 compat code
Org mode supports Emacs 26 or newer:
https://orgmode.org/worg/org-maintenance.html#emacs-compatibility

* lisp/org-compat.el (org-set-transient-map)
(org-font-lock-ensure): Delete compat aliases.  Update callers.
(org-define-error): Redefine as obsolete function alias for
`define-error'.  Update callers.
(string-suffix-p): Delete compatibility definition.

* lisp/org-fold-core.el (org-fold-core--seq-partition): Delete private
function and update callers to use `seq-partition'.

* lisp/org-macs.el (org-without-partial-completion): Move from here...
* lisp/org-compat.el (org-without-partial-completion): ...to here.
Redefine as obsolete function alias for `progn'.
2022-07-02 12:10:00 +08:00
Ihor Radchenko 2d52741088
orgmanual-org: Mention results export as default for inline src blocks
* doc/org-manual.org (Exporting Code Blocks): Clarify that results are
exported by default for inline source blocks.

The issue has been reported in https://orgmode.org/list/CACJP=3n_8tqzBZ7GhmD+f44NPPTLBy31htxHxRHsELXTeMoy2Q@mail.gmail.com
2022-07-02 12:02:09 +08:00
Stefan Kangas 41e19f1d7a
; Fix typos 2022-07-01 17:42:52 +08:00
Stefan Kangas 381a2ae4dd
* doc/org-manual.org (Speeding Up Your Agendas): Fix typos 2022-06-30 15:29:33 +08:00
Stefan Kangas 998a0aacd3
Improve look of agenda on graphical displays
* lisp/org-agenda.el (org-agenda-block-separator)
(org-agenda-time-grid, org-agenda-current-time-string): Improve
default visual elements on graphical displays.  Inspired by
org-modern.el by Daniel Mendler <mail@daniel-mendler.de>.
2022-06-30 15:25:32 +08:00
TEC 30953bd7b7
ox-latex: Pass on custom-env with src blocks
* lisp/ox-latex.el (org-latex-src-block): Fix an earlier oversight where
the custom environment was not passed on from `org-latex-src-block' to
`org-latex-src-block--custom'.
2022-06-29 23:18:55 +08:00
Stefan Kangas ea05f43435
* lisp/org-install.el: Delete file
See: <https://lists.gnu.org/r/emacs-orgmode/2022-06/msg00822.html>
2022-06-29 20:27:54 +08:00
Stefan Kangas a722f6f8ea
Document org-agenda-ignore-properties in manual
* doc/org-manual.org (Speeding Up Your Agendas): Document
`org-agenda-ignore-properties'.
2022-06-29 17:15:12 +08:00
Ihor Radchenko 26878e28e7
org-persist: Bump storage version to ignore bugged persisted data
* lisp/org-persist.el (org-persist--storage-version): Bump version to
avoid loading recently broken persisted element cache.
2022-06-29 13:49:34 +08:00
Ihor Radchenko aa5bc2c760
org-element-cache: Make sure that cache is correctly synced before saving
* lisp/org-element.el (org-element--cache-persist-before-write): Sync
cache before force-overwriting transient cache keys.
2022-06-29 09:16:01 +08:00
Ihor Radchenko eb796ae432
org-element-cache: Use `buffer-size' to detect silent modifications
* lisp/org-element.el (org-element--cache-diagnostics-modifications):
(org-element--cache-silent-modification-check): Remove variables that
were introduced to deal with false positives.  The new check is more
reliable.
(org-element--cache-last-buffer-size): New variable storing the last
known buffer size registered before/after handled buffer edits.
(org-element--cache-sync): Use `buffer-size' instead of
`buffer-chars-modified-tick' heuristics.  `buffer-size' may not catch
all the modifications, but it does not cause numerous
false-positives triggered by quail.  See Emacs Bug#51766 for the
detailed discussion.
(org-element--cache-before-change):
(org-element-cache-reset): Record buffer size before/after changes.
* lisp/org-macs.el (org-unique-local-variables): Do not carry over
buffer-local `org-element--cache-last-buffer-size' when cloning
buffer.
2022-06-29 09:15:52 +08:00
Ihor Radchenko d788fe9927
org-persist: Remove read cache introduced in f77800c68
* lisp/org-persist.el (org-persist--read-cache): Remove variable.
(org-persist-read):
(org-persist-write): Do not use `org-persist--read-cache'.  Using
`sx-hash-equal' as unique key indicating as-read data is not
reliable for deeply nested structures like `org-element--cache'.  The
`sx-hash-equal' returns the same value regardless of the cache
contents.  See Emacs Bug#56255.
2022-06-29 09:06:12 +08:00
Aaron L. Zeng ac7b8f9d2e
org-agenda-with-point-at-orig-entry: Fix body indentation
* lisp/org-agenda.el (org-agenda-with-point-at-orig-entry): Indent
like `org-with-point-at'.

TINYCHANGE
2022-06-27 20:46:13 +08:00
Daniel Fleischer 036939b5b1 lisp/ox-latex.el: indentation, small refactor
* lisp/ox-latex.el (org-latex-table-cell): indentation, parenthesis
convention, combining 2 `let' blocks.
2022-06-27 08:32:11 +03:00
Kyle Meyer 9193cf6796 Merge branch 'bugfix' 2022-06-26 23:10:30 -04:00
Stefan Kangas 6dc785288d Backport commit 1f6750b53 from Emacs
Avoid treating number as an enum in the org manual
1f6750b53a872a5747dff92b8f61cfede0c5a6a6
Stefan Kangas
Fri Jun 24 19:18:50 2022 +0200

[km] This same change was sent to the Org list and applied to main in
     db3870bfc.
2022-06-26 22:53:26 -04:00
Daniel Fleischer 321bfb88b5 lisp/ox-latex.el: tabbing code refactor
* lisp/ox-latex.el (org-latex-table, org-latex--align-string-tabbing)
(org-table--org-tabbing): simple documentation changes, code
indentation, code simplification.

See
https://lists.gnu.org/archive/html/emacs-orgmode/2022-06/msg00700.html.
2022-06-26 21:44:54 +03:00
Allen Li 711ada5acd
test-org: Add test for org-todo prefix behavior
* testing/lisp/test-org.el (test-org/org-todo-prefix): Add test.
2022-06-26 14:29:48 +08:00
Rudolf Adamkovič 15068ce30a
Fix incorrectly documented MathJax options
* lisp/org/ox-html.el (org-html-mathjax-options): Fix some incorrect
choices for `indent' and `autonumber' in the docstring.
2022-06-26 14:22:52 +08:00
Stefan Kangas e82ce43929
Add missing commands to org-agenda-custom-commands docstring
* lisp/org-agenda.el (org-agenda-custom-commands): Add missing
commands.  Add crossreference to the Info manual.
2022-06-26 12:52:18 +08:00
Stefan Kangas 13d97ee18c
Prefer "website" to "homepage"
Emacs now advises using "website" (instead of "homepage") and
consequently to use the "URL" comment header instead of "Homepage".

* README:
* README_ELPA:
* doc/org-guide.org (Creating Footnotes):
* doc/org-manual.org (Creating Footnotes):
* etc/styles/README (URL): Prefer "website" to "homepage".

* lisp/*.el:
* mk/org-fixup.el: Replace the "Homepage" header comment with "URL".
2022-06-26 10:10:48 +08:00
Ihor Radchenko 197d500607
org-element-cache: Setup before/after-change-functions in indirect buffers
* lisp/org-element.el (org-element--cache-setup-change-functions): New
function setting up `org-element--cache-before-change' and
`org-element--cache-after-change'.
(org-element-cache-reset): Setup before/after-change-functions inside
indirect buffers.
2022-06-25 16:10:22 +08:00
Ihor Radchenko 620fb24050
org-keys: Do not rely on deprecated boolean value of `window-system'
* lisp/org-keys.el: Do not rely on boolean value of `window-system'.
Such usage is deprecated.  Use `display-graphic-p' instead.
2022-06-25 16:05:16 +08:00
Stefan Kangas db3870bfc0
Avoid treating a number as an enum in manual
* doc/org-manual.org (The Agenda Dispatcher): Avoid treating
number as enum.  The previous formatting contained "1." list at
the beginning of line.
2022-06-25 13:43:06 +08:00
Ihor Radchenko bcfed0f341
org-cycle.el: New custom setting `org-cycle-hide-drawer-startup'
* lisp/org-cycle.el (org-cycle-hide-drawer-startup):
* lisp/org-cycle.el (org-cycle-set-startup-visibility): Add new
customization to control initial folding state of the drawers.
* lisp/org.el (org-startup-options): Provide #+STARTUP option for the
new setting.

Fixes https://list.orgmode.org/m235gww8wg.fsf@ntnu.no/T/#u
2022-06-25 13:17:45 +08:00
Robert Pluim 2b1b428918
org.el (org-read-date): Point to Info documentation
* lisp/org.el (org-read-date): Add reference to Info documentation,
mainly because that describes all the available calendar navigation
commands.
2022-06-23 21:27:21 +08:00
Ihor Radchenko dbcc2e04f9
Merge branch 'bugfix' 2022-06-23 21:21:19 +08:00
David Lukes 0dc27a8837
oc-basic.el: Stringify year from CSL-JSON date-parts
* lisp/oc-basic.el (org-cite-basic--parse-json): Make sure year
extracted from date-parts is returned as string.  Raise error if
original type other than number or string.

The stringifiation is motivated by errors like the following on Emacs 28
with nativecomp:

Error during redisplay: (jit-lock-function 544) signaled
(wrong-type-argument "Argument is not a string or a secondary string:
2007")

Additionally, the type check will warn users about problems in their
CSL-JSON bibliographies.

Fixes https://list.orgmode.org/875ykv4k2q.fsf@localhost/T/#t

TINYCHANGE
2022-06-23 21:20:53 +08:00
Ihor Radchenko 7c61a3a801
org-unfontify-region: Handle invisible parts of links
* lisp/org.el (org-unfontify-region): Reveal folded parts of links.

Fixes https://orgmode.org/list/m2wndakbk0.fsf@ntnu.no
2022-06-21 20:26:22 +08:00
Stefan Kangas e7e37c5b26 org-agenda.el: Improve docstrings of agenda date navigation commands
* lisp/org-agenda.el (org-agenda-goto-date)
(org-agenda-goto-today, org-agenda-later, org-agenda-earlier):
Improve documentation and add crossreferences.
2022-06-21 08:03:53 +03:00
Daniel Fleischer 4a0d951c64 ox-latex tabbing environment support
* lisp/ox-latex.el: New `org-latex--align-string-tabbing',
`org-table--org-tabbing' functions.  Modified `org-latex-table-cell' to
use optional tabbing delimiters.

* etc/ORG-NEWS: support in ox-latex for tabbing environment.

* doc/org-manual.org: mention support for new environment.

Created-by: Bob Vergauwen <emacs@vergauwen.me>
2022-06-21 07:34:21 +03:00
Ihor Radchenko f77800c68b
org-persist: Avoid overwriting / re-reading unchanged persisted data
* lisp/org-persist.el (org-persist--read-cache):
(org-persist--write-cache): New variables holding previously written /
read data.
(org-persist-read): Avoid re-reading data from FS when the writing has
been performed in the same Emacs session.
(org-persist-write): Do not overwrite unchanged data.
2022-06-21 09:46:59 +08:00
Ihor Radchenko d687aa1786
org-persist: Display read errors in echo area
* lisp/org-persist.el (org-persist--read-elisp-file): Do not silently
ignore "Invalid read syntax" error.  Report it via message.  Yet
making the error less intrusive compared to `warn'.
2022-06-21 09:46:58 +08:00
Ihor Radchenko 1c54d75cca
org-persist--gc-expired-p: Fix expiry check
* lisp/org-persist.el (org-persist--gc-expired-p): Fix comparison when
expiry date is set to number of days.  The old code flipped the check
and treated all the recent entries as expired.
2022-06-21 09:46:57 +08:00
Kyle Meyer 4f454b18e4 Merge branch 'bugfix' 2022-06-19 16:32:55 -04:00
Stefan Kangas 02a22d6fad Backport commit 9a4862a97 from Emacs
doc/misc/org.org: Remove spurious markup.
9a4862a9738c2abab8fb4fb2e4e57b69dea679d7
Stefan Kangas
Wed Jun 8 13:16:32 2022 +0200
2022-06-19 16:29:01 -04:00
Stefan Kangas 45174d62b9
Remove XEmacs and ancient Emacs compat code
* lisp/org-colview.el (org-columns-remove-overlays):
* lisp/org-ctags.el (org-ctags-find-tag-interactive):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-mouse.el (org-mouse-show-context-menu):
* lisp/org-table.el (org-table-fedit-lisp-indent):
* lisp/org.el (org-version, org-reload):
* lisp/ox-html.el (org-html-template, org-html--build-meta-info):
Remove Emacs 21 and 22 compat code.

* lisp/ol-eww.el (org-eww-copy-for-org-mode):
* lisp/ol-w3m.el (org-w3m-copy-for-org-mode):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-refile.el (org-refile):
* lisp/org.el (org-change-tag-in-region): Remove XEmacs compat code.

* lisp/org-goto.el (org-goto--set-map):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-table.el (orgtbl-mode):
* lisp/org.el (org-setup-filling): Remove XEmacs or Emacs 19 or 20
compat code.  (It is one of these; not clear which.)
2022-06-18 15:43:30 +08:00
Ihor Radchenko 9632401dc6
Auto-Upcase/downcase #+begin/#+end in structure templates
* lisp/org-tempo.el (org-tempo-add-block):
* lisp/org.el (org-insert-structure-template): When inserting
 #+begin_type/#+end_type, follow type's case.  TYPE will become
 #+BEGIN_TYPE and type will become #+bein_type.

(org-insert-structure-template): Make sure that we use
case-insensitive match even when user changes case-fold-search value.

(org-structure-template-alist): Clarify selection of #+BEGIN/END
vs. #+begin/end in the docstring.

* etc/ORG-NEWS (Structure templates now respect case used in
~org-structure-template-alist~): Document the change.
2022-06-18 14:25:53 +08:00
Ihor Radchenko 65e19a0812
org-table.el: Fix orgtbl-mode not remapping delete key
* lisp/org-table.el (orgtbl-setup): Remap `delete-forward-char' in
addition to `delete-char'.  The former is called in Emacs >26.

Partially fixes
https://orgmode.org/list/1AD1B9B7-5A15-4F86-9274-B04B83694C85@misasa.okayama-u.ac.jp
2022-06-18 14:18:00 +08:00
Allen Li bfd63cc4f2
org: Improve org-todo handling of negative prefix args
* lisp/org.el (org-todo): Handle -1 prefix args consistently and error
on other negative args.
2022-06-18 14:07:11 +08:00
Sébastien Miquel 9fb9a2bdfb
org.el (org-format-latex-header): Put DEFAULT-PACKAGES before PACKAGES
* lisp/org.el (org-format-latex-header): Put DEFAULT-PACKAGES before
PACKAGES, as per org-latex-packages-alist's documentation.

`org-format-latex-header' is mostly used to generate in-buffer images
from LaTeX fragments.  For LaTeX document export, the header is
generated by `org-splice-latex-header' ond `org-latex-classes' instead
and the default and documented behaviour is to insert DEFAULT-PACKAGES
before PACKAGES.

See also
https://list.orgmode.org/877d5gg5rt.fsf@localhost/T/#m2ad2f3b1509e1af72016e8e6fad3557ff3083046
2022-06-18 12:46:53 +08:00
Ihor Radchenko 811deae32d
Revert "org-export-data: Concatenate strings in temporary buffer for performance"
This reverts commit a158b263a6.
The commit actually makes not measurable performance difference.
2022-06-17 19:32:44 +08:00
Ihor Radchenko 9b00f4bf1d
org-persist: Fix expiry check
* lisp/org-persist.el (org-persist--gc-expired-p): Fix incorrect plist
key.
2022-06-17 19:23:28 +08:00
Ihor Radchenko 41b7410a8c
doc/Makefile: Limit memory consumption when generating docs
* doc/Makefile: Do not disable garbage collection completely (as it
was after 3684c7967) when generating docs.  Use no too large 50Mb
`gc-cons-threshold' instead.

See
https://yhetil.org/emacs-devel/9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org
for the testing behind the 50Mb constant.
2022-06-17 13:18:39 +08:00
Robert Pluim e9da29b6fa
Escape single left quotes in docstrings
* lisp/ob-core.el (org-babel-default-header-args):
* lisp/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/ob-lua.el (org-babel-lua-read-string):
* lisp/ob-table.el (org-sbe):
* lisp/oc-basic.el (org-cite-basic--shorten-names):
* lisp/org-agenda.el (org-agenda-sorting-strategy):
(org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org-fold-core.el (org-fold-core--specs):
(org-fold-core-remove-folding-spec):
(org-fold-core-get-folding-spec):
(org-fold-core--isearch-overlays):
* lisp/org-plot.el (org--plot/prime-factors):
* lisp/org-table.el (org-table-collapse-header):
* lisp/org.el (org-special-ctrl-o):
(org-latex-to-html-convert-command):
* lisp/ox-html.el (org-html--unlabel-latex-environment):
* lisp/ox-publish.el (org-publish-find-property):
Use \\=' when there's a need for a single left quote in a docstring.

The emacs-29 byte compiler complains about such usage.
2022-06-16 20:51:02 +08:00
Ihor Radchenko 65e92c4383
doc/org-manual.org: Fix un-escaped macro
* doc/org-manual.org (Key bindings in Texinfo export): Escape macro
definition inside example block.
2022-06-16 20:26:32 +08:00