* lisp/org.el (org--get-outline-path-1): Replace links with their
description, or path, in addition to removing statistics cookies.
(org-get-outline-path): Add an optional argument to include current
headline in path.
(org-refile-get-targets): Make use of new argument. Remove call to
`org-link-display-format', which is now handled in
`org--get-outline-path-1'.
* testing/lisp/test-org.el (test-org/get-outline-path): Add tests.
Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105425>
* lisp/org.el (org--get-outline-path-1): Fix wrong type arrayp error
when trying to get the outline path of an empty headline.
* testing/lisp/test-org.el (test-org/get-outline-path): Add test.
Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105407>
* lisp/org.el (org-refile-get-targets): Fix bug when using
`org-refile-target-verify-function'. Improve speed.
(org-olpa): Remove variable.
(org-outline-path-cache): New variable.
(org--get-outline-path-1): New function.
(org-get-outline-path): Use new function. This fixes return value when
cache is used and calls are not in the same path.
* testing/lisp/test-org.el (test-org/get-outline-path): New test.
Reported-by: Florian Adamsky <fa-org-mode@haktar.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/104829>
* lisp/org.el (org--valid-property-p): New function.
(org-entry-put):
(org-set-property): Use new function.
Suggested-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/104044>
* lisp/org.el (org-format-outline-path): Ignore nil path elements.
* testing/lisp/test-org.el (test-org/format-outline-path): Add test.
The PATH argument shouldn't contain a nil item. However, this didn't
fail before 1c74002, and helm-get-org-candidates-in-file relies on this
behavior, so prevent it from failing now.
Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102411>
* lisp/org.el (org-format-outline-path): Avoid out-of-range error when
the length of PREFIX is greater than the value given for WIDTH.
Prevent result from extending beyond WIDTH. Simplify code.
* testing/lisp/test-org.el (test-org/format-outline-path): Add tests.
Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102241>
* lisp/org.el (org-return): Properly follow links when description is
emphasized. Also tolerate links and timestamps in otherwise forbidden
areas (e.g., comments, node properties...), much like
`org-open-at-point'.
* testing/lisp/test-org.el (test-org/return): Add tests.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101977>
* lisp/org.el (org-add-planning-info): Do not remove too much
indentation when removing a planning line.
* testing/lisp/test-org.el: Add tests.
Reported-by: George McNinch <gmcninch@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100819>
* lisp/org.el (org-return): Make sure to keep headline from being
invalidated by restricting positions where it can be split.
* testing/lisp/test-org.el (test-org/return): Add test.
* org.el (org-return): Check for links first when
`org-return-follows-link' is non-nil, before inserting any newlines.
* testing/lisp/test-org.el (test-org/return): Add test.
This patch restores order in which `org-return' perform actions (which
was changed in a7e62499f2).
TINYCHANGE
* lisp/org.el (org-entry-properties): Make sure case is meaningful when
matching a TODO keyword.
* 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/99756>
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Do not check if an
entry can be blocked when it doesn't have any TODO keyword.
* lisp/org.el (org-entry-blocked-p): Make sure entry is really an open
task before even considering it as a blocked task. Small refactoring.
* testing/lisp/test-org.el (test-org/entry-properties): Update tests.
(test-org/entry-blocked-p): New test.
Reported-by: Bingo UV <right.ho@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99544>
* lisp/org.el (org-open-at-point): Find radio targets again.
(org-search-radio-target): New function.
* testing/lisp/test-org.el (test-org/open-at-point/radio-target): New
test.
* lisp/org.el (org-beginning-of-line): Prevent an error when buffer
contains only a single star.
* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.
* lisp/org.el (org-property--local-values): New function.
(org-entry-get): Use new function. Ignore global values when there is
no inheritance.
(org-entry-get-with-inheritance): Fix extended values, which do not
stop anymore inheritance search.
* testing/lisp/test-org.el (test-org/entry-get): Add tests.
* lisp/org.el (org-add-planning-info): Reset point before each
planning entry search. Clean up extra spaces.
* testing/lisp/test-org.el (test-org/add-planning-info): Add tests.
- Reposition save-excursion call to reset point every dolist
iteration. Otherwise, the order of the entries to be removed
matters, and a call like
(org-add-planning-info nil nil 'scheduled 'deadline)
on
DEADLINE: <2015-06-26 Fri> SCHEDULED: <2015-06-26 Fri>
will fail to remove the deadline entry.
- Delete leading white space even when at the beginning of the line so
that, when org-adapt-indentation is nil, a space is not inserted
when removing the leading planning info entry.
This prevents headings with repeating entries like
SCHEDULED: <2015-06-26 Fri +1w>
from being closed and recycled with an extra space in front of
SCHEDULED.
- Add leading white space to the planning info entry regexp to prevent
leftover white space when removing entries other than the first
entry.
* lisp/org.el (org-clone-subtree-with-time-shift): Allow argument
specifying number of clones to be 0.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
tests.
This makes it possible to clone a subtree with a repeating timestamp
so that the repeater is removed from the original subtree and a single
shifted, repeating clone is created. If the original subtree does not
have a repeating timestamp, no clones will be made.
* org.el (org-return): RET breaks headline text.
* test-org.el (test-org/return): Test org-return on headline text.
* ORG-NEWS: Add entry on new org-return behavior.
* lisp/org.el (org-refresh-category-properties): Prevent the `put-text-property'
to change the point in order to take into account the CATEGORY
property in subtrees also.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.
* lisp/org.el (org--get-expected-indentation): Diary sexps are to be
indented at column 0.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
* testing/lisp/test-org.el (test-org/find-property): Remove a test.
For efficiency reasons, since
7a717f8f04, `org-find-property' cannot
match accumulated properties. It still could be done with another
optional argument, at the cost of a slower algorithm, but is not
needed so far.
* lisp/org.el (org-backward-sentence):
(org-forward-sentence): Properly move at the boundaries of an element.
* testing/lisp/test-org.el (test-org/forward-sentence):
(test-org/backward-sentence): New tests.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/96377>
* lisp/org.el (org-tags-expand): Nesting grouptags.
Allowing subtags to be defined as groups themselves.
: #+TAGS: [ Group : SubOne(1) SubTwo ]
: #+TAGS: [ SubOne : SubOne1 SubOne2 ]
: #+TAGS: [ SubTwo : SubTwo1 SubTwo2 ]
Should be seen as a tree of tags:
- Group
- SubOne
- SubOne1
- SubOne2
- SubTwo
- SubTwo1
- SubTwo2
Searching for "Group" should return all tags defined above.
* lisp/org.el (org-tags-expand): Grouptags can have regular expressions as
"sub-tags".
The regular expressions in the group must be marked up within { }.
Example use:
: #+TAGS: [ Project : {P@.+} ]
Searching for the tag Project will now list all tags also including
regular expression matches for P@.+. Good for example if tags for a
certain project is tagged with a common project-identifier,
i.e. P@2014_OrgTags.
* lisp/org.el (org-tag-alist) : New symbols for grouptags when the
tags in the group don't have to be distinct on a heading.
Grouptags had to previously be defined with { }. This syntax is
already used for exclusive tags and Grouptags need their own,
non-exclusive syntax. This behaviour is achieved with [ ]. Note: {
} can still be used also for Grouptags but then only one of the
given tags can be used on the headline at the same time. Example:
[ group : sub1 sub2 ]
Grouptags also are not filtered when setting up tags. This means
they can exist multiple times in org-tag-alist list. It will be
usable if nesting of grouptags is ever to become reality.
There is a slightly annoying side-effect when setting tags in that a
tag which is both a part of a grouptag and a grouptag of it's own
will get multiple key-choices in the selection-UI.
* lisp/org.el (org--setup-process-tags): Adaption for the added syntax
for non-distinct grouptags.
* lisp/org.el (org-fast-tag-selection): Add support for the added,
non-unique, grouptag-syntax. Minor (if ...) to (when ...) refactor.
* lisp/org.el (org-entry-delete): Remove all occurrences of
accumulated properties, too. Return a non-nil value when some
property was removed.
* testing/lisp/test-org.el (test-org/entry-delete): Add test.
* doc/org.texi (Special properties): Remove "CATEGORY"
* lisp/org.el (org-special-properties): Remove "CATEGORY".
(org-property-get-allowed-values): Ignore "CATEGORY".
(org-entry-get): Make sure to get CATEGORY value using
`org-entry-properties'.
* testing/lisp/test-org.el (test-org/entry-put): Add test.
"CATEGORY" is not a special property as it can also be set using
a properties drawer.
* lisp/org.el (org-show-context-detail): New variable.
(org-context-choice, org-show-following-heading, org-show-siblings,
org-show-entry-below, org-show-hierarchy-above): Remove variables.
(org-show-set-visibility): New function.
(org-convert-to-oddeven-levels, org-get-location, org-show-context,
org-reveal): Use new function.
(org-link-search): Update docstring.
* lisp/org-agenda.el (org-agenda-cycle-show): Use new function.
(org-agenda-show): Replace missing variable.
* testing/lisp/test-org.el (test-org/show-set-visibility): New test.
* doc/org.texi (Sparse trees):
* doc/orgguide.texi (Sparse trees): Document changes.
* etc/ORG-NEWS: Signal changes.
Configuration of `org-show-context' is done with a single variable
offering six different views, instead of four variables for a total
of 16 configurations.
* lisp/org.el (org-time-stamp): Correctly match repeater, if any.
Refactor code.
* testing/lisp/test-org.el (test-org/time-stamp): New test.
Reported-by: Nicolas Richard <theonewiththeevillook@yahoo.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94974>
* lisp/org.el (org-link-search): Change headline search such that it
always does an exact search, ignoring spaces.
* testing/lisp/test-org.el (test-org/fuzzy-links): Test exact headline
match with spaces and cookies.
* doc/org.texi (External links): Cleanup footnote about the
`org-link-search-must-match-exact-headline' option for text searches
and add a footnote about the effect of the same option for heading
searches.
* doc/ORG-NEWS: Document changes.
* lisp/org.el (org-read-date-analyze): When
`org-read-date-prefer-future', offer a date in the future even if
default date is different from now.
* testing/lisp/test-org.el (test-org/org-read-date): Add tests.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/93805>
* lisp/org.el (org-open-at-point): Open outer link on nested links.
* testing/lisp/test-org.el (test-org/open-at-point/inline-image): New
test.
Suggested-by: Daniel Bausch <bausch@dvs.tu-darmstadt.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/92796>
* lisp/org.el (org-entry-properties): Fix returned CATEGORY property
when no specific keyword is provided.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.