* lisp/org.el (org-insert-heading): Make C-RET more predictable. In
particular, it should not eat all the blank lines at the end of the
tree.
Reported-by: David Masterson <dsmasterson@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00275.html>
* lisp/org.el (org-auto-repeat-maybe): Fix speed regression introduced
in "Also obey to repeaters in inactive time stamps".
Reported-by: Marco Wahl <marcowahlsoft@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00078.html>
* lisp/org.el (org-repeat-re): Accept inactive time stamps.
(org-auto-repeat-maybe): Small refactoring. Find additional repeaters
also in inactive time stamps.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add test.
Reported-by: Leo Gaspard <orgmode@leo.gaspard.io>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00078.html>
* lisp/org.el (org--tags-expand-group): New function.
(org-tags-expand): Refactor code. Fix expansion of identical tag
groups in the same match string. Fix docstring. Remove unused
argument.
* testing/lisp/test-org.el (test-org/tags-expand): New test.
Reported-by: Omari Norman <omari@smileystation.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00360.html>
* lisp/org-src.el (org-src-source-file-name): New variable.
(org-src--edit-element): Set new variable.
* lisp/org.el (org-store-link): Store the source file along with the
coderef so as to insert link in other documents than the one
where the code block is located.
Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00293.html>
* lisp/org-src.el (org-src--source-buffer): Rename to `org-src-source-buffer'.
(org-src-source-type): New function.
(org-edit-src-save): Apply renaming.
* lisp/org.el (org-store-link): When in an edit buffer not editing
a source block, there is no point in inserting a coderef.
* lisp/org.el (org-mode): Do not call `org-refresh-effort-properties'.
(org-set-effort): Avoid using `effort' text property.
* lisp/org-timer.el (org-timer-set-timer): Avoid using
`effort-minutes' text property.
Limit use of `effort' and `effort-minutes' properties to "org-agenda".
* lisp/org.el: (org-get-tags) Create a clearer separation between
local and inherited tags in the function, so that
org-remove-uninherited tags is only run on inherited tags. This is
important to avoid destroying existing tags when adding new tags.
* testing/lisp/test-org.el: (test-org/get-tags) Add regression test
* lisp/org.el (org-kill-line): Preserve tags when `org-special-ctrl-k'
is non-nil.
* testing/lisp/test-org.el (test-org/kill-line): New test.
Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00122.html>
* lisp/org.el (org-open-at-point): Do not open everything that looks
like a link, in particular in verbatim or code objects. However,
still conveniently open links in comments, node properties and
keywords.
* lisp/ob-core.el (org-babel-open-src-block-result): Fix docstring,
refactor code.
* lisp/org.el (org-open-at-point): Refactor so as to not call
`org-babel-open-src-block-result' unconditionally.
* lisp/org.el (org-effort-duration): Remove unused variable.
* lisp/org-compat.el (org-effort-durations): Make
`org-effort-duration' an alias for `org-duration-units'.
* lisp/org-clock.el (org-clock-modify-effort-estimate): Fix docstring.
* doc/org-manual.org (Footnotes): Clarify footnote.
The variable is inactive since introduction of "org-duration" library.
* lisp/org.el (org--align-tags-here):
(org-set-tags): Modify buffer only when necessary.
* testing/lisp/test-org.el (test-org/set-tags): Add tests.
Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00242.html>
* lisp/org.el (org-read-property-value):
* lisp/org-capture.el (org-capture-fill-template): Sidestep
`org-set-property'. Use previous function and `org-entry-put'
instead.
Reported-by: Eric Danan <eric.danan@u-cergy.fr>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00061.html>
* lisp/org.el (org-metaup): Do not leave a character behind when
transposing regions.
(org-metadown): Fix "Transposed regions overlap" error.
Reported-by: Adam Porter <adam@alphapapa.net>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00184.html>
* org.el (org--check-org-structure-template-alist): New function
yielding user-error if using old org-structure-template-alist
format.
(org--insert-structure-template-mks):
* org-tempo.el (org-tempo-add-templates): Use new function
* lisp/org-capture.el (org-capture-member): Make obsolete; the old
definition was identical to ‘org-capture-get’ anyway.
(org-capture-mode-map): Move the calls to ‘define-key’ up to where the
variable is defined.
(org-capture-mode-hook): Small docstring tweak.
(org-capture-mode): Fix typo in mode lighter.
(org-capture-set-target-location, org-capture-place-item):
(org-capture-place-plain-text, org-capture-narrow):
(org-capture-empty-lines-after):
(org-capture-import-remember-templates): ‘if’ without else -> ‘when’
* lisp/org-colview.el (org-columns-edit-value): Change an error to a
user-error.
(org-columns-uncompile-format): Improve docstring.
* lisp/org-compat.el (org-remove-from-invisibility-spec): Make
obsolete, the underlying emacs function exists since 1997, commit 31aa282e.
(org-in-invisibility-spec-p, org-count-lines): ‘if’ without else -> ‘when’.
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-entities.el (org-entities-create-table):
* lisp/org-list.el (org-insert-item):
* lisp/org-macs.el (org-with-point-at, org-base-buffer):
(org-preserve-local-variables, org-overlay-display):
(org-overlay-before-string): ‘if’ without else -> ‘when’.
* lisp/org-eshell.el (org-eshell-open): Fix docstring typo.
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/language):
(pcomplete/org-mode/file-option/startup):
(pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
(pcomplete/org-mode/link, pcomplete/org-mode/tex):
(pcomplete/org-mode/todo, pcomplete/org-mode/searchhead):
(pcomplete/org-mode/tag, pcomplete/org-mode/prop): Avoid the formerly
misspelled ‘pcomplete-uniqify-list’ function. It has a defalias in
emacs >= 27; we add our own for older emacsen.
(pcomplete/org-mode/file-option/bind): ‘if’ without else -> ‘when’.
* lisp/org-protocol.el (org-protocol-capture):
(org-protocol-convert-query-to-plist): ‘if’ without else -> ‘when’.
(org-protocol-do-capture): Pacify byte compiler, simplify conditional
logic.
* lisp/org-table.el (org-table-create-with-table.el): Simplify conditional
logic.
(org-table-create, org-table-convert-region, org-table-next-field):
(org-table-beginning-of-field, org-table-end-of-field):
* lisp/org-w3m.el (org-w3m-copy-for-org-mode): ‘if’ without else ->
‘when’.
* lisp/org.el (org-babel-do-load-languages, org-previous-link):
(org-refile): Use ‘(foo ...)’ instead of ‘(funcall 'foo ...)’.
(org-add-log-note): Convert a long cond into a cl-case.
(org-priority): Improve docstring, show a deprecation warning if the
‘show’ argument is passed (which was previously silently ignored).
Also, use ?\s instead of ?\ as a character literal for space.
(org-fast-tag-insert): Fix docstring typo.
(org-fill-element): ‘if’ without else -> ‘when’.
(org-on-target-p): Remove ancient compatibility alias.
* lisp/org-table.el (org-table-with-shrunk-field): Move from here...
* lisp/org-macs.el: ...to here
The move is necessary because this macro is used (at compile time) in
org.el. We cannot leave its definition in org-table, because that
would lead to a require loop. So we need to put it in org-macs, and
require the latter file in org.el also at compile time.
Finally, update and sort the declare-function calls.
* lisp/org.el (org-browse-news): New command to browse the
news for the latest major release.
(org-org-menu): New menu entry to use the new command.
Thanks to Thomas Dye and Tim Cross for suggesting this.
* lisp/org.el (org-set-tags): Clean old tags unconditionally.
Even if the tags are the same, the line could contain noise, e.g.,
blanks after the tags, that could be cleaned up anyway.
* lisp/org.el (org-modules): Do not load Org Tempo by default.
Org Tempo is a backward compatible substitute for the new expansion
mechanism. It is only available for either die-hard "<s" users or
power users that need advanced templates.
* lisp/org.el (org-ctrl-c-ctrl-c): Display a message when the
checkbox item at point could not be updated.
* lisp/org-list.el (org-list-write-struct): Return the updated
structure.
* lisp/org.el (org-modules): Add org-tempo to the list of
default modules.
Template expansion is likely to be expected by many users, as it was
on by default in previous releases. Let's load org-tempo by default
and let users remove it. If needed, we can remove this in future
releases.
* lisp/org.el (org-mode): Let < and > be recognized as opening
and ending characters.
These characters are typically used in timestamps where it is useful
to use C-M-f and C-M-b to manipulate them.
* lisp/org.el (org-mode): Don't modify syntax entry for "@" globally.
This syntax entry dates from commit fe939ecb when it was used to allow
"@" in tags. Now "@" is a word constituent in tags, not anywhere.
* lisp/org.el (org--tag-add-to-alist): Preserve order when merging tag
alists. Remove duplicates only when they are outside a group.
Rename from `org-tag-add-to-alist'.
(org-set-regexps-and-options):
(org-global-tags-completion-table):
(org-make-tags-matcher):
(org-set-tags):
(org-change-tag-in-region):
(org-agenda-prepare-buffers): Apply renaming.
Reported-by: Alex Branham <alex.branham@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00311.html>
* org.el (org-timestamp-up): Document undocumented behavior.
(org-timestamp-up): The function changes the timestamp type when
the point is on the enclosing bracket. The documentation now
reflects that behavior.
* org.el (org-timestamp-down): Document undocumented behavior.
(org-timestamp-down): The function changes the timestamp type when
the point is on the enclosing bracket. The documentation now
reflects that behavior.
TINYCHANGE
* lisp/org.el (org-tag-re):
(org-tag-group-re): New variable
(org-tag-string-to-alist):
(org-scan-tags):
(org-make-tags-matcher):
(org-fast-tag-selection): Use new variables.
* lisp/org-agenda.el (org-agenda-list-stuck-projects):
(org-agenda-format-item):
(org-agenda-fix-displayed-tags):
* lisp/org-archive.el (org-archive-subtree): Use new variables.
* lisp/org.el (org-mode-map):
* doc/org-manual.org (With): Change keybinding of
org-insert-structure-template.
See the thread titled "Poll: new keybinding for
org-insert-structure-template?" in December 2017 for details.
* lisp/org.el (org-insert-structure-template): Change newline
behavior.
* testing/lisp/test-org.el (test-org/insert-template): New tests.
`org-insert-structure-template' considers indentation and also insert
newlines between the beginning and the end of the block.
* lisp/org.el (org-beginning-of-line, org-end-of-line): Fixed
documentation of org-beginning-of-line; synchronized with
documentation of org-end-of-line.
* lisp/org.el (org-tag-add-to-alist): Check against the car of
the ("tag") or ("tag" . ?k) element.
(org-global-tags-completion-table, org-make-tags-matcher)
(org-set-tags, org-change-tag-in-region)
(org-agenda-prepare-buffers): Use `org-tag-add-to-alist'.
* lisp/org.el: (org-global-tags-completion-table): Return all tags,
including tags in the buffer.
This fixes a bug that caused buffer tags to be excluded if user
configured tags either via `org-tag-alist' or the #+TAGS keyword.
* lisp/org.el (org-tag-add-to-alist): New function.
(org-set-regexps-and-options): Use the new function to only
append persistent tags if they are not already in the tags
alist.
* org.el (org-sort-entries): Guard against empty headings when sorting
alphabetically, numerically.
Due to how ‘org-complex-heading-regexp’ is defined, the title capture group
currently returns nil in empty headings, which we don’t want to pass on to
‘org-sort-remove-invisible’.
* lisp/org.el (org-set-tags-to): Do not throw an error on empty
headlines.
* testing/lisp/test-org.el (test-org/set-tags): Move test.
(test-org/set-tags-to): New test.
Reported-by: Adrian Bradd <a.bradd@columbia.edu>
<http://lists.gnu.org/r/emacs-orgmode/2018-03/msg00210.html>
* lisp/org.el (org-heading-delete-metadata): Move to...
* lisp/org-list.el (org-list--delete-metadata): ... here. Refactor
code.
(org-toggle-item): Use new function.
* testing/lisp/test-org-list.el (test-org-list/toggle-item): Add test.
At the moment, this function is only used internally in "org-list.el",
so it belongs there.
Also refrain from removing log or clock drawers, because they may not
contain all clocks or notes anyway. Besides, the information they
contain may still make sense in a plain list.
* lisp/org-list.el (org-toggle-item): Delete headings'
metadata before turning them into list items.
* lisp/org.el (org-log-drawer-start-re): New variable.
(org-log-drawer-end-re, org-log-drawer-re): New constants.
(org-heading-delete-metadata): New function.
(org-setting-tags): Fix comment.