Commit Graph

23481 Commits

Author SHA1 Message Date
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
James N. V. Cash c20cb0993b Address org-eldoc-recursion issue
* org-eldoc.el (org-eldoc-get-mode-local-documentation-function,
org-eldoc-documentation-function): Support Emacs 28-style eldoc, where
instead of a single function, the eldoc-documentation-functions hook
has a list of functions, which may optionally take a callback.
2020-09-20 21:24:55 -04: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 fbccf09c74 etc/ORG-NEWS: Create an empty section for Org 9.5 2020-09-14 15:50:27 +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
Peter Münster b01332c87e org-notify.el: Limit the number of notifications
(org-notify-max-notifications-per-run): New option for limiting the
notifications.
(org-notify-process): Use it.
2020-09-13 18:41:33 +02:00
Peter Münster 54bdd6cbf7 org-notify.el: Use cl- prefixed functions, and require cl-lib 2020-09-13 18:41:27 +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
Ihor Radchenko 8efec3d4cd Fix example of in-buffer setting of archive location in manual
* doc/org-manual.org (Summary of In-Buffer Settings): Fix archive
example.

The provided example '%s_done' is not valid syntax for archive
location. Should be '%s_done::'.
2020-09-13 00:50:15 -04:00
Nick Dokos b567445fcb Fix syntax of #+ATTR_HTML
* doc/org-manual.org (Tables in HTML export): Fix syntax of example.

The example in the "Tables in HTML export" section of the manual
uses the old syntax: `border="2"' etc.

Change it to use `:border 2' etc.
2020-09-13 00:46:34 -04: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
Bastien Guerry 1e3aa1ce0a etc/ORG-NEWS: Rephrasing, reordering and various other enhancements 2020-09-10 08:57:26 +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