* lisp/ob-ref.el (org-babel-ref-resolve): Add support for
`named-block[]' syntax, resolving to the contents of a named-block.
* lisp/ob-core.el (org-babel-read-element): Read a code block into its
contents, like other blocks.
* testing/listp/test-ob.el (test-ob/block-content-resolution): Test
block content resolution.
* doc/org-manual.org: Document syntax.
* etc/ORG-NEWS: Document syntax.
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Do not
rely on 10ms delay to initialize Python. Wait until python process is
initialized using `org-babel-comint-wait-for-output'.
* lisp/ol-bibtex.el (org-bibtex-put): Add new optional argument to
insert node property at point directly, without leveraging
`org-set-property'. Add docstring.
(org-bibtex-write): Insert headline properties directly. Add new
optional argument to suppress indentation. Do not use `length' to
check if `org-bibtex-entries' list empty---`length' is too slow on
large lists.
(org-bibtex-import-from-file): Postpone indentation after all the
entries are imported.
* lisp/org.el (org-indent-region): Use cache.
* lisp/ol-info.el (org-info--link-file-node): New helper to parse info
link info file (manual) name and node.
(org-info-follow-link, org-info-export): Use `org-info--link-file-node'.
(org-info-description-as-command): New function to create description
for info links that may executed to view the manual.
(org-link-parameters): Specify `org-info-description-as-command' as
`:insert-description' for info links.
(org-info-other-documents): Add URL of directory index.
* testing/lisp/test-org-info.el (test-org-info/export): Add cases for
texinfo export with link description.
(test-org-info/link-file-node, test-org-info/description-as-command):
New tests for new functions `org-info--link-file-node' and
`org-info-description-as-command'.
Use recently added :insert-description feature of `org-link'.
Alternative separators between file name and node ":", "::", "#:"
are preserved. Added interpretation of empty path or omitted
file name as info dir index.
* lisp/ox-md.el (defcustom org-md-toplevel-hlevel): Define the customizable
variable that defines the top level heading to use when exporting to markdown.
(org-export-define-derived-backend): Read the value of the new
`org-md-toplevel-hlevel' variable into the `:options-alist' for this backend
(org-md--build-toc): Use the newly defined top-level heading setting to control
the heading level for the "Table of Contents" text.
(org-md-headline): Use the newly defined top-level heading setting as an offset
to the heading level calculated by `org-export-get-relative-level'.
This patch adds a new setting: `org-md-toplevel-hlevel' that controls which
Markdown heading level is used for top level headings. This change makes
markdown export more like HTML export, which has a `org-html-toplevel-hlevel'
variable which does the same thing for HTML export.
TINYCHANGE
* lisp/ob-comint.el (org-babel-comint-wait-for-output): Do not rely on
`face-at-point' returning non-nil.
* lisp/ob-shell.el (org-babel-shell-set-prompt-commands): New constant
holding shell-specific commands to change prompt.
(org-babel-prompt-command): New variable holding command to be user to
set distinguishable prompt.
(org-babel-shell-initialize): Set `org-babel-prompt-command' according
to shell name.
(org-babel-sh-prompt): New variable holding default shell prompt.
(org-babel-sh-initiate-session): Change the default prompt to
`org-babel-sh-prompt' and alter `comint-prompt-regexp' to match it
tightly.
Fixes https://list.orgmode.org/CKK9TULBP2BG.2UITT31YJV03J@laptop/T/#mc8e3ca2f5f1b9a94040a68b4c6201234b209041c
* lisp/org-element.el (org-element-cache-map--recurse): Remove.
(org-element-cache-map): Do not perform a cache-filling pass. This is
not gaining any speed in practice.
* lisp/org-fold-core.el: Remove the code overriding
`font-lock-default-fontify-region'. Emacs itself is skipping
fontification of invisible text and doing it more efficiently. The
org-fold fontification overrides are redundant, except when some
poorly written third-party code is forcing fontification inside folded
regions. However, Org does not need to entertain poorly written third
party code, especially when the required supporting code is reducing
font-lock performance and is complicating the maintenance.
(org-fold-core--specs):
(org-fold-core-add-folding-spec): Remove `:font-lock-skip' spec.
(org-fold-core-initialize):
(org-fold-core--fontifying):
(org-fold-core-region):
(org-fold-core--force-fontification):
(org-fold-core-fontify-region): Remove custom fontification.
* lisp/org-fold.el (org-fold-initialize): Remove `:font-lock-skip'
spec.
* lisp/org-macs.el (org-fold-core--force-fontification):
(org-with-forced-fontification):
(org-buffer-substring-fontified):
(org-looking-at-fontified): Remove org-fold's font-lock logic.
* lisp/ox.el (org-export-search-cells): Use #+RESULTS keyword as
search cell when #+NAME is not provided. Update the docstring
accordingly.
(org-export-resolve-fuzzy-link): Update the docstring.
* doc/org-manual.org (Exporting Code Blocks): Document the new
behavior and explain the details of exporting links to named code
blocks/results.
Fixes https://orgmode.org/list/010201826cb68597-bf75d596-7890-4dd0-b9ff-0c7b617b4dd4-000000@eu-west-1.amazonses.com
* lisp/ob-core.el (org-babel-execute-src-block): Post-process and
return results even when "none" results parameter is given. Document
that the result value is returned, as it is assumed by
`org-babel-ref-resolve'.
(org-babel-result-cond): Do return results even when "none" results
parameter is given.
According to the manual ":results none" should only affect how the
results of evaluation are inserted into the buffer. However, the
results are simply ignored currently. Fix this.
* lisp/ob-ref.el (org-babel-ref-resolve): Set :results to "none" when
resolving noweb references. Together with the above changes, this
makes Org not echo the results value yet returning the value
programatically.
Reported in https://orgmode.org/list/7702b511-c289-5688-c64c-fb673324a63a@posteo.eu
* doc/org-manual.org (System-wide header arguments): Update the
default value of `org-babel-default-header-args'. Document that
inline source blocks use a different set of the default arguments.
* doc/org-manual.org (Footnotes): Fix links to particular sections in
MathJax manual.
Scheme is not changed to https: since the site prefers http:
curl -I https://docs.mathjax.org/
HTTP/2 302
date: Sun, 03 Oct 2021 16:04:15 GMT
location: http://docs.mathjax.org/en/latest/
* lisp/org.el (org-align-tags): Re-use 'line-prefix text property when
`org-indent-mode' is enabled. The old version partially copy-pasted
the org-indent code and missed the new changes in inlinetask
alignment. The new approach should be robust against future
org-indent changes.
Fixes https://orgmode.org/list/25334.19025.107017.390781@gargle.gargle.HOWL
* lisp/org-clock.el (org-clocktable-defaults): Add default value for
new clock table option `:filetitle'.
(org-clock-get-file-title): Add new function to extract title of org file.
(org-clocktable-write-default): Print org file name in clock table if
`:filetitle' is set to `t'.
* doc/org-manual.org (The clock table): Include new `:filetitle'
option in manual for clock table.
* etc/ORG-NEWS (New =:filetitle= option for clock table): Include new
`:filetitle' option for clock table.
Allow user to show org file title instead of file name in the
clock table. If the file does not have a title defined, the file name
will be shown in the clock table.
TINYCHANGE
* ob-julia.el (org-babel-julia-evaluate-session, commentary): Add line
to initialize ESS so that Julia sessions work. Also added text in
commentary about Julia packages that sessions require. Fix
contributed by Stephen Eglen. See discussion:
https://stat.ethz.ch/pipermail/ess-help/2022-August/013113.html.
* ob-julia.el (org-babel-julia-evaluate-session, commentary): Add line
to initialize ESS so that Julia sessions work. Also added text in
commentary about Julia packages that sessions require. Fix
contributed by Stephen Eglen. See discussion:
https://stat.ethz.ch/pipermail/ess-help/2022-August/013113.html.
* lisp/org.el (org-agenda-prepare-buffers): Avoid creating huge lists
when computing `org-todo-keywords-for-agenda',
`org-done-keywords-for-agenda', and
`org-todo-keyword-alist-for-agenda'. Instead of using `append' in
every single agenda file + `org-uniquify' on a giant lists at the end,
check and add unique list elements in place.
This patch reduces load on Emacs GC when the number of agenda files is
large.
* lisp/org.el (org-agenda-file-menu-enabled): New variable controlling
whether `org-mode' updates the agenda file list in the menu.
(org-mode): Honor the new variable.
(org-agenda-prepare-buffers): Suppress `org-install-agenda-files-menu'
when opening the agenda files. Run it once at the end.
This commit reduces performance overheads when the number of agenda
files is large.
* lisp/org.el (org-agenda-prepare-buffers): Use the shortest list as
the first argument in `org--tag-add-to-alist'.
`org--tag-add-to-alist' is looping over the first argument. When we
use the accumulated tags as the first argument, each buffer tag will
need to be looped over N_buffers/2 times on average, creating
quadratic complexity. Avoid this.
Reported in https://orgmode.org/list/62f66552.050a0220.ed346.ac05SMTPIN_ADDED_BROKEN@mx.google.com
* lisp/org-fold-core.el (org-fold-core-get-regions): New function to
retrieve the list of folded regions in buffer.
(org-fold-core-regions): New function to set folding state in buffer
according to the list returned by `org-fold-core-get-regions'.
(org-fold-core-save-visibility): New macro, equivalent to
`org-fold-save-outline-visibility'.
* lisp/ob-tangle.el: Refactor the double implementation to a single
helper function. This avoids the double link wrapping.
* testing/lisp/test-ob-tangle.el: Add unit tests.
Babel tangle allows inserting comments at the tangled site which link
back to the source in the org file. This linking was implemented
twice, to handle separate cases, but when using ‘:comments noweb’ it
ended up going through both codepaths. This resulted in doubly
wrapped links.
By refactoring all link generation into a single function, this double
wrapping is avoided.
Example file, /tmp/test.org:
* Inner
#+name: inner
#+begin_src emacs-lisp
2
#+end_src
* Main
#+header: :tangle test.el :comments noweb :noweb yes
#+begin_src emacs-lisp
1
<<inner>>
#+end_src
Before:
;; [[file:test.org::*Main][Main:1]]
1
;; [[[[file:/tmp/test.org::inner][inner]]][inner]]
2
;; inner ends here
;; Main:1 ends here
After:
;; [[file:test.org::*Main][Main:1]]
1
;; [[file:test.org::inner][inner]]
2
;; inner ends here
;; Main:1 ends here
* lisp/ox-icalendar.el (icalendar): Use nil transcoders instead of
`ignore' for ignored element types. Otherwise, `org-export-data'
still exports the ignored element contents, including resolving links,
and the result is ignored. The contents might contain broken links
and hence lead to errors despite the whole element not supposed to be
exported.
Fixes https://orgmode.org/list/45aa417a-7eb1-1070-b0dd-17bdd7d1448f@mailbox.org
* lisp/ol-man.el (org-man-open): Set window point not buffer point and
wait before search. When passed man:path::SEARCH `org-man-open' uses
`search-forward' to jump to the location of e.g. a heading. Prior to
this fix it only used `search-forward', which will not change the
point of the cursor in the window, meaning that even if there is a
match it will not appear. Use `accept-process-output' to block until
the manpage finishes rendering before searching the buffer so that
there will be something to find.
* lisp/oc-csl.el: Register the newly added citation styles "title",
"locators and "bibentry" as supported by the "csl" export processor.
(org-cite-csl--create-structure-params): Add support for the creation
of citation structures with the new citation styles.
* lisp/org.el (org-fast-tag-selection): After automatically assigning
a-z as keys for selection, offer A-Z range. Continue with characters up
to tilde character before showing only blanks. Replaces previous logic
where also hard-to-type characters were assigned.
TINYCHANGE
* lisp/org-src.el (org-src-font-lock-fontify-block): If fontified text
has `invisible' text property, avoid interfering with Org folding
making the invisibility of lower priority compared to folding.
Fixes https://orgmode.org/list/87zgghrsd2.fsf@gmail.com