Commit Graph

25273 Commits

Author SHA1 Message Date
Stefan Kangas bf930b6fe5
; * lisp/org-refile.el (org-refile-targets): Fix typo. 2022-07-17 16:36:14 +08:00
Ihor Radchenko c550a42902
oc-basic: Parse @string entries in BiBTeX bibliographies
* lisp/oc-basic.el (org-cite-basic--parse-bibtex): Expand string
abbreviations in the .bib bibliography files.

Fixes https://list.orgmode.org/orgmode/25288.4658.491916.790389@gargle.gargle.HOWL/
2022-07-17 16:24:36 +08:00
TEC 0583a0c5ea
org: Add setting for remote file download policy
* lisp/org.el (org-resource-download-policy, org-safe-remote-resources):
Two new customisations to configure the policy for downloading remote
resources.
(org--should-fetch-remote-resource-p, org--safe-remote-resource-p,
org--confirm-resource-safe): Introduce the new function
`org--should-fetch-remote-resource-p' for internal use determining
whether a remote resource should be downloaded according to the download
policy.  This function makes use of two helper functions,
`org--safe-remote-resource-p' and `org--confirm-resource-safe'.
(org-file-contents): Apply `org--safe-remote-resource-p' to file
downloading.

* lisp/org-persist.el (org-persist-write): Apply
`org--safe-remote-resource-p' to url downloading.

* lisp/org-attach.el (org-attach-attach, org-attach-url): Apply
`org--safe-remote-resource-p' to url downloading.
2022-07-16 17:46:01 +08:00
Nicholas Vollmer d947988722
* lisp/ob-core.el: Fix docstring quote usage
(org-babel-default-header-args): escape syntactic single quote in docstring
(org-babel-result-to-file): escape syntactic single quote in docstring
2022-07-14 21:34:32 +08:00
Ihor Radchenko 8e2fed82ed
org-fold: Make sure that changes do not leave partially folded headings
* lisp/org-fold-core.el (org-fold-core--fix-folded-region): Check
fragility in all the indirect buffers.
* lisp/org-fold.el (org-fold--reveal-headline-at-point): New function
revealing heading line or full heading when the heading only contains
blank lines.
(org-fold--reveal-outline-maybe): Check headline at the end of folded
region as well.  Use `org-fold-core--fix-folded-region'.
* lisp/org.el (org-insert-heading): Make sure that the newline in
front of heading is revealed.
2022-07-12 21:51:40 +08:00
Ihor Radchenko f29ccf3161
test-org-fold: Cover the issue fixed by previous commit
*
testing/lisp/test-org-fold.el (test-org-fold/org-fold-reveal-broken-structure):
Test `org-delete-char' instead of `delete-char'.  The former is the
function used interactively.
2022-07-12 21:30:58 +08:00
Ihor Radchenko a79a742cbf
Revert "org.el: Improve performance of deletion commands"
This reverts commit 46df681336.

The optimization broke folding fragility checks.
2022-07-12 15:05:45 +08:00
Ihor Radchenko c66bdb0c9b
org-fold-core-style: Clarify "error-prone" in the docstring
* lisp/org-fold-core.el (org-fold-core-style): Explain that the new
folding with text properties can be problematic with third-party
packages, not with Org itself.

See https://orgmode.org/list/877d4jve13.fsf@gmail.com
2022-07-12 09:02:47 +08:00
Ihor Radchenko 654005394b
org-list-struct-apply-struct: Do not rely on `match-data' after edits
* lisp/org-list.el (org-list-struct-apply-struct): Refresh
`org-list-full-item-re' match data if we edit the bullet.  Fixes
https://orgmode.org/list/62cbc0f3.1c69fb81.13d5e.e250SMTPIN_ADDED_BROKEN@mx.google.com
* testing/lisp/test-org-list.el (test-org-list/indent-item): Add test
checking for the reported bug.
2022-07-11 19:13:07 +08:00
Ihor Radchenko 53e6aa866e
org-agenda: Make sure that clock report header has trailing newline
* lisp/org-agenda.el (org-agenda-list): Add trailing newline to
`org-agenda-clock-report-header' if there is none.
2022-07-11 13:01:50 +08:00
Ihor Radchenko c231e93b56
ol-docview: Throw an error when trying to open non-existing file
* lisp/ol-docview.el (org-docview-open): Throw an error when file does
not exist.  Creating an empty document buffer is not useful here.

Fixes https://orgmode.org/list/87zgklmd0g.fsf@localhost
2022-07-11 13:00:05 +08:00
Al Haji-Ali bc33c0133d
lisp/org.el: Save restrictions in all agenda file buffers
* lisp/org.el (org-agenda-prepare-buffers): Call
`org-with-wide-buffer' for every buffer in the agenda, instead of
calling `save-excursion'/'`save-restrictions' just for the current
buffer, to save restrictions in all buffers.  Use
`with-current-buffer' instead of `save-excursion'/'`set-buffer'.

See https://list.orgmode.org/orgmode/87y1x588rs.fsf@thinkpad.mail-host-address-is-not-set/

TINYCHANGE
2022-07-10 18:02:13 +08:00
Ihor Radchenko 5b45ad083c
oc-basic: Detect malformed bibtex bibliographies
* lisp/oc-basic.el (org-cite-basic--parse-bibtex): Validate the
bibliography before parsing.  Display list of issues if any (via
`bibtex-validate`).
(org-cite-basic--parse-bibliography): Set buffer file name needed by
`bibtex-validate`.  Empty the cache in case of error.
2022-07-09 17:12:47 +08:00
Matt Huszagh 8be689f119
ob-core.el: Improve org-babel-default-header-args docstring
* lisp/ob-core.el (org-babel-default-header-args): Provide an example
illustrating one benefit of using closures as default header
arguments.  Additionally, explain how to provide the same type of
header argument multiple times in the default alist.
2022-07-09 13:20:47 +08:00
Matt Huszagh e8dd98d151
ob-core.el: Fix behavior of lambda default header arg vars
* lisp/ob-core.el (org-babel-merge-params): Permit multiple :var
default header arguments when using closures.
2022-07-09 13:20:46 +08:00
Ihor Radchenko e0e016c1ae
org-element: Do not try to sync element cache in the middle of a change
* lisp/org-element.el (org-element--cache-sync): Do not sync between
`before-change-functions' and `after-change-functions'.

Fixes https://orgmode.org/list/87tu7tdljo.fsf@no.workgroup
2022-07-09 12:08:49 +08:00
Matt Rudary a7cc95c60c
org-src.el: Add plain to org-src-window-setup customization
* lisp/org-src.el (org-src-window-setup): Add plain to the list of
valid choices for `org-src-window-setup'.

A previous change added it to the documentation and to the pcase that
process this variable in `org-src-switch-to-buffer', but the defcustom
did not include it as a valid option.

TINYCHANGE
2022-07-09 12:04:07 +08:00
András Simonyi b3b17cdb66
oc-csl.el: Add support for nocite citations
* lisp/oc-csl.el (org-cite-csl--rendered-citations): Collect nocite
style citations in a separate list as required by the citeproc-el
API. Set the output of all nocite citations to the empty string.
(org-cite-csl--nocite-p): New helper predicate for checking whether a
citation is a nocite.
2022-07-07 18:42:55 +08:00
Ihor Radchenko 0495961f36
org-auto-repeat-maybe: Use effective time for "LAST_REPEAT"
* lisp/org.el (org-auto-repeat-maybe): Use effective time when
recording LAST_REPEAT property.

Fixes https://orgmode.org/list/87sfnk7l0h.fsf@jonreeve.com
2022-07-07 18:16:14 +08:00
Ihor Radchenko db12a497d2
org-agenda: Use ARG instead of `current-prefix-arg'
* lisp/org-agenda.el (org-agenda): Use the function argument instead
of `current-prefix-arg' when calling agenda view.  This is safe
because `org-agenda' uses raw "P" interactive spec.

Fixes https://list.orgmode.org/m2pmimnymk.fsf@air.local.mail-host-address-is-not-set/T/#u
2022-07-07 18:00:57 +08:00
Ihor Radchenko bdf7afe20e
ob-core: Fix nil value of `org-babel-temporary-stable-directory'
* lisp/ob-core.el: Make sure that
`org-babel-temporary-stable-directory' is set to non-nil non-existent
directory.  Non-existent directory is required to avoid clashes when
multiple Emacs processes are running.

Fixes https://yhetil.org/emacs-devel/87sfnfhm6v.fsf@yandex.com
2022-07-07 17:27:50 +08:00
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