* lisp/org-agenda.el (org-agenda-highlight-todo): Skip formatting
the to-do keyword when `org-agenda-todo-keyword-format' is the
empty string.
TINYCHANGE
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
* lisp/org-agenda.el (org-agenda-show-new-time): Add fallback for when
window-font-width isn't available.
efbf96389 (org-agenda.el: Fix display of agenda new time, 2020-02-02)
reworked the column calculation to use window-font-width, but that
function isn't available until Emacs 25, and it's definition can't be
easily ported to org-compat.
Instead just use the old logic, which had been in place since v8.2.6,
when window-font-width isn't available.
Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-get-represented-tags)
(org-agenda-filter-make-matcher-tag-exp): Make tags filtering
case-sensitive.
This fixes a bug introduced in commit 13a1a4fb9.
* lisp/org-agenda.el (org-agenda-finalize):
(org-agenda-format-item): Do not downcase tags.
(org-downcase-keep-props): Remove unused function.
(org-agenda-filter-expand-tags): Do not case-fold search.
* lisp/org.el (org-tags-expand): Document `downcased' argument as
obsolete and do not allow to expand downcased tags.
* testing/lisp/test-org.el (test-org/tags-expand): Remove test for
downcased tags expansion.
* doc/org-manual.org (TODO keywords, tags, properties, etc.):
Suggest that user-defined are usually lowercase, but don't make it
a requirement.
Reported-by: David Masterson <dsmasterson92630@outlook.com>
Link: https://orgmode.org/list/SJ0PR03MB5455D8D0C4F71AA495A9ABF79B709@SJ0PR03MB5455.namprd03.prod.outlook.com/
* lisp/org-agenda.el (org-compile-prefix-format): Use non-greedy match
for %(expression).
Previously, format like "%-12.12s%(expr1) %(expr2)" would not be
parsed correctly because of greedy "(.+)" regexp used to match the
expressions.
* lisp/org-agenda.el (org-get-entries-from-diary): Remove some
Emacs 21 compat code; 'list-diary-entries' was made obsolete in
favour of 'diary-list-entries' in 22.1 and removed in 24.1.
* org-agenda.el (org-agenda-format-item): Rename parameters so they
don't clash with dynamic variables used by
`org-prefix-format-compiled'.
TINYCHANGE
- Removed the global (defvar date) and (defvar entry) so as not to
conflict with function arguments of that name. Instead I added such
`defvar`s in the body of each of the functions where it
seemed needed.
- I added some FIXMEs for some issues I found along the way.
- Added an `org-dlet` macro, just like I had done for `calendar-dlet`,
but I also use `defvar` "manually" at some places, when splitting an
existing `let` into a mix of `let`s and `dlet`s seemed too much trouble.
- Removed uses of `org-let and `org-let2` not only because I consider
them offensive to my sense of aesthetics but also because they're
basically incompatible with lexical scoping.
I replaced them with uses of `cl-progv` which are a bit more verbose.
Maybe we should define some `org-progv` macro on top of `cl-progv` to
make the code less verbose, but I didn't do that because I like the
fact that the current code makes uses of `eval` a bit more obvious
(since these behave differently with lexical scoping than with
lexical binding, it seemed worthwhile).
- Removed the use of `eval` in `org-store-agenda-views` which was only
placed there in order to use a macro before it's defined (it would
have been simpler/cleaner to just move that functions *after* the
macro, but with the new code the problem doesn't occur any more anyway).
- Replaced a few `(lambda...) with actual closures.
Detailed changes follow:
(date, entry): Don't declare as being globally dynbound.
(org-agenda-format-date-aligned): Remove unused var `weekyear`.
(org-agenda-mode): `run-mode-hooks` is always available nowadays.
(org-agenda-undo): Remove unused var `last-undo-buffer`.
(org-agenda): Rename arg to `keys` and then dyn-bind it as `org-keys`.
Remove unused vars `buf` and `key`.
(org-agenda): Use `pcase` and `cl-progv` instead of `org-let`.
(org-let, org-let2): Mark as obsolete.
(org-agenda-run-series): Use `cl-progv` instead of `org-let` and `org-let2`.
(org-agenda-run-series): New function.
(org--batch-agenda): New function extracted from `org-batch-agenda`.
(org-batch-agenda): Use it.
(org--batch-agenda-csv): New function extracted from `org-batch-agenda-csv`.
(org-batch-agenda-csv): Use it.
(org--batch-store-agenda-views): New function, extracted from
`org-batch-store-agenda-views`.
(org-store-agenda-views, org-batch-store-agenda-views): Use it.
(org--batch-store-agenda-views): Use `cl-progv` instead of
`org-eval-in-environment`.
(org-agenda-write): Use `cl-progv` instead of `org-let`.
Use `with-current-buffer`.
(org-agenda-filter-any): Use `cl-some` instead of `eval`.
(org-agenda-list): Remove unused var `e`.
(org-search-view): η-reduce.
(crm-separator): Declare var.
(org-agenda-skip-if): Remove unused var `beg`.
(org-agenda-list-stuck-projects): Use a closure rather than `(lambda..).
(diary-modify-entry-list-string-function, diary-file-name-prefix)
(diary-display-function): Declare vars.
(org-diary): Declare `date` and `entry` as dynbound.
(org-agenda-get-day-entries): Use `org-dlet`.
(org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-get-deadlines, org-agenda-get-scheduled, org-agenda-get-blocks):
Declare `date` as dynbound.
(org-agenda-get-sexps, org-class): Declare `date` and `entry` as dynbound.
(org-agenda-format-item): Declare the vars mentioned in
`org-compile-prefix-format` as dyn-bound.
Also binding `extra`, suggested by Kyle Meyer <kyle@kyleam.com>.
(org-compile-prefix-format): Remove unused var `e`.
Use `member` rather than or+equal.
(org-set-sorting-strategy): Minor simplification.
(org-entries-lessp): Use `org-dlet`.
(org-agenda-redo): Declare var `org-agenda-tag-filter-while-redo`.
(org-agenda-redo): Use `cl-progv` rather than `org-let`.
(org-agenda-filter): Remove unused var `rpl-fn`.
Use `org-pushnew-to-end` to replace `add-to-list` on lexical var.
(org-agenda-filter-by-tag): Remove unused var `n`.
(org-agenda-filter-apply): Use `org-dlet`.
(org-agenda-compute-starting-span): Remove unused var `dg`.
(org-agenda-forward-block): Remove unused var `pos`.
(org-archive-from-agenda): Declare var.
(org-agenda-refile): Remove unused var `pos`.
(org-agenda-headline-snapshot-before-repeat): Declare var.
(org-agenda-todo): Remove redundant use of `bound-and-true-p`.
(org-agenda-add-note): Remove unused var `hdmarker` and unused `arg`.
(org-agenda-change-all-lines): Remove unused var `pl`.
(org-agenda-priority): Remove unused var `marker`.
(org-agenda-set-effort): Remove unused var `newhead`.
(org-agenda-schedule): Remove unused var `type`.
(org-agenda-clock-cancel): Remove unused `arg`.
(org-agenda-execute-calendar-command): Use `org-dlet`.
(org-agenda-bulk-action): Use closures instead of `(lambda ...).
(org-agenda-show-the-flagging-note): Remove unused vars `heading` and
`newhead`.
(org-agenda-remove-flag): Avoid `setq`.
* testing/org-test.el (org--compile-when): New macro.
(org-test-jump): Use it so compilation doesn't fail or generate broken
code when `jump` is not available.
* testing/lisp/test-org-src.el:
* testing/lisp/test-org-attach.el:
* testing/lisp/test-org-agenda.el:
* testing/lisp/test-ob-java.el: Pass explicit filename to `require`
so as not to rely on ".../testing" being in `load-path` during compilation.
* lisp/org-num.el: Require` org`.
* lisp/org-macs.el (org-eval-in-environment): Declare obsolete.
(org-dlet, org-pushnew-to-end): New macros.
* doc/Makefile (org.texi, orgguide.texi, %_letter.tex): Simplify quoting.
* contrib/lisp/ob-sclang.el: Don't crash compilation when `sclang`
is not available.
* contrib/lisp/ob-clojure-literate.el: Don't crash compilation when `cider`
is not available.
* contrib/lisp/ob-arduino.el: Don't crash compilation when `arduino-mode`
is not available.
* .gitignore: Add files generated during `make packages/org`.
While at it, I enabled lexical-binding in the affected files.
* lisp/org-agenda.el (org-let, org-let2): Move from org-macs and
use `declare`.
* lisp/org-macs.el (org-let, org-let2): Move these functions that are
inherently harmful to your karma to the only package that uses them.
(org-scroll): Use `pcase` to avoid `eval` and use more readable syntax
for those integers standing for events.
* lisp/org-element.el (org-element-map): Use `declare`.
Prefer `declare` over a `put` of `list-indent-function`.
8d5dfafab7dc40d4b74dc0b56d1b314fd8cac390
Stefan Monnier
Mon Feb 22 11:54:17 2021 -0500
* lisp/org-agenda.el (org-add-to-diary-list): Remove.
(org-diary-default-entry): Use diary-add-to-list directly.
org-agenda has compatibility kludges for the rename of
add-to-diary-list and the number of required arguments; both are no
longer needed. The fourth argument has been optional since 22.1, and
add-to-diary-list was marked as obsolete in favor of diary-add-to-list
in Emacs 23.1 and removed in Emacs 25.1.
* lisp/org-agenda.el (org-agenda-goto-date): Restore DATE argument
(removed in 7.9.3e), replacing unused SPAN argument.
* testing/lisp/test-org-agenda.el (test-org-agenda/goto-date): Add
test.
Among other changes, 93fcfe4d3 (2012-08-30) switched
org-agenda-goto-date's DATE argument to SPAN, moving the org-read-date
call out of the interactive form. The new argument is unused, and
it's not clear that this part of the change was needed for the fix.
It prevents lisp callers from specifying a date, so move the
org-read-date call back to the interactive form.
Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
Ref: https://orgmode.org/list/87pn10t83u.fsf@m4x.org
* lisp/org-agenda.el (org-agenda-filter): Downcase tags in the search
string provided by user. This is needed because all the tags stored
in 'tags text property are downcased.
Example when old code did not work is a tag like COMMON. The user
would not expect a need to input +|-common in the agenda filter
instead of +|-COMMON. The latter would only result in
"COMMON filter ignored because tag/category is not represented".
* lisp/org-agenda.el (org-agenda-bulk-custom-functions): Add
documentation about argument collection for custom bulk functions.
(org-agenda-bulk-action): Support function to collect arguments for
custom bulk functions.
* etc/ORG-NEWS (Option ~org-agenda-bulk-custom-functions~ now supports
collecting bulk arguments): Add entry to NEWS.
* lisp/ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Use `declare`.
* lisp/ob-core.el (org-babel-map-src-blocks): Use `declare`.
(org-babel-result-cond): Simplify edebug spec.
* lisp/org-clock.el (org-with-clock-position, org-with-clock):
* lisp/org-agenda.el (org-agenda-with-point-at-orig-entry):
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): Use `declare`.
Use `declare` instead of `def-edebug-spec` in most places
f8dbefbaa59bb17dd4a2dfa4d9ff560c46785792
Stefan Monnier
Fri Feb 12 16:08:01 2021 -0500
* lisp/org-agenda.el (org-agenda-filter-by-category): Shorten doc
strings to not exceed 80-column limits. (Bug#44858)
Shorten some over-wide docstrings in functions and macros
34a73666d9559d948815a53b63dc36cc878d5aff
Stefan Kangas
Sat Dec 19 18:21:06 2020 +0100
* lisp/ob-core.el (org-babel--string-to-number): Put hyphen last in
alternative.
* lisp/org-agenda.el (org-agenda-filter): Escape '+' correctly.
Follow good regexp practice
46394dff7f01e7fe4af06a6c344e151af5c3eef4
Mattias Engdegård
Fri Dec 18 14:35:09 2020 +0100
* lisp/org-agenda.el: Remove `generated-autoload-file' local
variable.
* lisp/org-capture.el: Ditto.
This is a continuation of a4e6a6fa7 which fixes fae16ed8f.
Reported-by: Andrii Kolomoiets <andreyk.mad@gmail.com>
* 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/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/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-agenda.el (org-agenda-filter-by-effort):
(org-agenda-filter-completion-function): Ignore case when querying
effort property key in org-global-properties since property keys are
documented as case-insensitive.
* lisp/org-agenda.el (org-agenda-finalize): Call the hooks after the
save-excursion.
This opens the way for hooks to position the cursor after agenda
generation.
* lisp/org.el (org-cycle-hide-drawers): Move back from "org-compat.el"
(org-cycle-hook):
(org-show-entry):
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries): Use `org-cycle-hide-drawers'.
(org-log-beginning):
(org--hide-wrapper-toggle):
(org-hide-drawer-all): Use `outline' invisibility spec for drawers.
(org-show-all): Rewrite taking into account drawers now have the same
invisibility spec as headlines.
(org-overview):
(org-content):
(org-tree-to-indirect-buffer): Use fast arguments for `org-show-all'.
(org-mode): Remove `org-hide-drawer' invisibility spec.
* lisp/org-compat.el (org-flag-drawer): Use `outline' for drawer
invisibility.
(org-cycle-hide-drawers): move back to "org.el".
* lisp/org-clock.el (org-clock-find-position): Use `outline' for
invisibility spec.
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use
`org-cycle-hide-drawers'.
* lisp/org-agenda.el (org-agenda-get-some-entry-text)
(org-agenda-finalize): Remove redundant code: the 'org-link face
is already set by `org-activate-links'.
Thanks to Kevin Liu for reporting this.
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-filter-set): Refactor out from 'org-agenda-filter', to
create a better interface to filter the agenda from Lisp.
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Don’t try to modify string constants.
Don’t attempt to modify constant strings
00be23c2af4aa1bb09afc6404c5ef68997dc18f5
Paul Eggert
Sun May 17 16:51:46 2020 -0700
* lisp/org-agenda.el (org-agenda-skip): Consider skipping all entries
in a file if org-archive-tag is set via FILETAGS.
Reported-by: George Sokolsky <sokolgeo@posteo.net>
<87pnb4i217.fsf@posteo.net>
* lisp/org-agenda.el (org-todo-list): Use completing-read-multiple
instead of completing-read when selecting todo keywords to filter by
in Agenda. Fix a typo in the prompt.
TINYCHANGE
* lisp/org-agenda.el (org-agenda-get-scheduled): Revert changes from
39c656870, which introduced a regression that prevents repeating tasks
from appearing for future dates.
The regression, reported in late February, seems likely to affect more
users than the one-time delay handling fixed by 39c656870
(org-agenda.el: Fix handling of one-time delays, 2020-02-01). As we
don't have a proposed fix at the moment, let's revert 39c656870.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
<87imjqdtpo.fsf@gmail.com>
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Combine filter
forms with `and' unless multiple positive categories are given.
06cf532f4 (org-agenda.el: Fix bug when using category filters,
2020-01-20) modified org-agenda-filter-make-matcher to group the form
with `or' rather than `and' for category filters. This logic was
tweaked again in a follow-up commit, 7e52b7661 (org-agenda: Fix logic
of `org-agenda-filter-make-matcher', 2020-02-19), which was supposed
to restrict the use of `or' to _multiple_ positive categories.
However, the follow-up commit incorrectly affected all filter types.
Avoid the check for non-category types.
Also, fix the regexp so that it matches whenever there are multiple
positive categories, not just a single one.
Reported-by: Jorge P. de Morais Neto <jorge+list@disroot.org>
<87v9nhit6c.fsf@disroot.org>
* lisp/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org-protocol.el (org-protocol-data-separator):
* lisp/org-table.el (org-table-number-regexp):
* lisp/ox-latex.el (org-latex-known-warnings):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.
Use regexp type for regexps in defcustom declarations
af085ef40b961ca3466e8b2dfb7f722573e5a4cc
Mattias Engdegård
Thu Dec 26 16:50:58 2019 +0100
* doc/org-manual.org (Execute commands in the active region):
Update the manual given the new defaults.
* etc/ORG-NEWS (New default settings for some options): New
section.
* lisp/org.el (org-loop-over-headlines-in-active-region):
Change the default value to `t'.
(org-fontify-done-headline): Ditto.
* lisp/org-agenda.el
(org-agenda-loop-over-headlines-in-active-region): Ditto.
* lisp/org-src.el (org-src-tab-acts-natively): Ditto.
* lisp/org-agenda.el (org-sort-agenda-notime-is-late): Make an
obsolete alias to `org-agenda-sort-notime-is-late'.
(org-sort-agenda-noeffort-is-high): Make an obsolete alias to
`org-agenda-sort-noeffort-is-high'.
(org-agenda-finalize-entries, org-cmp-effort, org-cmp-time)
(org-cmp-ts, org-agenda-compare-effort): Use the new names.
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Fix
logic: only use 'or when including several categories as e.g.
'("+cat1" "+cat2").
This fixes 06cf532f4.
* lisp/org-agenda.el (org-agenda-filter-hook): New hook.
(org-agenda-finalize): Enhance docstring.
(org-agenda-filter): Use the new hook.
(org-agenda-filter-expand-tags, org-agenda-filter-apply): ):
Fix docstrings.
* etc/ORG-NEWS: Document the new hook.
* lisp/org-agenda.el (org-agenda-filter): Expand group tags.
(org-agenda-get-represented-tags): Consider group tags
represented when one tag of the group is represented.
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Don't use
an overlay to make the task invisible, use text properties.
(org-agenda--mark-blocked-entry): Add text property
'org-filter-type to later use `org-agenda-filter-hide-line' if
necessary.
(org-agenda-filter-hide-line): Fix docstring.
The related bug was first reported in 2013 by Matt Lundin here:
https://lists.gnu.org/archive/html/emacs-orgmode/2013-08/msg00072.html
Then Andrew Hyatt reported it again, and provided a minimal recipe on
how to reproduce it consistently.
Thanks a lot to both of them.
* lisp/org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug
when matching the text at the end of the line.
Thanks to Nathan Neff for reporting and investigating this bug.
* lisp/ox.el (org-export--dispatch-ui): Update message in the
header line to promote the use of C-v and M-v while SPC and
DEL are still allowed for backward compatibility reasons.
* lisp/org-macs.el (org-scroll): New function.
* lisp/org-attach.el (org-attach): Use `org-scroll'.
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Allow C-v, M-v, C-n and C-p to scroll.
This change adverize C-v, M-v, C-n and C-p as the default keys
for scrolling the window, while SPC and DEL are still available
in the export dispatch window.
In particular, don't use SPC as a way to scroll the window in
the agenda commands dispatch window, as this key might be used
for a custom agenda command.
* lisp/org-macs.el (org-scroll): New function.
* lisp/ox.el (org-export--dispatch-action):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Use the new function.
* lisp/org.el (org-loop-over-headlines-in-active-region):
Mention `org-agenda-loop-over-headlines-in-active-region'.
* lisp/org-agenda.el (org-agenda-do-in-region): Use the
`region' face for the selected headline.
(org-agenda-loop-over-headlines-in-active-region): Mention
`org-loop-over-headlines-in-active-region'.
* doc/org-manual.org (Execute commands in the active region):
New section, documenting both
`org-loop-over-headlines-in-active-region' and
`org-agenda-loop-over-headlines-in-active-region' options.
* etc/ORG-NEWS (Looping agenda commands over headlines): Add
an entry about "Looping agenda commands over headlines".
* lisp/org-agenda.el (org-agenda-do-in-region): New function.
(org-agenda-maybe-loop): New macro.
(org-agenda-kill, org-agenda-archive-default)
(org-agenda-archive-default-with-confirmation)
(org-agenda-archive, org-agenda-archive-to-archive-sibling)
(org-agenda-archive-with, org-agenda-todo)
(org-agenda-set-property, org-agenda-set-effort)
(org-agenda-toggle-archive-tag, org-agenda-date-prompt)
(org-agenda-schedule, org-agenda-deadline)
(org-agenda-add-entry-to-org-agenda-diary-file): Use
`org-agenda-maybe-loop' to DTRT when the region is active.
(org-agenda-loop-over-headlines-in-active-region): New option.
* lisp/org-agenda.el (org-agenda-show-new-time): Fix infinite
loop while trying to show new time in hidden lines.
Thanks to Andrew Hyatt for reporting this.
* lisp/org-agenda.el (org-agenda-get-blocks): When both dates
are of the same value, assume this is a time to display for
each date in the range.
Thanks to David Masterson for reporting this.
* lisp/org-agenda.el (org-agenda-mode-map): Remap
'move-end-of-line to 'org-agenda-end-of-line.
(org-agenda-end-of-line): New command.
This fixes this bug: when moving to the end of line, if the next
line is hidden, changing the timestamp of the current headline would
not display the new time. This is also safer when archiving subtrees
and when performing actions on agenda headlines in general.
* lisp/org-agenda.el (org-agenda-archive-with): Bind
`org-archive-from-agenda' to `t' when archiving from agenda.
* lisp/org-archive.el (org-archive-subtree-save-file-p): New option.
(org-archive-subtree): Use the new option.
* doc/org-manual.org (Moving a tree to an archive file):
Mention the new option.
Thanks to Russ Allbery for suggesting a similar idea.
* lisp/org.el (org-font-lock-add-priority-faces): Use
`org-priority-regexp'.
(org-priority-regexp): Match multiple characters.
* lisp/org-agenda.el (org-agenda-fontify-priorities): Use
`org-priority-regexp'.
This commit paves the way for more flexibility in priority handling.
For example, `org-priority-[up/down]' could deal with priorities as
numbers (e.g. [#1]) instead of letters.
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c): Don't try to
deactivate columns as `org-columns-toggle-or-columns-quit' is
already bound to `C-c C-c' when the column view is active.
* lisp/org.el (org-ctrl-c-ctrl-c): Update docstring.
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c): New function.
This is to unify and thereby harmonize the behavior of C-c C-c with
regard to Org files and columns.
* lisp/org-agenda.el (org-agenda-mode): Fix bug: don't prevent the
use of M-x text-scale-mode RET.
Before this fix, M-x text-scale-mode RET was only available after
the agenda buffer was redone once. Now it is available immediately.
This fixes commit 00c1184a0.
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Use `or'
for category filters, `and' for other filters.
For example, when using `org-agenda-category-filter-preset' set to
'("+cat1" "+cat2"), using `and' in the filter matcher results in
displaying 0 headline, since no headline can have two categories.
* lisp/org-agenda.el (org-agenda-filter): Fix unescaped literal ‘+’ in
regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org.el (org-clone-subtree-with-time-shift): Fix a regexp typo
that mishandled strings like ‘\1d’, reported by the same email.
2019-12-05 regexp lint fixes
4c933077157ba409d645f4649c8a3a8e534d53d5
Paul Eggert
Thu Dec 5 19:32:12 2019 -0800
* lisp/org-agenda.el (org-agenda-check-type): Mention also 'component'
in the error message since it could be just the unallowed component
in a composed agenda buffer from which some action has been
triggered.
* lisp/org-agenda.el: Bind `org-agenda-filter' to `/` and move
`org-agenda-filter-by-tag' to `\`.
* doc/org-manual (Filtering/limiting agenda items): Improve the entire
section.
* lisp/org-agenda.el (org-agenda-filter): Append new filter elements
instead of prepending them. And allow an additional leading `+' to
signal that the new elements should be added to the current filter
instad of replacing them.
* lisp/org-agenda.el (org-agenda-get-represented-categories):
New function.
(org-agenda-get-represented-tags): Added a caching mechanism.
* (org-agenda-all-categories): Removed again, deferring to
`org-agenda-get-represented-categories'.
* lisp/org-agenda.el (org-agenda-represented-categories)
(org-agenda-represented-tags): New variables.
(org-agenda-finalize): Remove the caches for represented tags
and categories.
* lisp/org-agenda.el (org-agenda-filter-by-tag): Remove duplicate
selection letters from tag filter prompt. If tag groups were the same
in multiple agenda files, the selection characters would be repeated
in the prompt.
* lisp/org-agenda.el (org-agenda-check-clock-gap):
* lisp/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve-clock, (org-clock-resolve)
(org-resolve-clocks, org-resolve-clocks-if-idle)
(org-clock-in, org-clock-out, org-clock-sum, org-clocktable-steps):
* lisp/org-element.el (org-element-cache-sync-duration)
(org-element--cache-set-timer, org-element--cache-interrupt-p):
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el (org-timer-start):
(org-timer-pause-or-continue, org-timer-set-timer):
* lisp/org.el (org-today, org-auto-repeat-maybe): Port time-related
changes from the Emacs repo by using compatibility wrappers.
In the Emacs repo, there has been a lot of changes to Org files
involving time-related code. I've ported some of those changes but
have largely ignored any changes that break compatibility with older
Emacsen that we support. That, however, isn't a good approach because
it will be hard to do a systematic update once we bump our minimum
Emacs requirement. Instead use the recently added compatibility
wrappers where needed, which is ugly but more maintainable.
The main time-related changes this leaves unported are changes that
replace (apply #'encode-time args) calls with (encode-time args).
Until the first form is unsupported, adding a compatibility function
doesn't seem worth the churn.
Relevant Emacs commits include
c75f505dea6a560b825384cf3d277690f86840bf,
57c74793c46c6533b63836f00aecaf3ac2accb6d,
988e37fa0f922b852715671d59a0e3f682373411,
476066e89d6f0bb87220da690b8a476bf9655b80,
89c63b3522b62c0fd725f0b348927a2069238452.
* lisp/org-agenda.el (org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-clock.el (org-clock-get-sum-start):
* lisp/org.el (org-current-time, org-store-link)
(org-read-date, org-read-date-display)
(org-display-custom-time, org-timestamp-to-time)
Simplify use of encode-time.
* lisp/org-clock.el (org-clock-in, org-clock-update-time-maybe):
* lisp/org-colview.el (org-columns--age-to-minutes):
* lisp/org-macs.el (org-2ft):
* lisp/org.el (org-get-scheduled-time, org-get-deadline-time)
(org-add-planning-info, org-time-string-to-absolute)
(org-closest-date):
Use org-time-string-to-time instead of doing it by hand with
encode-time.
* lisp/org.el (org-read-date): Avoid extra trip through encode-time.
Simplify use of encode-time
988e37fa0f922b852715671d59a0e3f682373411
Paul Eggert
Sun Feb 10 23:54:35 2019 -0800
Note(km): org-current-time has been modified to use org-time-subtract
and org-time-less-p for backward compatibility. Some changes from
988e37fa0 have been dropped to keep encode-time's call compatible with
older Emacsen.
* lisp/org-agenda.el (org-agenda): Add a condition to check if
narrowing is in effect and in case set the agenda restriction markers.
* etc/ORG-NEWS (Respect narrowing when agenda command is restricted to buffer):
* doc/org-manual.org (The Agenda Dispatcher): Mention the behavior.
* lisp/org-agenda.el (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
Make `t' synonymous with `near' instead of `all' (as is stated in the
docstring).
* lisp/org-agenda.el (org-agenda-show-1):
* lisp/org-archive.el (org-archive-to-archive-sibling):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org.el (org-set-visibility-according-to-property):
(org-move-subtree-down):
(org-paste-subtree):
(org-yank-generic):
* testing/lisp/test-org-inlinetask.el (test-org-inlinetask/folding-directly-consecutive-tasks/1): Use `org-flag-subtree' instead of `outline-hide-subtree'.
`outline-hide-subtree' leaves overlays on top of white spaces,
particularly at the end of the buffer. `org-flag-subtree' does not.
* lisp/org-agenda.el (org-agenda-breadcrumbs-separator): New variable.
(org-agenda-format-item): Use org-agenda-breadcrumbs-separator
* etc/ORG-NEWS (New variable: ~org-agenda-breadcrumbs-separator~): New variable.
* lisp/org-agenda.el (org-agenda):
* lisp/org-clock.el (org-clock-out, org-clock-display):
* lisp/org.el (org-refile):
Don’t trust arbitrary strings to not contain "%" or "`" in
(message (concat STRING1 STRING2 ...)).
Be safer about "%" in message formats
3739d51ef3b935b30e40ba4534fe362bc685865f
Paul Eggert
Thu Mar 7 09:05:56 2019 -0800
* lisp/org-clock.el (org-clock-out):
* lisp/org.el (org-evaluate-time-range):
Avoid double-rounding of time-related values. Simplify.
* lisp/org-clock.el (org-resolve-clocks-if-idle):
Use time-since instead of open-coding most of it.
* lisp/org-agenda.el (org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-table.el (org-table-sum):
* lisp/org.el (org-babel-load-file, org-2ft, org-time-stamp)
(org-read-date-analyze, org-time-stamp-to-now):
Simplify.
Note(km): Many of the changes from 476066e89 have been dropped for
compatibility with older Emacsen.
Avoid some double-rounding of Lisp timestamps
476066e89d6f0bb87220da690b8a476bf9655b80
Paul Eggert
Fri Feb 22 18:33:57 2019 -0800
* doc/org-manual.org (Using Column View in the Agenda): Updated
reference to variable.
* lisp/org-agenda.el (org-agenda-finalize): Set buffer local variable
instead.
* lisp/org-colview.el (org-overriding-columns-format): Renamed.
(org-agenda-overriding-columns-format): Renamed.
(org-local-columns-format): New buffer local variable.
(org-columns-edit-value): Updated reference to variable.
(org-columns-next-allowed-value): Updated reference to variable.
(org-agenda-columns): Updated reference to variable.
Setting org-agenda-overriding-columns-format as a buffer local value
interferes with how it is used as a dynamically scoped var, so use a
separate variable for buffer local setting.
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
when no matcher was specified there is no point in showing
a trailing colon (and space).
* lisp/org-agenda.el (org-agenda-get-scheduled): Use the face.
This has the effect that if you just did the habit, it is "greyed out"
in the agenda.
TINYCHANGE
* lisp/org-habit.el (org-habit-scheduled-past-days): New variable
* lisp/org-agenda.el (org-agenda-get-scheduled): override
`org-scheduled-past-days' for habits if
`org-habit-scheduled-past-days` is not nil
TINYCHANGE
* lisp/org-agenda.el (org-agenda-to-appt):
* lisp/org-clock.el (org-clock-resolve-clock)
(org-clock-resolve, org-resolve-clocks-if-idle):
* lisp/org-colview.el (org-columns-edit-value, org-columns)
(org-agenda-columns):
* lisp/org-element.el (org-element--cache-interrupt-p)
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-get-faces)
(org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el ((org-timer-show-remaining-time):
* lisp/org.el (org-babel-load-file, org-current-time)
(org-today, org-auto-repeat-maybe)
(org-small-year-to-year, org-goto-calendar):
* lisp/ox.el (org-export-insert-default-template):
Use nil instead of (current-time) where either will do, as nil is
a bit more efficient and should have less timing error.
Prefer nil to (current-time) when either works
c75f505dea6a560b825384cf3d277690f86840bf
Paul Eggert
Fri Oct 20 19:42:23 2017 -0700
Note(km): The changes that will reverted in the next commit have been
dropped from the ChangeLog entries above.
* lisp/org-agenda.el (org-agenda-get-progress): Set "type"
text-property according to why the item was matched.
Previously, the "type" text-property was always set to "closed", even
when an item was actually matched because of its "Clock" or "State"
line.
Note: it's possible that some code might expect the value to be
"closed" in all 3 cases, in which case this could cause a minor
regression, so this change should be carefully considered. However,
in the long run, it seems like the correct thing to do and a
worthwhile change to make.
* lisp/org-agenda.el (org-agenda-get-progress): Accept multiple spaces
between the list bullet and "State" in the state-change regexp.
Previously, logbook list entries with more than one space between the
bullet and the beginning of the entry would be ignored. I.e., if
a bullet is defined in org-list-two-spaces-after-bullet-regexp, two
spaces will be inserted after the bullet, and that prevents
state-changed entries from appearing in the Agenda Log Mode view.
* lisp/org-agenda.el (org-agenda-mode): Factored out a function for a
loop occuring two times.
* testing/lisp/test-org-agenda.el: test the text scale after
agenda-undo.
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Properly display
drawers when SPC is pressed. Hide them again with a universal
prefix argument.
Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00254.html>