0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-22 13:48:38 +00:00
Commit graph

16330 commits

Author SHA1 Message Date
Kyle Meyer b2717ca5a7 Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.4 to
Emacs 27.2.

9.4.x, rather than 9.3.8, may be synced for the upcoming Emacs 27.2
release (bug#43268, <87lfeo3vzg.fsf@bzg.fr>).
2020-11-28 01:56:47 -05:00
Florian Dufour ccf81be2a2 org-capture.el: Add :tree-type 'month' in org-capture-templates description
* lisp/org-capture.el (org-capture-templates): Enhance description and
add 'month' value for :tree-type in description.

* doc/org-manual.org: Fix typo for displaying 'month' in :tree-type
property.

TINYCHANGE
2020-11-27 01:27:30 -05:00
Michael Albinus a368bf111a Backport commit 67a8bdb90 from Emacs
* lisp/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/ob-screen.el (org-babel-default-header-args:screen): Use
null-device.  (Bug#3736)

Use null-device where appropriate
67a8bdb90c9b5865b7f17290c7135b1a5458c36d
Michael Albinus
Wed Nov 25 22:13:33 2020 +0100

[km] Resolved conflict in ob-screen.  "/dev/null" was relocated to
     org-babel-default-header-args in 0ab117bc5 (ob-screen: Accept
     :screenrc header argument, 2020-07-14).
2020-11-26 19:35:58 -05:00
Stefan Kangas 00bc3097cd Backport commit affe9b225 from Emacs
* lisp/org-agenda.el (org-agenda-mode):
* lisp/org-table.el (org-table-edit-formulas, orgtbl-mode):
* lisp/org.el: Don't call easy-menu-add, an obsolete XEmacs compat
alias.

Make XEmacs compat aliases easy-menu-{add,remove} obsolete
affe9b225de711429248a73f920dc9f38b15c932
Stefan Kangas
Tue Nov 24 18:06:05 2020 +0100
2020-11-26 19:31:48 -05:00
Cheong Yiu Fung 2d23d55ac5 ox-odt.el: quote output file name
* lisp/ox-odt.el (org-odt-do-convert): Add `shell-quote-argument'
around output file name.

TINYCHANGE
2020-11-22 22:24:51 -05:00
Stefan Kangas 0abb6de0cf Backport commit 430eb2f85 from Emacs
* lisp/org.el (org-org-menu, org-create-customize-menu):
Remove Emacs 20 compat code.

Remove Emacs 20 compat code from org.el
430eb2f850b26f7df8473de4d929b5665673a0a2
Stefan Kangas
Fri Nov 20 16:11:33 2020 +0100
2020-11-22 21:17:28 -05:00
Kyle Meyer 104d92199e agenda: Fix toggling of archive files
* lisp/org-agenda.el (org-agenda-archives-mode): Turn archive mode off
if with-files in non-nil but files are already included so that a
repeated `vA` can toggle in the same manner as a repeated `va`.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Ref: https://orgmode.org/list/87o8jxz5hu.fsf@gmail.com
2020-11-17 00:49:22 -05:00
Juri Linkov 9bb93006ea Backport commit 844e82f5a from Emacs
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): Use :ruby header arg.
(org-babel-execute:ruby): Call org-babel-ruby-initiate-session with
`params'.
(org-babel-ruby-command): Mention :ruby header argument.

* lisp/org/ob-ruby.el (org-babel-ruby-initiate-session): Use :ruby header arg.
844e82f5a837a16c64e32ff9dd41a9e9b3ad3432
Juri Linkov
Sat Nov 14 22:18:38 2020 +0200
2020-11-14 15:50:30 -05:00
Kyle Meyer 23896ba683 ox-odt: Drop another (function (lambda ...))
* lisp/ox-odt.el (org-odt--image-size): Drop unnecessary `function'
call around `lambda'.

The previous commit from Emacs removed a (function (lambda ...))
instance immediately above.  Do the same here.
2020-11-14 15:44:26 -05:00
Stefan Kangas a97bb27f32 Backport commit 61dca6e92 from Emacs
* lisp/org/ox-odt.el (org-odt--image-size): Don't quote lambdas.

Don't quote lambdas in several places
61dca6e92ac972b832e889fbeab9b6131fc896fa
Stefan Kangas
Sat Nov 14 17:04:23 2020 +0100
2020-11-14 15:44:24 -05:00
Juri Linkov fd4eec036d Backport commit 79d04ae13 from Emacs
* lisp/org-element.el (org-element-parse-secondary-string):
Don't set buffer-local variables buffer-file-name and buffer-file-truename
in temporary buffer.

Don't set file name variable in org-element-parse-secondary-string (bug#44524)
79d04ae13ff33a93f631061d912168e9703251dd
Juri Linkov
Tue Nov 10 21:27:37 2020 +0200
2020-11-14 15:44:23 -05:00
Kyle Meyer 262777294f archive: Account for org-odd-levels-only in datetree calculations
* lisp/org-archive.el (org-archive-subtree): Honor org-odd-levels-only
when filling in org-archive-location placeholders with stars.
* testing/lisp/test-org-archive.el (test-org-archive/datetree): Add test.

Reported-by: Charles Tam <me@charlest.net>
Ref: https://orgmode.org/list/CAKu+9YVus=wPKGMY_vWp_7ND+oK7ZrRhN=1TXa2Cok3=8se1gg@mail.gmail.com
2020-11-12 00:59:53 -05:00
Bastien 370cf49cd2 lisp/org.el: Use non-obsolete variable names
* lisp/org.el (org-set-regexps-and-options): Use non-obsolete
variable names.
2020-11-11 09:11:52 +01:00
Kyle Meyer 95af0a244f agenda: Consistently clear temporary agenda name
* lisp/org-agenda.el (org-agenda--get-buffer-name): New function.
(org-agenda-list): Move buffer name logic to shared function.
(org-search-view):
(org-todo-list):
(org-tags-view): Use org-agenda--get-buffer-name.
* testing/lisp/test-org-agenda.el
(test-org-agenda/sticky-agenda-name): Add test.

The different agenda commands repeat similar logic for determining the
buffer name, mixing in a tailored sticky buffer format.  However, only
org-agenda-list falls back to "*Org Agenda*" when org-agenda-sticky is
nil.  As a result, a buffer generated with org-follow-timestamp-link,
which gets a custom name, is not reset when commands other than
org-agenda-list generate a new agenda.

Move the logic from org-agenda-list to a helper function and use it
across the agenda-generating commands.

Reported-by: Garjola Dindi <garjola@garjola.net>
Ref: https://orgmode.org/list/87tuuj4lo9.fsf@pc-117-162.ovh.com
2020-11-09 01:07:35 -05:00
Kyle Meyer 51c4cc1a8a Prefer symbol for eval-after-load's FILE argument
Call eval-after-load with a symbol rather than a string to avoid
potential name conflicts with files that do not provide the feature
(e.g., if a user configures speedbar in a file named "speedbar.el")

Reported-by: John Foerch <jjfoerch@gmail.com>
Ref: https://orgmode.org/list/CAEeGWGKfrV7w9qtPRpAhFtiOCH-+8_ydEe11EoMAkUkbTq1fuA@mail.gmail.com
2020-11-06 00:32:16 -05:00
Kyle Meyer 20374f69e8 ob-exp: Restore evaluation query for lob calls during export
* lisp/ob-exp.el (org-babel-exp-results): Fix a regression from v9.0
that led to silently executing lob calls on export despite a non-nil
value of org-confirm-babel-evaluate.
* testing/lisp/test-ob-lob.el (test-ob-lob/confirm-evaluate): New test.

56bf3d789 (Babel: avoid superfluous confirmation for internal wrapper,
2013-04-10) let-bound org-confirm-babel-evaluate to nil in two spots
to prevent double querying for lob calls.  These overrides were no
longer needed following the refactoring in dbb375fdf (Simplify Babel
calls evaluation, 2016-06-16).  However, that commit dropped only one
of the spots, and, as a result, disabled confirmation unconditionally
when exporting lob calls.

Drop the remaining org-confirm-babel-evaluate override.

Reported-by: 吴锐扬 <ywwry66@gmail.com>
Ref: https://orgmode.org/list/5362C0A0-632F-4C87-8FA1-915F0F53D8B8@gmail.com
2020-11-01 18:34:16 -05:00
Kyle Meyer e8070d71ab Revert "org.el: Allow empty subtrees to be folded back"
* lisp/org.el (org-cycle-internal-local): Revert
ee3c3b5547, which does not appear to
have addressed the original issue and breaks cycling with empty lines.

Reported-by: B Goodr <bgoodr@gmail.com>
Ref: https://orgmode.org/list/CAJj=8EFJXFu9ZQ11cO24AAu=1jykW2Zr+=R4FLuKG=bLjfUe+g@mail.gmail.com
Reported-by: Mikhail Skorzhisnkii <mskorzhinskiy@eml.cc>
Ref: https://orgmode.org/list/87h7qu10ht.fsf@eml.cc
2020-10-26 23:52:01 -04:00
Stefan Kangas 47bf6005b3 Backport commit dd16e46bb from Emacs
; Prefer https to http in more URLs
dd16e46bb9d0099baea06d780ad8f62728addc2e
Stefan Kangas
Sat Oct 24 20:23:27 2020 +0200
2020-10-25 01:10:16 -04:00
Stefan Kangas 0193b543e9 Backport commit 4a575eb18 from Emacs
byte-compile-file: Make optional LOAD argument obsolete
4a575eb18cca3eed5019f2d2d2abeea1f0c07005
Stefan Kangas
Tue Oct 20 18:48:27 2020 +0200
2020-10-25 01:10:16 -04:00
Adrian Kummerlaender a442c2515d ob-python: Rename exec tmpfile handle to prevent conflict
* lisp/ob-python.el (org-babel-python--exec-tmpfile): Rename tmpfile handle
(org-babel-python-format-session-value): Rename tmpfile handle

Opening the exec tmpfile as a `f' variable shadows any such variable
that might by defined by the Python session context. e.g. my Org babel
files commonly pass single letter variables inside a session which is
broken by this behavior.

The new name `__org_babel_python_tmpfile' is in line with other org
mode specific Python variables set by ob-python.  This is unlikely to
conflict with the user's Python code.

TINYCHANGE
2020-10-24 07:01:27 -07:00
Aaron Madlon-Kay 3ce495cc44 ob-ruby.el: allow specification of ruby command w/header arg
b-ruby.el: Use the :ruby header arg

* lisp/ob-ruby.el (org-babel-execute:ruby): Locally set
`org-babel-ruby-command' using a header argument.

TINYCHANGE
2020-10-24 13:37:25 +02:00
Adam Spiers 752c466a63 org-agenda.el: Fix typo in docstring
* lisp/org-agenda.el (org-agenda-new-marker): Fix typo in docstring.

TINYCHANGE
2020-10-24 13:34:02 +02:00
Kyle Meyer edfafa9090 org.el: Autoload org-load-modules-maybe
* lisp/org.el (org-load-modules-maybe): Autoload.

org-store-link and orgtbl-mode both 1) call org-load-modules-maybe at
the start of their execution, 2) can be used outside of Org mode, and
3) are in libraries that do not load org.el (instead org.el loads
them).  Autoload org-load-modules-maybe to avoid an error if these are
called before org.el is loaded.

Reported-by: Tim Frana <tfr@mailbox.org>
Ref: https://orgmode.org/list/5e0f0216-44d8-c909-3757-4d95650445ef@mailbox.org
2020-10-20 00:39:28 -04:00
Martin Kampas 90b14cb409 org-colview: Fix done keywords highlighting in agenda buffers
* lisp/org-colview.el (org-agenda-columns): Populate
org-done-keywords from org-done-keywords-for-agenda or the done keywords
will use the same face as those not-done.

TINYCHANGE
2020-10-20 00:35:11 -04:00
Kevin J. Foley 2d1e2606e7 org-refile.el (org-refile): Add description of RFLOC to docstring
* lisp/org-refile.el (org-refile): Document structure of RFLOC
parameter.
2020-10-20 00:35:10 -04:00
Kyle Meyer b1de0c8e4b Fix regression in priority fontification
* lisp/org-agenda.el (org-agenda-fontify-priorities):
* lisp/org.el (org-font-lock-add-priority-faces): Fontify up to the
end of the closing bracket of the priority, as was the case before
v9.4.

7b1077def (Tiny enhancements to priority handling, 2020-01-30)
switched org-agenda-fontify-priorities and
org-font-lock-add-priority-faces over to using org-priority-regexp
rather than inline regexps.  For the inline regexps, the first group
ended at the closing bracket, but the first group in
org-priority-regexp includes an optional space, leading to the face
extending one character too far.

Restore the bound to the closing bracket by determining the bound
based on the second group, the priority label, instead.

Reported-by: Roman Rudakov <rrudakov@pm.me>
Helped-by: Protesilaos Stavrou <info@protesilaos.com>
Ref: https://orgmode.org/list/87r1r2kh77.fsf@pm.me
2020-10-11 02:04:11 -04:00
Nicholas Vollmer f0902bf185 org.el (org-display-outline-path): Fix invalid face reference error
* lisp/org.el (org-display-outline-path): Use an anonymous face when
adding default :height to outline path.
2020-10-07 00:41:46 -04:00
Stefan Kangas 9a6689f9ce Backport commit c6fa0ad31 from Emacs
; Prefer https to http in many URLs
c6fa0ad315e38167cb81a4d8c143cc53ad783cc3
Stefan Kangas
Thu Oct 1 15:28:15 2020 +0200
2020-10-04 15:06:39 -04:00
Stefan Kangas ddcccbc012 Backport commit 78eacf31e from Emacs
; Fix many typos in symbols in docs and comments
78eacf31e8fe182801ad1943fac717b75fcf286b
Stefan Kangas
Fri Oct 2 13:29:45 2020 +0200
2020-10-04 15:06:39 -04:00
Nicolas Goaziou 1a0344abb7 entities: Fix "empty" entity in LaTeX
* lisp/org-entities.el (org-entities): Use \emptyset instead of
\empty, which is a Go symbol.

Arguably, \O outside of math mode would be a better choice, but use
\emptyset for consistency with "emptyset" entity.
2020-10-04 14:53:18 +02:00
Nicholas Vollmer 8d3610df08 org-capture.el: Fix heading's position when inserting a template "here"
* lisp/org-capture.el (org-capture-place-entry): Fix heading's
position when inserting a template "here" with C-0 M-x org-capture.

Reported-by: david wen riccardi-zhu <dwrz@dwrz.net>
Ref: https://orgmode.org/list/877dscaila.fsf@dwrz.net/
2020-10-03 02:22:47 -04:00
Morgan Smith 84bfc688d6 org: Fix a docstring typo
* lisp/org.el (org-check-before-invisible-edit): Fix a docstring typo.
2020-10-03 02:22:35 -04:00
Ihor Radchenko 5d4c0f59d8 Do not remove trailing newline when deleting planning info line
* lisp/org.el (org-add-planning-info): Remove front newline instead of
trailing newline when planning info is completetly removed from a
heading.

The old behaviour affected folded headlines containing only planning
info in the body:

Before deletion:
* DONE Headline<begin fold>
  CLOSED: [2020-09-23 Wed 21:39]<end fold>
* test

After deletion:
* DONE Headline<begin fold>
<end fold>* test

The newline after the first headline is hidden making both the
headlines appear at the same visual line.

New behaviour:
After deletion:
* DONE Headline
* test

All the folded text is completely removed.

Reported-by: Krishan Kharagjitsing <krishan404@gmail.com>
Ref: https://orgmode.org/list/CAKXDJO2xUgBoTx-XcL7WbXyvP2Oj8iVEmdmRNCVzdRTEwzNR+Q@mail.gmail.com
2020-09-28 23:13:18 -04:00
Kyle Meyer 6676a97d27 org-tags-expand: Fix handling of downcased group tags
* lisp/org.el (org-tags-expand): Support using an upper- or mix-case
tag as MATCH when SINGLE-AS-LIST and DOWNCASED are non-nil, fixing a
regression from v9.2.
* testing/lisp/test-org.el (test-org/tags-expand): Add test.

org-agenda-filter-by-tag reads a case-sensitive tag from the user, and
downstream code passes this tag as is to org-tags-expand along with
non-nil values for SINGLE-AS-LIST and DOWNCASED.  As of 9df82be07 (Fix
tag groups expansion as a regexp, 2018-11-08), org-tags-expand fails
to return the group tags in this scenario for queries that contains an
uppercase letter, breaking org-agenda-filter-by-tag.

Downcase MATCH if SINGLE-AS-LIST and DOWNCASED are non-nil.

Reported-by: Leon Weber <leon.weber@net2.ch>
Ref: https://orgmode.org/list/c1f8cc32-dc16-697c-c24d-e5e05124bd66@net2.ch
2020-09-28 00:04:53 -04:00
Kyle Meyer f8ae0cd6b7 org: Fix a docstring typo
* lisp/org.el (org--tags-expand-group): Fix a docstring typo.
2020-09-27 23:55:43 -04:00
Ihor Radchenko ab00524fc5 Fix `org-lint-link-to-local-file'.
* lisp/org-lint.el (org-lint-link-to-local-file): 1. Fix call to
`org-attach-expand' being called with point not at the attachment:
link.  2. Fix typo in call to `format'.  File argument had to be
outside the if.
2020-09-26 10:34:59 +02:00
Kyle Meyer 3eccc537cd org.el: Fix regression in handling of empty #+TAGS
* lisp/org.el (org-set-regexps-and-options): Allow an empty #+TAGS
value to override org-tag-alist, as it did before v9.4.
* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
test.

As of b4e91b7e9 (New function: org-collect-keywords, 2020-04-26), a
"#+TAGS" header can no longer be used to override a value of
org-tag-alist.  This breaks the workflow where a set of tags for most
files is defined via org-file-tags and then, in a particular file, an
empty #+TAGS header is used to ignore org-file-tags and trigger
collecting tags from the buffer instead.  Rework the handling to
restore this behavior.

Reported-by: Allen Li <darkfeline@felesatra.moe>
Ref: https://orgmode.org/list/80y2laly9v.fsf@felesatra.moe
2020-09-20 00:59:09 -04:00
Kyle Meyer 114229da6e org.el: Fix docstring typo
* lisp/org.el (org-show-context-detail): Fix a docstring typo.
2020-09-20 00:58:17 -04:00
Kyle Meyer 73c929e3b5 org-element: Swap pcase patterns to avoid Emacs 24 error
* lisp/org-element.el (org-element--next-mode): Reorder two patterns
to sidestep an error on Emacs 24.

The valid pattern introduced in 4a27b67fd (org-element: Fix property
drawers parsing, 2020-04-22) makes entering Org mode in Emacs 24.5
fail with "Eager macro-expansion failure: (wrong-type-argument listp
:pcase--succeed)".  This seems to be due to a bug fixed in Emacs 25.

Reported-by: Jens Lechtenboerger <lechten@wi.uni-muenster.de>
Ref: https://orgmode.org/list/87pn6n5u13.fsf@wi.uni-muenster.de
2020-09-16 21:53:57 -04:00
Sébastien Miquel 38fbd161e4 Fix meta lines regexp
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Fix meta lines
regexp to work correctly for lines with only a #.

Replace blank in regexp by (any " \t").

TINYCHANGE
2020-09-16 21:39:06 +02:00
Kyle Meyer 469ee63401 ob-core: Fix handling of multiple noweb refs in same line
* lisp/ob-core.el (org-babel-expand-noweb-references): Don't anchor
noweb regexp at start of line to allow multiple matches per line.
* testing/lisp/test-ob-tangle.el (ob-tangle/multiple-noweb-in-line):
Add test.

This fixes a regression introduced by c1aed9f80 (ob-core: Refactor
`org-babel-expand-noweb-references', 2020-01-12), which was part of
the 9.4 release.

Reported-by: Tom Gillespie <tgbugs@gmail.com>
Ref: https://orgmode.org/list/CA+G3_PO2yO1jMMpdrkc39BGQQ2eU5X4FzTEJVotjDJo-50dsqQ@mail.gmail.com
2020-09-15 23:45:16 -04:00
Nicolas Goaziou 7dbd749bf8 Tiny refactoring
* lisp/org.el (org-cycle): Use `org-match-line' instead of
`save-excursion' + `beginning-of-line' + `looking-at'.
2020-09-15 09:55:27 +02:00
Nicolas Goaziou 10ed4994f5 table: Fix regexp
* lisp/org-table.el (org-table-import): Fix missing leading
backslash.  Switch to Rx notation for clarity.
2020-09-15 09:50:29 +02:00
Bastien 56b8f8c35b lisp/org.el: Bump version to 9.4
* lisp/org.el: Bump version to 9.4.
2020-09-14 15:44:30 +02:00
Phil Hudson bbe447adc7 lisp/org-capture.el (org-capture-templates): Fix docstring typo
* lisp/org-capture.el (org-capture-templates): Fix docstring typo.

TINYCHANGE
2020-09-14 15:39:13 +02:00
Marlin Strub b14fb06def org.el: Adapt org-cycle to work with headlines with hidden stars
* lisp/org.el (org-cycle): Use `beginning-of-line' instead of
`move-beginning-of-line' to move point to the beginning of
line (including any invisible characters) such that org-outline-regexp
matches headlines with hidden stars (such as those produced by
[[https://github.com/TonCherAmi/org-starless][org-starless-mode]]).

TINYCHANGE
2020-09-14 15:37:19 +02:00
Bastien Guerry 9c31cba002 org-table.el: Throw an error when importing a non-csv/tsv/txt file
* lisp/org-table.el (org-table-import): Throw an error when
interactively trying to import a non-csv/tsv/txt file.

Reported-by: swedebugia <swedebugia@riseup.net>
See https://orgmode.org/list/20200912135043.0354bac4@parabola/
2020-09-13 19:13:05 +02:00
Bastien Guerry 755367f362 org.el (org-end-of-meta-data): Allow to skip only standard drawers
* lisp/org.el (org-end-of-meta-data): Allow to skip only standard
drawers, i.e. properties and logbook drawers.

* lisp/org-crypt.el (org-at-encrypted-entry-p)
(org-encrypt-entry): Use `org-end-of-meta-data' so that standard
drawers are all skipped, including logbook drawers.

Reported-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
See https://orgmode.org/list/87d02qgj6u.fsf@nicolasgoaziou.fr
and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43094 for the reason
of the previous fix c93983613d.
2020-09-13 18:36:15 +02:00
Bastien Guerry 8a083514a7 org-faces.el (org-block): Enhance docstring
* lisp/org-faces.el (org-block): Enhance docstring.
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Clean up some
comments.

See 7769518f3, which was wrong.
2020-09-10 11:19:55 +02:00
Bastien Guerry dcb6eb613a Revert "Use the `org-block' face for every true blocks"
This reverts commit 7769518f3a.
2020-09-10 11:06:12 +02:00
Jack Kamm 939cf16bc7 ob-python: Fix hanging on emacs-26.3 by adding indicator token
* lisp/ob-python.el (org-babel-python-eoe-indicator): Add back
variable for end-of-expression indicator.
(org-babel-python--shift-right): New function to indent source body.
(org-babel-python-evaluate-external-process): Call new function org-babel-python--shift-right.
(org-babel-python--send-string): Wrap body in try-except-finally,
print indicator token, and find end of output via the token.

cf https://orgmode.org/list/871rjcan53.fsf@kyleam.com/
2020-09-09 06:24:07 -07:00
Bastien Guerry 771c66f791 Revert "org.el: Fix `org-add-planning-info'"
This reverts commit 4f49ebb6d6.
2020-09-09 12:06:55 +02:00
Bastien Guerry f5573e6a00 org-capture.el: Fix heading's level when inserting a template "here"
* lisp/org-capture.el (org-capture-place-entry): Fix heading's
level when inserting a template "here" with C-0 M-x org-capture.

Reported-by: Nick Dokos <ndokos@gmail.com>
See <https://orgmode.org/list/87lfiuxqze.fsf@alphaville.usersys.redhat.com/>
2020-09-09 11:34:04 +02:00
Nicolas Goaziou b79fef1da7 html: Improve consistency on internal anchors naming scheme
* lisp/ox-html.el (org-html-prefer-user-labels): New variable.
(org-html--reference): New function.
(org-html--format-toc-headline):
(org-html-list-of-listings):
(org-html-list-of-tables):
(org-html-example-block):
(org-html-headline):
(org-html-inline-src-block):
(org-html-latex-environment):
(org-html-link):
(org-html-paragraph):
(org-html-quote-block):
(org-html-radio-target):
(org-html-special-block):
(org-html-src-block):
(org-html-table):
(org-html-target): Use new function.
2020-09-09 10:23:28 +02:00
Vasilij Schneidermann 5082e436a7 org-datetree.el: Respect `org-blank-before-new-entry'
* lisp/org-datetree.el (org-datetree-insert-line): Respect
`org-blank-before-new-entry'.

* testing/lisp/test-org-datetree.el
(test-org-datetree/find-date-create)
(test-org-datetree/find-month-create)
(test-org-datetree/find-iso-week-create): Update tests.

TINYCHANGE

See <https://orgmode.org/list/20200903085054.GA21638@odonien.localdomain/>
2020-09-09 10:07:29 +02:00
Bastien Guerry 7a12e14990 org.el (org-display-outline-path): Fix faces of the message
* lisp/org.el (org-display-outline-path): Set :height as the
default face height, and don't change other face attributes.

See a3576543f for a previous fix, and this discussion:
<https://orgmode.org/list/21ef0e94-e766-455c-a45c-fe30e316c121@Spark>
2020-09-09 09:57:45 +02:00
Bastien Guerry 570bd6ce93 org.el: Fix `org-display-outline-path'
* lisp/org.el (org-display-outline-path): Always remove faces when
setting the outline path to display.

See <https://orgmode.org/list/21ef0e94-e766-455c-a45c-fe30e316c121@Spark>
2020-09-09 09:42:37 +02:00
Bastien Guerry f17d301e17 lisp/org.el (org-forward-heading-same-level): Add a comment
* lisp/org.el (org-forward-heading-same-level): Add a comment adding
a FIXME, in case this change appears to impact Org itself.
2020-09-08 11:25:03 +02:00
D a700fadd72 org.el: Let `org-forward-heading-same-level' check for fully invisible lines
* lisp/org.el (org--line-fully-invisible-p): New function.
(org-forward-heading-same-level): Use it to check whether the line
is fully invisible.

TINYCHANGE

See <https://orgmode.org/list/51b41109-997c-db37-c0ed-44e8d0154cee@posteo.net/>
2020-09-08 11:17:51 +02:00
No Wayman 4f49ebb6d6 org.el: Fix `org-add-planning-info'
* lisp/org.el (org-add-planning-info): * lisp/org.el
(org-add-planning-info): Use `org-time-was-given' and
`org-end-time-was-given' if the variables are bound from an
outside call.

This allows e.g. programmatically passing a time of day to
`org-schedule'.

TINYCHANGE
2020-09-08 10:27:13 +02:00
Bastien 7c4b67d49a lisp/org-plot.el: Add a maintainer
* lisp/org-plot.el: Add a maintainer.
2020-09-08 09:14:54 +02:00
Kyle Meyer 824a4a14b0 ol-gnus: Prefer nnselect to nnir if available
* lisp/ol-gnus.el (org-gnus-store-link): Use nnselect when available.

In the master branch of the Emacs repository, f103e89c1d (Add aliases
for recent Gnus nnselect changes, 2020-09-07) switched
org-gnus-store-link over to using nnselect, but that can't be ported
as is because it isn't backward compatible.  Make a similar change
that includes compatibility kludges.
2020-09-07 23:19:15 -04:00
Kyle Meyer 1c5bebdad9 Merge branch 'maint' into master 2020-09-07 21:23:16 -04:00
Nicolas Goaziou 13dfab3fb2 ox-texinfo: Tiny refactoring
* lisp/ox-texinfo.el (org-texinfo-link): Use
`org-texinfo--sanitize-content'.

(cherry picked from commit 8fd24c0a53)
[km]: This fixes a double-escaping regression introduced by 706970efb
      (ox-texinfo.el: Fix escaping special chars in raw-path,
      2020-06-05).
2020-09-07 21:15:40 -04:00
Bastien 19b741583d org-agenda.el (org-find-top-headline): Fix bug
* lisp/org-agenda.el (org-find-top-headline): Fix bug: don't
inclure the statistic cookie in the headline text as this can be
updated during agenda interaction.

Reported-by: William Horne <will.m.horne@gmail.com>
See <https://orgmode.org/list/CA+2+CK-TofaNS1FOyZGhd3jPKb-XNOYM-0ouP9=tW=qepKm7wg@mail.gmail.com>
2020-09-07 20:15:38 +02:00
Bastien 07c6b11258 ob-shell.el: New option `org-babel-shell-results-defaults-to-output'
* lisp/ob-shell.el (org-babel-shell-results-defaults-to-output):
New option.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline): Fix test.

See <https://orgmode.org/list/CA+A2iZaziAfMeGpBqL6qGrzrWEVvLvC0DUw++T4gCF3NGuW-DQ@mail.gmail.com>
2020-09-07 19:30:04 +02:00
Jack Kamm 6f9929fc3b ob-python: Replace session value format string with function
* lisp/ob-python.el (org-babel-python--eval-ast): Removed.
(org-babel-python-format-session-value): New function that returns
Python code to evaluate for sessions with value results.
(org-babel-python-evaluate-session): Replace
org-babel-python--eval-ast with org-babel-python-format-session-value.

Motivation is that the new function is more flexible than the old
format string.  We can pass in the full result-params, which can be
used to add more formatting options in future.  We could also add more
optional arguments in the future to extend this functionality.

This function will be particularly helpful for a couple patches after
9.4:
- ob-reticulate
  - https://orgmode.org/list/875z98gj4f.fsf@gmail.com/
- Improved formatting
  - https://orgmode.org/list/87eenpfe77.fsf@gmail.com/

However, I add this function in now 9.4, so those future patches can
rely on it in 9.4.  In particular, ob-reticulate will probably be
packaged separately from org-mode, and I want to provide a stable
interface to it so that it can be released after 9.4.
2020-09-07 09:39:21 -07:00
Bastien dab32da708 lisp/org.el: Bump version to 9.3.8
* lisp/org.el: Bump version to 9.3.8.
2020-09-07 17:40:17 +02:00
Bastien 11ef7454ab org.el (org-fixup-indentation): Fix logbook drawers indentation
* lisp/org.el (org-fixup-indentation): Fix logbook drawers
indentation.

Reported-by: Matt Lundin <mdl@imapmail.org>
https://orgmode.org/list/87r1t8sdhd.fsf@fastmail.fm/
2020-09-07 09:17:21 +02:00
Bastien 81d49b5adb ob-emacs-lisp.el: Don't wrap execution within `save-window-excursion'
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Don't wrap
execution within `save-window-excursion'.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
https://orgmode.org/list/87tv5vt545.fsf@gmail.com
2020-09-07 07:37:19 +02:00
Bastien 69a91ba8bc Merge branch 'maint' 2020-09-07 07:32:28 +02:00
Bastien 7769518f3a Use the `org-block' face for every true blocks
* lisp/org-faces.el (org-block): Tiny docstring enhancement.

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Use the
`org-block' face for every true blocks.

Reported-by: Sébastien Miquel <sebastien.miquel@posteo.eu>
https://orgmode.org/list/42749c98-ddfe-bad4-43a5-1119e24972bd@posteo.eu
2020-09-07 07:31:11 +02:00
Bastien 9f0af69dd2 Skip archived headings when tangling and exporting
* lisp/org.el (org-in-archived-heading-p): New function.

* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use
`org-in-archived-heading-p' to skip archived headings when tangling
and exporting.

* testing/lisp/test-org.el (test-org/in-archived-heading-p): Add
test for `org-in-archived-heading-p'.

Reported-by: flare <gabrielxaviersmith@gmail.com>
See https://orgmode.org/list/877dt9ey2c.fsf@gmail.com/
2020-09-07 06:51:06 +02:00
Jack Kamm 4df12ea391 ob-python: Improve robustness of session evaluation
* lisp/ob-python.el (py-send-string-no-output): Remove external function.
(py-shell-send-string): Add external function.
(org-babel-python--eval-ast): Remove blank lines.
(org-babel-python--send-string): New function to send string to Python
process and return output.
(org-babel-python-evaluate-session): Call
org-babel-python--send-string to evaluate code.

New function to send code to Python session.  It has the following
desirable properties:
- Wait for evaluation to finish before returning.
- Input can have arbitrary spaces/newlines.
- Avoid echoing input to the session.
- Echo all output to the session.
- Output is also captured and returned separately.
- Avoid adding extra prompts to the session.
- Work well with both Python and IPython repls.

The implementation borrows from `python-shell-send-string-no-output'
and `org-babel-comint-with-output'.  This commit is related to
632ceabb1, which tried to implement the same thing, but also
introduced bugs, and had to be partially reverted in b5709ddc9.
2020-09-06 18:15:04 -07:00
Jack Kamm 5d289d2b3e ob-python: fix startup messages leaking into output
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Remove
workaround for emacs<24.1.  Sleep after starting Python, to prevent
startup messages leaking into output results.
* testing/lisp/test-ob-python.el (test-ob-python/session-multiline):
Remove workaround for startup message leaking into results.
2020-09-06 18:15:04 -07:00
Bastien 15a6836e4f ob-core.el: Fix `org-babel--string-to-number'
* lisp/ob-core.el (org-babel--string-to-number): Exclude strings
not matching "^[0-9-e.+ ]+$" from being interpreted as numbers.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
https://orgmode.org/list/CAFyQvY14iek+op12Vm7+jrniGEVU2yha7kuPtNtFQAso6d=PjQ@mail.gmail.com/
2020-09-06 22:41:21 +02:00
Bastien 612f4db090 ob-shell.el: Fix previous commit
* lisp/ob-shell.el (org-babel-execute:shell)
(org-babel-sh-evaluate): Use the value only when value is set or
when no :result is set.
2020-09-06 22:35:28 +02:00
Bastien 2f53429413 ob-shell.el: Use the exit status as the default result
* lisp/ob-shell.el (org-babel-execute:shell)
(org-babel-sh-evaluate): Use the exit code as the value and,
consequently, as the result when no :results header is set.

See this thread:
https://orgmode.org/list/CA+A2iZaziAfMeGpBqL6qGrzrWEVvLvC0DUw++T4gCF3NGuW-DQ@mail.gmail.com/

And Tim's useful summary here:
https://orgmode.org/list/87sgiszqc1.fsf@gmail.com/

This commit resolves the issue by deciding not to make an exception
for ob-shell.el:

- the "value" of executing a shell/bash script is the exit code
- when no :results header is set, use the value as the result
- use :results output to use the stdout
2020-09-06 19:12:22 +02:00
Bastien 73a78c2518 Revert "org.el (org-add-planning-info): Use caller's `org-time-was-given' value"
This reverts commit c7abcd514a.
2020-09-06 12:01:54 +02:00
Bastien ec80dd6c17 Merge branch 'maint' 2020-09-06 11:59:31 +02:00
Bastien 15e2d83313 ob-sqlite.el: Inhibit Lisp evaluation when reading the result
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar): Inhibit
Lisp evaluation when reading the result.

Reported-by: rrandresf@gmail.com
2020-09-06 11:58:53 +02:00
Bastien 9a2e22d87a Merge branch 'maint' 2020-09-06 11:50:36 +02:00
Bastien 989f50a53b ob-java.el: Inhibit Lisp evaluation when reading the result
* lisp/ob-java.el (org-babel-execute:java): Inhibit Lisp
evaluation when reading the result.

Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
2020-09-06 11:48:20 +02:00
Bastien f0a9677d90 ob-core.el: Silence byte-compiler 2020-09-06 11:27:11 +02:00
Bastien d50823be14 fixup! Merge branch 'maint' 2020-09-06 10:05:43 +02:00
Bastien 1170e39bea org-crypt.el: Fix encrypt/decrypt in presence of arbitrary drawers
* lisp/org/org-crypt.el (org-encrypt-entry, org-decrypt-entry): Skip
  _all_ meta data before looking for PGP content.

TINYCHANGE
2020-09-06 10:05:31 +02:00
Trevor Murphy c93983613d org-crypt.el: Fix encrypt/decrypt in presence of arbitrary drawers
* lisp/org/org-crypt.el (org-encrypt-entry, org-decrypt-entry): Skip
  _all_ meta data before looking for PGP content.

TINYCHANGE
2020-09-06 10:00:34 +02:00
Bastien 55d1d32f5e org.el: Tiny docstring fixes
* lisp/org.el (org-keyword-regexp, org-ctrl-k-protect-subtree)
(org-priority-default, org-fast-tag-selection-single-key)
(org--check-org-structure-template-alist)
(org-after-todo-statistics-hook, org-log-note-effective-time)
(org-occur, org-days-to-iso-week, org-ctrl-c-ctrl-c-hook)
(org-ctrl-c-ctrl-c-final-hook, org-ctrl-c-ret, org-mode-restart)
(org-install-agenda-files-menu): Tiny docstring fixes.
2020-09-06 08:14:15 +02:00
Kyle Meyer d4f48821c1 Merge branch 'maint' into master 2020-09-05 23:41:50 -04:00
Kyle Meyer 799e5dac92 org.el: Silence byte-compiler
* lisp/org.el (org-optimize-window-after-visibility-change): Drop
unused let-binding added in a8e812e60.
2020-09-05 23:39:56 -04:00
Kyle Meyer e535da6e4f ob-core: Avoid duplicate body expansion logic
* lisp/ob-core.el (org-babel--expand-body): New function.
(org-babel-check-confirm-evaluate):
(org-babel-execute-src-block): Use org-babel--expand-body.

As of 727c6d7fe (lisp/ob-core.el: org-babel-check-confirm-evaluate
strip coderefs, 2020-09-04), org-babel-check-confirm-evaluate and
org-babel-execute-src-block use the same logic to expand the body and
strip coderefs.  Move that code to a helper function.

This patch is functionally equivalent to the patch originally proposed
by Tom Gillespie at
https://orgmode.org/list/CA+G3_PNi3uMvBiWgBdKuC3C6VJt1T1j-RKH43LRqYbr+4NS8ZA@mail.gmail.com
2020-09-05 23:39:08 -04:00
Tom Gillespie 3e1c0b0f44 lisp/ob-core.el: org-babel-check-confirm-evaluate strip coderefs
* lisp/ob-core.el (org-babel-check-confirm-evaluate): strip coderefs
before passing the body of the block to org-confirm-babel-evaluate
using the same let block as is used in org-babel-execute-src-block.
2020-09-05 23:38:35 -04:00
Nicholas Vollmer c7abcd514a org.el (org-add-planning-info): Use caller's `org-time-was-given' value
* lisp/org.el (org-add-planning-info): Fix bug by not ignoring the
caller's `org-time-was-given' value.

See <https://orgmode.org/list/87zh6rfvmi.fsf@gmail.com>

TINYCHANGE
2020-09-05 17:54:46 +02:00
Bastien c09518b5f6 org.el (org-read-date-display-live): Enhance docstring
* lisp/org.el (org-read-date-display-live): Document that live
display is only available when `org-read-date-popup-calendar' is
non-nil.

See <https://orgmod.org/list/20200630180259.zj3krk57x5iqmbsj@orion>

Reported-by: Edmund Christian Herenz <eherenz@eso.org>
2020-09-05 17:33:04 +02:00
Bastien 479e09a8e2 Merge branch 'maint' 2020-09-05 16:41:03 +02:00
Ihor Radchenko f45591630f ob-core.el: Use `buffer-base-buffer' where needed
* lisp/ob-core.el (org-babel-result-to-file): Use
`buffer-base-buffer' so that `buffer-file-name' returns correct
results in indirect buffers too.

See <https://orgmode.org/list/87eeos3w7v.fsf@localhost>

TINYCHANGE
2020-09-05 16:40:45 +02:00
Bastien b2f54f9f8e Merge branch 'maint' 2020-09-05 15:20:06 +02:00
Bastien 114d509829 org-table.el: Prevent an error from occurring
* lisp/org-table.el (org-table-justify-field-maybe): Fix bug.

Reported-by: Lester Longley <lester@ieee.org>
https://orgmode.org/list/CAA3095_oH2sH_a=nNeYEa=agZp7L2K8Vp2s-c7fN4M4Sro=stQ@mail.gmail.com
2020-09-05 15:18:51 +02:00
Bastien 7b59fe0775 Merge branch 'maint' 2020-09-05 11:14:32 +02:00
Leo Vivier 3008fb45dc org-capture: Update plist before finalizing
* lisp/org-capture.el (org-capture-finalize): Update
`org-capture-plist' with local-value before finalizing.

We use the global-variable `org-capture-plist' to populate the
local-variable `org-capture-current-plist' on the init of the
`org-capture' buffer.  However, we do not do the opposite (i.e. update
the global-variable with the local-variable) on
`org-capture-finalize'.

This is fine for the majority of `org-capture-finalize', since we’re
using the LOCAL arg of `org-capture-get' to read
`org-capture-current-plist' instead of `org-capture-list', but this
trick does not work for `org-capture-after-finalize', since the hook
is run after the `org-capture-buffer' has been closed.

This causes problem with `:kill-buffer t', and it limits what can be
done with cleanup functions in `org-capture-after-finalize'.

See <https://orgmode.org/list/87h7tv9pkm.fsf@hidden/> for details.
2020-09-05 11:14:17 +02:00