* lisp/org.el (org-insert-todo-heading): Insert TODO keyword relative
to the original headline, not to the headline above.
* testing/lisp/test-org.el (test-org/insert-todo-heading-respect-content):
Add test.
* lisp/org-table.el (org-table-shrunk-column-indicator):
* lisp/org.el (org-startup-shrink-all-tables): Update Org version to 9.2
and Emacs version to 27.1.
(customize-package-emacs-version-alist): Map Org 9.2 to Emacs 27.1.
Emacs 26.1 is now in the pretest phase, and the version for Emacs's
development branch is 27.1.
* lisp/org.el (org-backward-paragraph): Do not error when called from
a block opening line.
* testing/lisp/test-org.el (test-org/backward-paragraph): Add tests.
Reported-by: Omar Antolin <omar.antolin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00051.html>
* lisp/org.el (org-buffer-property-keys): Remove optional argument
IGNORE-MALFORMED.
* lisp/org-pcomplete.el (pcomplete/org-mode/prop): Update call to
previous function.
* testing/lisp/test-org.el (test-org/buffer-property-keys): Remove
a test.
More often than not, the question just gets in the way. Use `M-x
org-lint' instead.
* lisp/org.el (org-insert-link): Simplify so that description is only
prompted for once, if auto-desc is not set, and takes as its default
value, in order, default-description, the return value of
org-make-link-description-function (if the variable is non-nil), and
the current desc. Update the docstring to reflect that
default-description takes precedence over
org-make-link-description-function.
(org-make-link-description-function): Remove from docstring the
statement that if the variable is nil, then the link will be used as
the default description. This is undesirable, and was not in any case
implemented.
* lisp/org.el (customize-package-emacs-version-alist): Add entries for
all existing ":package-version" values, and remove entries for
versions that aren't used as ":package-version" values.
Note that this alist has a limited effect because we specify
":version" in almost all of our defcustoms. Two functions make use of
this alist: describe-variable-custom-version-info and
customize-changed-options. The former only looks at the alist if
:version isn't specified, and the latter only looks at :version if an
entry for :package-version isn't found in the alist.
We should consider removing the defcustom :version specifications so
that the package-version->version mapping only needs to be maintained
in one place.
* lisp/org-table.el (org-table-shrink): New function.
* lisp/org.el (org-startup-align-all-tables): Update docstring.
(org-startup-shrink-all-tables): New variable.
(org-mode): Use new function and new variable.
* lisp/org.el (org-copy-visible): Rewrite function. Do not use
dubious `org-find-visible' and `org-find-invisible'.
* testing/lisp/test-org.el (test-org/copy-visible): New test.
Reported-by: Gary Cheng <garycheng12@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00568.html>
* lisp/org.el (org-display-inline-images): Fix thinko in previous
commit. Also remove code related to nested links as this is no
longer possible in Org syntax.
* lisp/org.el (org-clone-local-variables): Prevent errors that could
happen when trying to set local variables that cannot be set,
e.g. `enable-multibyte-characters'.
* lisp/org.el (org-emphasis-regexp-components): Allow emphasis markers
after an hyphen.
(org-do-emphasis-faces): Do not strike-through table hlines.
Hypen is already allowed after emphasis markers. This allows one to
write, e.g., 2017-*09*-27.
* lisp/org.el (org-split-string): Move the function...
* lisp/org-macs.el (org-split-string): ... here. Also clarify
docstring with regards to `split-string'.
* lisp/org.el (org-cycle-hide-drawers): Don't check whether STATE is
`contents' within the `when' body because the `when' condition will
not pass in this case.
* lisp/org.el (org-create-formula-image): Use back-quote + single
quote to get the correct rendering of curved quotes.
Message displayed before this fix: "Please adjust ’imagemagick’ .."
Message displayed after this fix: "Please adjust ‘imagemagick’ .."
The effect of this fix is visible on emacs 25.1 and newer (See Emacs
NEWS).
* lisp/org.el (org-time-string-to-time): Remove optional POS and
BUFFER arguments. Accept new optional ZONE argument.
(org-time-string-to-seconds): Accept optional ZONE argument.
(org-check-before-date):
(org-check-after-date):
(org-check-dates-range):
(org-goto-calendar):
* lisp/ob-gnuplot.el (org-time-string-to-time):
* lisp/org-agenda.el (org-agenda-get-blocks):
* lisp/org-clock.el (org-clock-timestamps-change):
* lisp/org-list.el (org-time-string-to-seconds): Use UTC for time
difference and time comparison.
* testing/lisp/test-org-clock.el (org-test-clock-create-clock): Use
UTC for time differences.
* org.el (org-activate-dates): Change `org-activate-dates' to activate
custom timestamps for both dates in date ranges. Formerly, only the
second date would be activated. The reason was a misplaced
`if'. Replaced it with `when'. Also added doc comments.
TINYCHANGE
* lisp/org.el (org-check-before-invisible-edit): Fix "Before first
heading" error.
Invisible characters can come from overlays and text properties. The
current implementation tries to remove outline overlays, even though
it may be something else.
Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00365.html>
* lisp/org.el (org-todo): Display state change message when headline
is not visible, reversing unintentional modification from dd17e9d29.
Prior to dd17e9d29 (2014-05-31), a message was displayed when changing
the state of a headline that was *not* visible, helping the user know
what the new state was even though the headline was off the screen.
While extending this code, dd17e9d29 unintentionally reversed the
visibility check, resulting in the message only being shown when the
headline is visible.
Reported-by: Russell Adams <RLAdams@AdamsInfoServ.Com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00442.html>
* lisp/org.el (org-open-at-point): Also open links in example blocks
and diary-sexps.
* testing/lisp/test-org.el (test-org/open-at-point/keyword):
(test-org/open-at-point/property):
(test-org/open-at-point/comment): Add tests.
Reported-by: Dieter Faulbaum <Dieter.Faulbaum@helmholtz-berlin.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00277.html>
* lisp/org.el (org--file-cache): New variable.
(org-reset-file-cache):
(org-file-url-p): New function.
(org-mode-restart): Use new function.
* lisp/org.el (org-file-contents): Allow the FILE argument to be a
URL. If the URL contents are already cached, return the cache
contents, else download the file and return contents of that. The
file is automatically cached each time it is downloaded. Add a new
optional argument NOCACHE. If this is non-nil, the URL is always
downloaded afresh. Use `org--file-cache' and `org-file-url-p'.
* lisp/org.el (org-edit-special): Do not allow editing the "file" if a
URL is specified for the "#+SETUPFILE".
* lisp/ox.el (org-export--list-bound-variables)
(org-export--prepare-file-contents):
* lisp/org-macro.el (org-macro--collect-macros) : Adapt to the
possibility that the input to `org-file-contents' can be a URL too.
* doc/org.texi (Export settings, In-buffer settings)
(The very busy C-c C-c key): Mention that #+SETUPFILE keyword can now
take a URL as a value, and that C-c C-c on the #+SETUPFILE line will
clear the org file cache.
* testing/lisp/test-org.el (test-org/org-file-contents-url)
(test-org/org-file-contents-file): Add tests for org-file-contents.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options): Add
test for reading setupfile specified via a URL.
* lisp/org.el (org-comment-string): Wrap definition in an
eval-and-compile because this variable is used within the body of
eval-when-compile, leading to an error under "make single".
(org-at-timestamp-p): Use bound-and-true-p to check
org-agenda-include-inactive-timestamps because org-agenda may not be
loaded yet.
Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00326.html>
* lisp/org.el (org-activate-links): New function.
(org-set-font-lock-defaults): Use new function.
(org-activate-angle-links):
(org-activate-bracket-links):
(org-activate-plain-links): Remove functions.
* lisp/org-agenda.el (org-agenda-get-some-entry-text):
(org-agenda-finalize): Use new function.
Reported-by: 林镇国 <mistkafka@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113485>
* lisp/org.el (org-fill-element): New function.
(org-fill-paragraph): Use new function. Also handle region, when
called interactively.
* testing/lisp/test-org.el (test-org/fill-element): Renamed from
test-org/fill-paragraph. Update tests.
Reported-by: Oskar Kvist <oskar.kvist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113542>
* lisp/org.el (org-protect-slash): Remove function.
(org-refile-get-targets): Apply removal.
This internal function is used only once throughout the code base.
* lisp/org.el (org-store-link): When a double C-u prefix argument is
given, do not reverse the meaning of the org-context-in-file-links
option.
* testing/lisp/test-org.el (test-org/store-link): Add tests.
This allows the user to fall back to the core link storing functions
without also reversing their org-context-in-file-links preference,
because wanting to do the former does not mean a user also wants to do
the latter.
Reported-by: York Zhao <gtdplatform@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00254.html>
* lisp/org-macs.el (org-read-function): New function.
* lisp/org-table.el (org-table-sort-lines): Make WITH-CASE an optional
argument to match org-sort-entries and org-sort-list.
* lisp/org.el (org-sort-entries):
* lisp/org-table.el (org-table-sort-lines):
* lisp/org-list.el (org-sort-list): Read COMPARE-FUNC when called
interactively rather than being restricted to the default behavior of
sort-subr's PREDICATE parameter. Only prompt for for GETKEY-FUNC and
COMPARE-FUNC during an interactive call, like org-table-sort-lines
already did for GETKEY-FUNC, but use an argument rather than relying
on the brittle called-interactively-p.
Suggested-by: Zhitao Gong <zhitaao.gong@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00040.html>
* org.el (org-refile-get-targets): Setting org-refile-use-outline-path
to `file' or `buffer-name' causes an additional target for the file’s
root node to be inserted. This functionality was absent when using
`full-file-path'. We now add this since it is convenient and makes the
behavior more consistent.
* lisp/org-element.el (org-element-latex-fragment-parser):
* lisp/org.el (org-latex-regexps): Allow an apostrophe right after
a fragment.
* testing/lisp/test-org-element.el (test-org-element/latex-fragment-parser):
Add test.
In Text mode, and, as a consequence, in Org mode, "'" is not treated
as punctuation, but as word constituent. The apostrophe isn't caught
by "\s." regexp.
Reported-by: Joe Corneli <holtzermann17@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113464>
* lisp/org.el (org-N-empty-lines-before-current): Insert empty lines
before point, not after.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
* lisp/org.el (org-sort): Revert change from c1addc825 that replaced
org-call-with-arg with funcall because org-table-sort-lines changes
its behavior based on the return value of called-interactively-p.
* lisp/org.el (org-sort): Use funcall instead of org-call-with-arg,
and make WITH-CASE an optional argument.
* lisp/org-table.el (org-table-sort-lines): Make WITH-CASE an optional
argument.
* org.el (org-refile-get-targets): Add case to optionally prefix
refile targets with the buffer name.
(org-refile-use-outline-path): Add new option setting and document.
Having an option to use the buffer name as a prefix is convenient,
since this will work hand in hand with uniquify to only show those
parts of the filesystem path needed to disambiguate buffers of
identically named files, as opposed to prefixing refile targets with
the full filesystem path.
* org.el (org-refile-get-targets): Only escape slashes in headline
part of refile target; leave any file-system path component (when
enabled) unescaped.
The reason to escape slashes in refile targets is to make it clear
when a slash was part of a headline vs. part of the outline path. It
makes sense to treat slashes in the file system part the same way as
outline paths, since this won’t result in any confusion and serves to
make target selection less noisy.
* lisp/org.el (org--get-expected-indentation): Correctly indent line
when last element in an item is not a greater element.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
* lisp/org.el (org-todo): Fix explanation, if state change is blocked
by contained checkboxes.
Consider a node, which contains unchecked checkboxes; if you have set
org-enforce-todo-checkbox-dependencies and try to change the node to
DONE, you will be denied with a message explaining why. However in this
special case the explanation would be wrong in talking of an unrelated
node instead of the checkboxes.
The fix uses the already existing variable org-blocked-by-checkboxes
(which is handled in org-block-todo-from-checkboxes). Similar code is
already present in org-agenda-dim-blocked-tasks within org-agenda.el.
* lisp/org.el (org-forward-heading-same-level): Do not fail when
heading is at the beginning of the buffer.
* testing/lisp/test-org.el (test-org/forward-heading-same-level): New
test.
Reported-by: Rafael Laboissière <rafael@laboissiere.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/113084>
* lisp/org.el (org-N-empty-lines-before-current): Do not hide newline
character before current headline.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
Reported-by: Rick Frankel <rick@rickster.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112751>
* doc/org.texi: Document the new capture templates target.
* lisp/org-capture.el (org-capture-upgrade-templates): New function.
(org-capture-templates): Implement the new file+olp+datetree target.
(org-capture): Document the C-1 prefix.
(org-capture-sanitize-olp): New function.
(org-capture-select-template): Make sure upgraded version of templates
variable is used.
* lisp/org-datetree.el (org-datetree-find-date-create): Accept
`subtree-at-point' as a value for the KEEP-RESTRICTION argument.
(org-datetree-find-iso-week-create): Accept `subtree-at-point'
as a value for the KEEP-RESTRICTION argument.
* lisp/org.el (org-find-olp): Throw an error when called in a
buffer that is not in Org mode.
* lisp/org-capture.el (org-capture-fill-template): Use overriding time
also in `?<>' escapes.
* lisp/org.el (org-fontify-quote-and-verse-blocks): Append faces. Use
`add-face-text-property'.
This means fontification of emphasis, links etc. is kept in quote and
verse blocks even with org-fontify-quote-and-verse-blocks non-nil.
TINYCHANGE
* contrib/lisp/org-depend.el (org-depend-trigger-todo): Use new
functions.
* contrib/lisp/org-invoice.el (org-invoice-heading-info):
(org-invoice-info-to-table):
(org-invoice-list-to-table): Use new functions.
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler--build-task): Use
new functions.
* lisp/org-agenda.el (org-agenda-show-clocking-issues):
(org-agenda-format-item):
(org-agenda-filter-effort-form): Use new functions.
* lisp/org-clock.el (org-clock-get-clock-string):
(org-clock-modify-effort-estimate):
(org-clock-notify-once-if-expired):
(org-clock-out):
(org-clock-display):
(org-clock-put-overlay):
(org-clocktable-write-default): Use new functions.
* lisp/org-table.el (org-table-sort-lines): Use new functions.
* lisp/org.el (org-properties-postprocess-alist):
(org-refresh-effort-properties):
(org-set-effort):
(org-entry-properties):
(org-property-next-allowed-value): Use new functions.
(org-time-clocksum-format):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-fractional-format):
(org-time-clocksum-use-effort-durations): Declare as obsolete. Move
to "org-compat.el".
(org-minutes-to-clocksum-string):
(org-hh:mm-string-to-minutes):
(org-duration-string-to-minutes): Declare as obsolete. Move to
"org-compat.el".
(org-hours-to-clocksum-string): Remove function.
* lisp/org-colview.el (org-columns--collect-values): Use new
functions.
(org-columns--duration-re): Remove variable.
(org-columns--time-to-seconds): Rename to...
(org-columns--age-to-minutes): ... this.
(org-columns--format-age): New function.
(org-columns--summary-apply-times):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Use new functions.
* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents-at-point):
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
Update tests.
* lisp/ox-latex.el (org-latex-make-preamble): Add optional argument.
* lisp/org.el (org-create-formula-image): Use it.
Reported-by: plus <ctre@users.sourceforge.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/112015>
* lisp/org.el (org-get-repeat): Make sure matching group refers to the
proper regexp.
* testing/lisp/test-org.el (test-org/get-repeat): New test.
The bug was introduced in aef7eef0f.
* lisp/org.el (org-store-log-note): Make sure a note added after
clocking out is inserted right after the CLOCK line.
Reported-by: Jorge Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111795>
* lisp/org.el (org-ts-what): Remove variable.
(org-at-timestamp-p): Do strict checking. Also return a value instead
of setting `org-ts-what'. Improve docstring.
(org-timestamp-change): Remove use of `org-ts-what'.
(org-shiftcontrolup):
(org-shiftcontroldown): Optimize.
* lisp/org-clock.el (org-clock-timestamp-change): Remove use of `org-ts-what'.
* lisp/org.el (org-auto-repeat-maybe): Explicitly use `current-time'
to set LAST_REPEAT. The behavior of the function remains the same.
This allows to advice current-time to use a different time. Which
might help with testing and with functions which bend the time.
* lisp/org.el(org-refresh-property): Fixed by comparison to the code
before the refactoring.
With commit 126a1cd7c the "Effort" property broke the agenda.
* lisp/org.el(org-refresh-property): Fixed by comparison to the code
before the refactoring.
With commit 126a1cd7c the "Effort" property broke the agenda.
* lisp/org.el (org-refresh-properties): Handle inheritance from global
values (e.g., from "#+PROPERTY:" keyword).
(org-refresh-property): Handle property inheritance with a new
optional argument.
* testing/lisp/test-org.el (test-org/refresh-properties): New test.
* lisp/org.el (org--deadline-or-schedule): New function.
(org-schedule):
(org-deadline): Use new function.
* testing/lisp/test-org.el (test-org/deadline):
(test-org/schedule): New tests.
Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111569>
* lisp/org.el (org-entry-properties): Fix special property value in
current entry, do not leak into next entry.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111648>
* lisp/org.el (org-entry-delete): Also remove erroneously inserted
special properties in properties drawer. Small refactoring.
* testing/lisp/test-org.el (test-org/entry-delete): Add test.
Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111564>
* lisp/org.el (org-get-heading): NO-COMMENT tag, if non-nil, will not
return the COMMENT string with heading. Likewise, NO-PRIORITY, if
non-nil, will not return the priority cookie.
* lisp/org.el (org-clone-subtree-with-time-shift): Don't choke on a
blank SHIFT argument.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
test.
This fixes a regression introduced by c31462f33.
* lisp/org.el (org-clone-subtree-with-time-shift): Move to the
beginning of the heading before the timestamp search so that the
user will be prompted for a time shift even if point is after the
timestamp.
This also prevents an "Invalid search bound" error if point is on the
blank line following a body-less heading:
* single line <2017-02-28 Wed>
<point here>
Reported-by: Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/111456>
* lisp/org.el (org-drag-element-backward): When point is on empty
lines below a headline, call `org-move-subtree-up'.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
* lisp/org.el (org-N-empty-lines-before-current): Preserve point when
calling the function from the beginning of a line.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
* lisp/org.el (org-set-tags): Reveal newly inserted tags.
* testing/lisp/test-org.el (test-org/set-tags): New test.
Sometimes freshly added tags can be sucked into invisible outline
region (denoted by ellipsis) - and to see them you need to do the full
global visibilty cycle.
* lisp/org.el (org-do-emphasis-faces): Fix bold emphasis around
headlines. In particular, stars at the beginning of a headline are
not bold markup, and bold markup cannot end with stars at the
beginning of a headline.
Reported-by: Ian Dunn <dunni@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/110814>
* lisp/org.el (org-set-emph-re): Refactor code. Rip "~" and "="
markers off `org-emph-re'.
(org-do-emphasis-faces):
(org-sort-remove-invisible): Handle both `org-emph-re' and
`org-verbatim-re'.
(org-in-verbatim-emphasis): Use `org-verbatim-re' instead of
`org-emph-re'.
* lisp/org-element.el (org-element-code-parser):
(org-element-verbatim-parser): Use `org-verbatim-re' instead of
`org-emph-re'.
* testing/lisp/test-org-element.el (test-org-element/bold-parser):
(test-org-element/code-parser):
(test-org-element/italic-parser):
(test-org-element/strike-through-parser):
(test-org-element/underline-parser):
(test-org-element/verbatim-parser): Update tests, which no longer need
to bind `org-emph-re'.
* lisp/org.el (org-auto-repeat-maybe): Fix bug where repeating a task
containing a timestamp without a repeater would remove the scheduled
date.
Reported-by: 毛晓伟 <maoweirm@126.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110633>
* lisp/org.el (org-create-math-formula): Allow the xmlns attribute to
be preceded by any other mathml header attribute.
The problem here was that the match criteria for MathML assumed that
the xmlns attribute is the first listed in the top level MathML <math>
element. Some LaTeX -> MathML converters (e.g., pandoc) will add
attributes before xmlns, which is still valid MathML.
* lisp/org.el (org-drag-element-backward):
(org-drag-element-forward): Check that org-element-at-point returns a
non-nil value to avoid a type-error when called before first element.
* testing/lisp/test-org.el (test-org/drag-element-backward):
(test-org/drag-element-forward): Add test for when point is before
first element. Adjust existing should-error calls to specify
user-error.
* lisp/org.el (org-time-string-to-absolute): Change signature.
* lisp/org-agenda.el (org-agenda-get-scheduled): Fix various glitches
in scheduled dates display. Also fix such dates when
`org-agenda-repeating-timestamp-show-all' is nil. Apply signature
change.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110116>
Apple changed the spelling of its operating system again, to "macOS",
effective with macOS 10.12 Sierra (2016-09-20). Change Emacs
documentation and comments to match this. Stick with older OS
spellings ("OS X", "Mac OS X") when talking about older releases where
the older names are more correct.
Modernize usage of 'macOS' in doc and comments
dc152c54f4e44f5f2040883b03f71ff6aa66c893
Paul Eggert
Sun Nov 6 00:42:03 2016 -0700