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-src.el (org-src-font-lock-fontify-block): Never set
font-lock properties when `get-text-property' returns nil. This
usually means that the property is not present in the position
property list. The old behavior could, for example, set 'invisible
property to nil explicitly and prevent folding completely.
Fixes https://list.orgmode.org/CA+G3_PN6RvcRcvN2fM=vfK1K6UsT=nNPJ7SUucmA1Ypc=Emorg@mail.gmail.com/T/#u
* lisp/org-src.el (org-edit-src-goto): org-edit-src-goto factors out
the functionality from org-edit-src-continue. The latter needs an event.
The return key is bound to org-edit-src-goto for the overlay.
* lisp/org-src.el (org-src-lang-modes): It is reasonable to assume that
src blocks with the "toml" and "desktop" lang should use
`conf-toml-mode' and `conf-desktop-mode', respectively.
* lisp/org-src.el (org-fontify-inline-src-blocks-1): Refactor
`org-fontify-inline-src-blocks-1' to bring down the maximum line
length. While we're at it, get rid of the debugging `message' call that
somehow made its way in, and an unused variable in the `let' statement.
* 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-src.el (org-src-font-lock-fontify-block): Reset the
modification flag of the temporary fontification buffer after
fontifying.
Without this some modes cause Emacs to prompt about unsaved buffers
when exiting: "Save buffer *org-src-fontification:...-mode*?".
* lisp/org-compat.el (org-file-name-concat): Do not use
`string-empty-p'.
(combine-change-calls): Create a stub when `combine-change-calls' were
not yet available.
(org-replace-buffer-contents): Add compatibility function for
`replace-buffer-contents'.
* lisp/org-element.el (org-element--current-element): Do not use
`if-let'.
* lisp/org-persist.el (org-persist-gc): Do not use `when-let'.
* lisp/org-plot.el (org-plot/gnuplot): Do not use `if-let'.
* lisp/org-src.el (org-edit-src-save, org-edit-src-exit): Use
`org-replace-buffer-contents'.
* lisp/org.el (org-narrow-to-subtree, org--property-local-values,
org-entry-get-with-inheritance, org-in-commented-heading-p,
org-up-heading-safe, org-goto-first-child): Do not use
`if-let'/`when-let'.
* testing/org-test.el (org-test-at-time): Fallback to old
`decode-time' specification in older Emacs.
* lisp/org-macs.el (org-do-remove-indentation): Add optional argument
to skip the first line.
* lisp/org-src.el (org-src--coordinates): Fix coordinates for inline
LaTeX fragments.
(org-src--contents-for-write-back): Do not indent first line for LaTeX
fragments.
(org-src--edit-element): Compute block-indentation according to parent
for LaTeX fragments. Skip first line when removing common indentation
for LaTeX fragments.
* lisp/org-src.el (org-src--contents-for-write-back): Do not indent blank lines, except for the
current line maybe.
(org-src--preserve-blank-line): New variable, whether to preserve
indentation of the current blank line.
(org-src--edit-element): Set `org-src--preserve-blank-line'.
* lisp/org.el (org-indent-line): When tab acts natively, do some
preindentation, which signals `org-src--edit-element' to
preserve the indentation of current blank line.
Removing all the whitespace was the original behaviour for all blank lines, before `857ae366b3`.
* lisp/org-src.el (org-src--contents-for-write-back): Do not indent
blank lines, except for the current line.
This was the original behaviour for all blank lines, before `857ae366b3`.
* lisp/org-src.el (org-edit-src-save):
(org-edit-src-exit): Use `replace-buffer-contents' only for emacs >=
27.
It was introduced in emacs 26.1, but earlier versions made no
guarantees of correctness.
* lisp/org-src.el (org-src--contents-for-write-back): Shorten the
first line of the docstring.
(org-edit-src-exit): Conditionnally kill the write-back buffer.
* lisp/org-src.el (org-src--contents-for-write-back): Use a write
back buffer.
* lisp/org-src.el (org-edit-src-exit, org-edit-src-save): Use
`replace-buffer-contents'.
Reported-by: "Sébastien Miquel" <sebastien.miquel@posteo.eu>
Link: https://orgmode.org/list/603f9c4e-c621-7592-5b20-a7354c11d5d2@posteo.eu/
* lisp/org-src.el (org-src--coordinates)
(org-src--goto-coordinates): Use point instead of column.
Using a column-based approach fails to account for invisible regions
or display overlays that change the number of columns: for example,
showing a LaTeX \alpha as α. In src edits which involve such
structures, this causes the point to be shifted undesirably. By using
a point-based approach this issue does not occur.
These show up in the Emacs repo (before and after the latest sync in
f22856a5c5), but for an unknown reason do not show up with `make
compile' or `make single' in the Org repo.
All of these functions are autoloaded.
* lisp/org-src.el (org-src--edit-element): Clear undo information once
the initial contents have been inserted.
* testing/lisp/test-org-src.el (test-org-src/undo): New test.
* lisp/org-src.el (org-src--contents-area): Handle `latex-fragment'.
(org-edit-latex-fragment): New function.
* lisp/org.el (org-edit-special): Use new function.
* doc/org-manual.org (Execute commands in the active region):
Update the manual given the new defaults.
* etc/ORG-NEWS (New default settings for some options): New
section.
* lisp/org.el (org-loop-over-headlines-in-active-region):
Change the default value to `t'.
(org-fontify-done-headline): Ditto.
* lisp/org-agenda.el
(org-agenda-loop-over-headlines-in-active-region): Ditto.
* lisp/org-src.el (org-src-tab-acts-natively): Ditto.
* lisp/org-src.el (org-edit-src-code): Don't throw an error
when trying to find the source language in a non-interactive
call, typically when called for template expansion.
Thanks to Tyler Smith and Jack Kamm for reporting a related bug.
* lisp/org-src.el (org-src-switch-to-buffer): Add call to
quit-restore-window in org-src-switch-to-buffer when
org-src-window-setup is other-window so that the popped up window is
closed on exit.