* lisp/org.el (org-in-archived-heading-p): When called on a heading
with a tag containing org-archive-tag string as a substring, that
heading was incorrectly recognised as archived. Changed matching
against the whole :tag1:tag2:...: string to matching against tag list
as returned by `org-get-tags'.
* testing/lisp/test-org.el (test-org/in-archived-heading-p): Add test
when one of the heading tags contains org-archive-tag as a substring.
* lisp/org.el (org-optimize-window-after-visibility-change): Reset
org-scroll-position-to-restore if it is not a repeated call.
The org-scroll-position-to-restore variable is used to save the
position, but the position may be from a cycling sequence other than
the current one. Reset it at the start of a sequence.
* lisp/org.el (org-optimize-window-after-visibility-change): Guard
against calling set-window-start with a nil POS argument.
org-optimize-window-after-visibility-change calls set-window-start
with org-scroll-position-to-restore when it is a repeat call
(i.e. last-command and this-command match). However,
org-scroll-position-to-restore may not have yet been set yet (e.g. if
org-startup-folded is at its default value of showeverything).
Calling set-window-start appears to generally be a noop, but, for a
reason that I don't understand, it triggers a hang when %p is in
frame-title-format.
Reported-by: Massimo Lauria <massimo.lauria@uniroma1.it>
Ref: https://orgmode.org/list/CAJCFsEEHJXP4nKZpWdzheMM5O0Dq-tT+v0u0FsT+3Q0mi4v10A@mail.gmail.com
* lisp/org.el (org-fixup-indentation): Don't call indent-line-to with
a negative value.
* testing/lisp/test-org.el (test-org/promote):
(test-org/demote): Add tests.
The handling added in 11ef7454a (org.el (org-fixup-indentation): Fix
logbook drawers indentation, 2020-09-07) calls indent-line-to with a
value equal to the sum of current indentation and the DIFF argument,
but this can lead to a type error because DIFF may be negative.
Note that, aside from the headline-data test cases, the added tests on
top of the parent of e3b79ad2b (Allow a new value for
`org-adapt-indentation', 2020-02-09), which added the initial logbook
special case to org-fixup-indentation.
Reported-by: Duianto <otnaiud@gmail.com>
Ref: https://orgmode.org/list/CAE-tX7i5ew3ED3YX6jjx57qNuRtV0AumWKuE0W83YUUReKE5-g@mail.gmail.com
Reported-by: stardiviner <numbchild@gmail.com>
Ref: https://orgmode.org/list/CAL1eYuKObYzY2MHSQ+W08mW3TZ+83H45teOq_rHq9qz7-FEgKw@mail.gmail.com
* lisp/org.el: Don't require 'font-lock'; it is preloaded since
version 22.1.
Remove redundant requires of 'font-lock'
0a4aa2894297c0fd9e735328bbb60b427e0ba5d4
Stefan Kangas
Thu Dec 3 08:50:14 2020 +0100
* lisp/ol.el (org-link-search): Account for orphan #+name keyword.
If #+name is followed by a blank line (making it an invalid affiliated
keyword), :name is nil.
Reported-by: Dima Kogan <dima@secretsauce.net>
Ref: https://orgmode.org/list/875z5xf7f7.fsf@secretsauce.net
* lisp/org-goto.el: Require org.el and org-refile.el.
org-goto.el depends on org.el and org-refile.el being loaded, and the
autoloaded org-goto command may be called before org.el and
org-refile.el are loaded (and an org-refile.el load won't be triggered
just by visiting an Org file).
Reported-by: Omar Antolín Camarena <omar@matem.unam.mx>
Ref: https://orgmode.org/list/87h7pil2v5.fsf@matem.unam.mx
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): Instead of
run-ruby that always insists on using the existing buffer, use
run-ruby-or-pop-to-buffer that allows using the buffer with the
same name as :session header arg. Use the existing buffer
returned by inf-ruby-buffer only when :session header arg is nil.
https://github.com/nonsequitur/inf-ruby/issues/121
* 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>).
* 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
* 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).
* 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
* 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.
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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.
* 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/
* 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
* 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
* 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.
* 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