* 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.
* 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
* 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.
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'.
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".
* 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
* 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.
* 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
* 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.
* lisp/ob-lilypond.el (org-babel-lilypond-commands):
* lisp/ob-shell.el (org-babel-shell-names):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-clock.el (org-clock-ask-before-exiting):
* lisp/org-duration.el (org-duration-units):
* lisp/org-faces.el (org-set-tag-faces):
* lisp/org-footnote.el (org-footnote-section):
* lisp/org-list.el (org-plain-list-ordered-item-terminator):
(org-list-allow-alphabetical):
* lisp/org.el (org-babel-do-load-languages):
(org-set-modules):
(org-export-backends):
(org-use-fast-todo-selection):
(org-enforce-todo-dependencies):
(org-enforce-todo-checkbox-dependencies):
(org-display-custom-times):
(org-set-packages-alist):
(org-set-emph-re):
* lisp/ox-odt.el (org-odt-schema-dir): Use
`set-default-toplevel-value' instead of `set' or `set-default' in
`defcustom' :set argument.
This commit fixes a bug that occurred when using an autoload function
inside a let-binding for a custom variable when the feature defining
both the function and the custom variable had not been loaded yet.
See bug#54399 and
https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00085.html,
https://lists.gnu.org/archive/html/emacs-orgmode/2022-06/msg00226.html
* lisp/org.el (org-mode): Remove the old performance workaround for
right-to-left text in Org buffers. With newer Emacs settings, it is
the 'left-to-right value of `bidi-paragraph-direction' that causes the
slowdown; not the vice versa.
Old discussion on overriding the defaults:
https://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00285.html
The new discussion with example file demonstrating the performance
problem:
https://orgmode.org/list/87a6iqo7x8.fsf@localhost
* lisp/org.el (org-in-commented-heading-p): When element at point is
not yet in cache, parse the parent headline instead of also parsing
section up to point.
* lisp/org.el (org-latex-preview): With an active region, display
images for all fragments in the region. With universal prefix
argument, remove all images in the region.
* lisp/org.el (org-get-buffer-tags): Use hash table to accumulate
unique tags only. The old approach also used hash tables under the
hood of `delete-dups', but required extra memory allocation to store
the full tag list.
* lisp/org.el (org-delete-char):
(org-delete-backward-char): Wrap into
`org-fold-core-ignore-modifications'. These commands are for
interactive use anyway and they have no risk of not inheriting folding
properties.
* lisp/org.el (org-do-emphasis-faces): Reveal hidden parts of links
fontified by `org-activate-link', if any.
Partially fixes
https://list.orgmode.org/t7np1d$vu8$1@ciao.gmane.io/T/#u
The proper fix should also involve `org-activate-link' not hitting
false-positives inside verbatim.
* lisp/org.el (org-babel-load-file): Update modification time even
when `org-babel-tangle-file' does not actually modify the tangled
file. This makes sure that modify-time comparison logic does not make
Org re-tangle Org file that had been changed but the changes did not
affect the tangled code.
See https://orgmode.org/list/t5j75h$dbo$1@ciao.gmane.io
* lisp/org.el (org-todo-yesterday): Fix an incorrect use of apply when
`org-todo-yesterday' intends to call `org-agenda-todo-yesterday' with
the same interactive arg. Before this change, the command incorrectly
set the todo state of the task to blank when called with C-u C-u C-u
in an agenda buffer (supposed to bypass any blocked
checkboxes/subtasks).
TINYCHANGE
* lisp/org.el (org-property-separators, org-property-get-separator):
Created.
(org-entry-get, org-entry-get-with-inheritance): Use new
`org-property-get-separator' function.
* testing/lisp/test-org.el (test-org/entry-get): Added tests for
combining properties with custom separators
`org-property-separators' is a customization option that allows for
properties to be combined using a separator other than the default (a
single space). It is an alist with the car of each element being a
list of property names or regular expression and the cdr being the
separator string, like '((("EXPORT_FILE_NAME") . "/")).
* lisp/org.el (org--deadline-or-schedule): Match warning period if
provided in TIME arg.
* testing/lisp/test-org.el (test-org/deadline): Add relevant tests.
Fixes https://orgmode.org/list/87o85bl582.fsf@localhost
* lisp/org.el (org-fast-tag-selection): Disabled tags face
A tag can be either selected in "current", "inherited" or disabled. When
disabled, it should have the default face. Previously, if a tag was
already selected, when deselection it will still have an org-todo face.
https://lists.gnu.org/archive/html/emacs-orgmode/2021-10/msg00350.html
* lisp/org.el (org-set-regexps-and-options): Change
`org-complex-heading-regexp-format' initialization so that the regexp
it produces also matches a headline if it is commented.
TINYCHANGE
* lisp/org.el (org-todo): Insert new todo keyword before
`save-excursion' markers. This avoids apparent point movement when a
new keyword is inserted into an empty heading.
Before: "* <point>" -> "*<point> TODO";
After: "* <point>" -> "* TODO<point>";
Fixes https://orgmode.org/list/87mtg6265i.fsf@yandex.com
* lisp/org-clock.el (org-clock-in):
(org-clock-find-position):
(org-clock-out):
* lisp/org.el (org-add-planning-info):
(org-scan-tags):
(org-global-tags-completion-table):
(org-make-tags-matcher):
(org-tags-expand):
(org--property-local-values):
(org-read-date-analyze):
(org-revert-all-org-buffers):
(org-beginning-of-line): Make sure that we inherit invisible state
when inserting text.
(org-sort-entries): Preserve invisible state after replace-match.
(org-log-beginning): Do not try to move by visible lines.
* lisp/org-macs.el (org-preserve-local-variables): Do not try to
preserve overlays.
* lisp/ox.el (org-export--generate-copy-script): Preserve folding
properties in export buffer.
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation): Fix
test failure.
* testing/lisp/test-org.el (test-org/meta-return):
(test-org/custom-properties): Use new folding.
* lisp/ol.el (org-link--link-folding-spec):
(org-link--description-folding-spec): New variables controlling link
folding settings.
(org-link--reveal-maybe): Handle revealing folded links.
(org-link-descriptive-ensure): Implement `org-link-descriptive'
support with org-fold.
(org-toggle-link-display--overlays):
(org-toggle-link-display--text-properties):
(org-toggle-link-display): Provide text-properties and overlays
versions.
* lisp/org-agenda.el (org-agenda-mode): Use org-fold to fold links in
agenda.
* lisp/org.el (org-do-emphasis-faces): Use org-fold.
* lisp/org.el (org-at-heading-p): Use second argument to allow
checking for visible headings. Note that by default, unlike
`outline-on-heading-p', `org-at-heading-p' returns non-nil for
invisible headings. Passing second argument is just like
`(outline-on-heading-p)'.
(org-indent-line):
* lisp/org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org-colview.el (org-columns--call):
(org-columns-store-format): Update arguments in `org-at-heading-p'
calls.
* lisp/org.el (org-diary-sexp-entry): Don't use lexical scope for eval
sexps.
This commit partially reverts 6d73cd34a.
Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
* lisp/org.el (org-run-like-in-org-mode): Strength reduce `eval`
to `cl-progv`.
(org--check-org-structure-template-alist): Strength reduce `eval`
to `symbol-value`.
(org-map-entries, org-eval-in-calendar, org-diary-sexp-entry):
Make sure we use the new lexically scoped dialect.
(org--math-always-on): New function, extracted from advice.
(org-cdlatex-mode): Use it with `advice-add`.
(org-self-insert-command): Simplify `and`+`listp` into `consp`.
(org-submit-bug-report):
Make sure we use the new lexically scoped dialect.
* lisp/org-protocol.el (org-protocol-convert-query-to-plist):
Use `cl-mapcan`.
(org--protocol-detect-protocol-server): New function, extracted
from advice.
(server-visit-files): Use it with `advice-add`.
* lisp/org-mouse.el (org--mouse-dnd-insert-text): New function, extracted
from advice.
(dnd-insert-text): Use it with `advice-add`.
(org--mouse-dnd-open-file): New function, extracted from advice.
(dnd-open-file): Use it with `advice-add`.
(org--mouse-open-at-point): New function, extracted from advice.
(org-mode-hook): Advise `org-open-at-point` with `advice-add`.
* lisp/org-ctags.el (org--ctags-load-tag-list): New function, extracted
from advice.
(visit-tags-table): Use it with `advice-add`.
(org--ctags-set-org-mark-before-finding-tag): New function, extracted
from advice.
(xref-find-definitions): Use it with `advice-add`.
* lisp/org-compat.el (org-bookmark-jump-unhide): Accept (unused) args.
(save-place-find-file-hook): Use `advice-add`.
(org--ecb-show-context): New function, extracted from advice.
(ecb-method-clicked): Use it with `advice-add`.
(org-mark-jump-unhide): Accept (unused) args.
(pop-to-mark-command, exchange-point-and-mark, pop-global-mark):
Use `advice-add`.
Along the way, remove some redundant `:group` args
(redundant because they specify the same group as would be used by
default anyway) and make a few other simplifications.
Also don't bother putting `advice-add` within an eval-after-load
since the advice machinery already takes care of handling it.
* lisp/org.el (org-copy-visible): Decide whether text is invisible by
calling invisible-p rather than checking whether the invisible
property at point is non-nil.
Text may have a non-nil invisible property but _not_ be hidden from
the user (and thus should be copied by org-copy-visible). For
example, the link itself is shown when org-link-descriptive is nil,
but it still has an invisible property of `org-link'.
* lisp/org.el (org-copy-visible): Don't copy invisible text that
follows invisible text with a different property value.
If org-copy-visible sees that the left bound position has a non-nil
invisible property, it uses next-single-char-property-change to find
the new bound. However, next-single-char-property-change may just
find a bound that still has a _different_ non-nil invisible property.
Reported-by: "Максим Бабушкин" <maxbabushkin@gmail.com>
Link: https://debbugs.gnu.org/49967
* lisp/org.el (org-mode): Initialise cache earlier, allowing the
file-local settings to be taken from persistent cache when
possible. Also, bind `org-mode-loading' while org-mode is loading.
* lisp/ol.el (org-update-radio-target-regexp): Do not try to refresh
cache when we are loading file for the first time.
* lisp/org-element.el (org-element-cache-map-continue-from): New
variable forcing `org-element-cache-map' to continue from a custom
point in buffer.
(org-element-cache-map): Add support for
`org-element-cache-map-continue-from'. Update docstring accordingly.
Also, make sure that mapping terminates correctly when FUNC deletes
all elements in buffer.
* testing/lisp/test-org.el (test-org/map-entries): Add test.
Fixes https://orgmode.org/list/CADywB5KOJ1p0NpvA=iX-ybHsO=huGA8qL3xMpUTETmS2qp7_ng@mail.gmail.com
* lisp/org.el (org-set-effort):
(org-property-next-allowed-value): Do not use text properties cache
for `effort' and `effort-minutes' when org-element-cache is active.
These text properties are superceded by element cache and their only
effect (when cache is active) is extra load on Emacs garbage collector
leading to overall Emacs slowdown.
* lisp/org-clock.el (org-clock-in): Use `org-element-use-cache'
instead of `org-element--cache-active-p' to check if element cache is
active. The latter is too precise and may trigger
`org-refresh-effort-properties' when cache is temporarily disabled by
internal calls.
* lisp/org.el (org-priority): When reading numeric priorities, provide
special handling of SPC so that it clears the priority, as advertised.
If the user has configured numeric priorities and tries to clear a
priority by inputting SPC at the prompt, org-priority feeds " " to
string-to-number and ends up with 0 instead of the ?\s (32) that's
used downstream to signal "remove". Explicitly check for " " and
translate it to ?\s.
Reported-by: "Bruce E. Robertson" <brucer42@gmail.com>
Link: https://list.orgmode.org/877dch89s1.fsf@kyleam.com/
* lisp/org-src.el (org-fontify-inline-src-blocks,
org-fontify-inline-src-blocks-1): Create a function to search the buffer
up to a limit for inline src blocks. Light fontification is applied to
matched inline src blocks. When `org-src-fontify-natively' is
set, `org-src-font-lock-fontify-block' is applied to the content.
* lisp/org.el (org-set-font-lock-defaults): Add
`org-fontify-inline-src-blocks' to `org-font-lock-extra-keywords', which
is locally bound inside `org-set-font-lock-defaults'.
* lisp/org-faces.el: Introduce a new face `org-inline-src-block' which
inherits from `org-block' by default.
* lisp/org.el (org-display-inline-image--width): Before attempting to
interpret a :width attribute numerically, check that it indeed starts
with a digit and use the default value given by `org-image-actual-width'
if not. However, if a value of "t" is given, treat this as if
`org-image-actual-width' were "t" and just use the image's pixel width.
This change fixes a strange behaviour where a non-numeric width would
previously display the image with zero width.
* lisp/org.el (org-display-inline-image--width): When
display-line-numbers-width is nil, the width is computed dynamically.
This does not mean that the line number width is necessarily 0.
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.6 to
Emacs 29.1.
Emacs 28.1 is nearing release. The earliest Emacs version that Org
9.6 would be synced with is 29.1.