Commit Graph

1849 Commits

Author SHA1 Message Date
Bastien 19b741583d org-agenda.el (org-find-top-headline): Fix bug
* lisp/org-agenda.el (org-find-top-headline): Fix bug: don't
inclure the statistic cookie in the headline text as this can be
updated during agenda interaction.

Reported-by: William Horne <will.m.horne@gmail.com>
See <https://orgmode.org/list/CA+2+CK-TofaNS1FOyZGhd3jPKb-XNOYM-0ouP9=tW=qepKm7wg@mail.gmail.com>
2020-09-07 20:15:38 +02:00
Bastien 6d031c4f86 Merge branch 'maint' 2020-09-05 10:35:40 +02:00
nilninull 8ae058ebe6 org-agenda.el: Fix customization type
* lisp/org-agenda.el (org-agenda-category-icon-alist): Fix
customization type.

See <https://orgmode.org/list/CAPAiqPnq_2zZq8XrdzMUEr7HsAsCjxS+VUFFqqdyh_PAwLuuig@mail.gmail.com>

TINYCHANGE
2020-09-05 10:34:30 +02:00
Bastien Guerry ae0aec4959 Merge branch 'maint' 2020-09-04 19:16:27 +02:00
Bastien Guerry 39d9eb541f org-agenda.el: Filter category names with a hyphen specially
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-get-represented-categories): Handle category names
with one hyphen specially.

See <https://orgmode.org/list/87d06ds46s.fsf@fastmail.fm>
2020-09-04 19:15:15 +02:00
Bastien Guerry fd28d0ace6 Merge branch 'maint' 2020-09-04 17:48:20 +02:00
Bastien Guerry de3ffe99d0 org-agenda.el: Only recenter when called interactively
* lisp/org-agenda.el (org-agenda-redo): Only recenter when called
interactively.

See <https://orgmode.org/list/CAL1eYuKemsB-RTaechv0EYVLFr_t9rNdrjbMh6Jm1dH+aqga7w@mail.gmail.com>
2020-09-04 17:46:25 +02:00
Eric S Fraga e8ebf5d6c9 Add other-tab option for org-agenda-window-setup
* org-agenda.el (org-agenda-prepare-window, org-agenda--quit): Handle
other-tab option for agenda view creation and exit.
2020-08-29 08:04:03 -04:00
Kyle Meyer 220f2b0d93 agenda: Fix a docstring's position
* lisp/org-agenda.el (org-agenda-remove-filter): Move docstring to
correct position.
2020-08-17 23:20:05 -04:00
Kyle Meyer 95eaab7f44 agenda: Fold case when retrieving user-configured effort values
* 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.
2020-07-09 00:33:09 -04:00
Marco Wahl cc570144f8 agenda: Call finalize-hook later
* 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.
2020-07-05 23:09:38 +02:00
Nicolas Goaziou 1aa095ccf1 Fix drawer invisibility
* 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'.
2020-06-06 17:01:21 +02:00
Bastien efc12142b7 Revert "New function org-agenda-filter-set"
This reverts commit e9b1b8fde5.
2020-06-01 14:52:47 +02:00
Bastien 6f113a5392 Merge branch 'maint' 2020-05-24 14:26:30 +02:00
Bastien b614ed0bba lisp/org-agenda.el: Remove redundant code
* 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.
2020-05-24 14:25:56 +02:00
Stefan Kangas e9b1b8fde5 New function org-agenda-filter-set
* 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.
2020-05-23 11:06:54 +02:00
Paul Eggert 1e3184964c Backport commit 00be23c2a from Emacs
* 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
2020-05-21 20:51:38 -04:00
Kyle Meyer bfc4569ae3 Merge branch 'maint' 2020-05-20 23:00:40 -04:00
Kyle Meyer 5e2490bdf2 agenda: Respect FILETAGS when skipping archive entries
* 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>
2020-05-20 22:47:42 -04:00
Nicolas Goaziou 074ea1629c Deprecate `org-cycle-hide-drawers'
* lisp/org.el (org-hide-drawer-all): New function.
(org-cycle-hide-drawers): move...
* lisp/org-compat.el (org-cycle-hide-drawers): ... here.
* lisp/org-agenda.el (org-agenda-show-1): Remove use of
`org-cycle-hide-drawers'.
2020-05-09 15:30:02 +02:00
Nicolas Goaziou 1027e02569 Implement `org-cycle-hide-property-drawers'
* lisp/org.el (org-cycle-hide-property-drawers): New function.
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries):
(org-cycle-hook):
(org-show-entry):
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use new function.
2020-05-09 15:20:39 +02:00
akater d23bd91874 org-agenda.el: Complete multiple todo keywords
* 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
2020-05-01 23:32:29 -04:00
Kyle Meyer 32d8f2f32e Merge branch 'maint' 2020-04-12 01:44:21 -04:00
Kyle Meyer 1de7eabf25 Revert "org-agenda.el: Fix handling of one-time delays"
* 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>
2020-04-12 01:43:26 -04:00
Kyle Meyer b2aa7e99f2 Merge branch 'maint' 2020-04-07 22:47:51 -04:00
Kyle Meyer 561e9efd06 agenda: Fix regression in handling of non-caterory filters
* 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>
2020-04-07 22:47:37 -04:00
Mattias Engdegård 7265f2864e Backport commit af085ef40 from Emacs
* 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
2020-03-15 22:51:31 -04:00
Nicolas Goaziou a63073ec04 Move obsolete aliases into "org-compat.el" 2020-02-23 12:57:07 +01:00
Bastien e360cd8f3a Change the default values for several options
* 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.
2020-02-21 16:35:56 +01:00
Bastien 4cd497416f org-agenda.el: Rename two options
* 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.
2020-02-21 08:29:42 +01:00
Bastien 093e65ecc7 Merge branch 'maint' 2020-02-19 00:35:34 +01:00
Bastien 7e52b76612 org-agenda: Fix logic of `org-agenda-filter-make-matcher'
* 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.
2020-02-19 00:35:20 +01:00
Bastien fae16ed8f5 Add `generated-autoload-file' buffer local variable
* lisp/org.el:
* lisp/org-num.el:
* lisp/org-macs.el:
* lisp/org-list.el:
* lisp/org-lint.el:
* lisp/org-keys.el:
* lisp/org-goto.el:
* lisp/org-duration.el:
* lisp/org-compat.el:
* lisp/org-colview.el:
* lisp/org-capture.el:
* lisp/org-agenda.el:
* lisp/ol.el: Add `generated-autoload-file' buffer local variable.

This is needed when compiling Org files within GNU Emacs.
2020-02-18 23:37:24 +01:00
Bastien 6a1f6ee1f8 Tiny formatting fixes
* lisp/ox.el (org-export-table-dimensions):
* lisp/ox-texinfo.el (org-texinfo-template):
* lisp/ox-md.el (org-md-link):
* lisp/ox-icalendar.el (org-icalendar-use-UTC-date-time-p):
* lisp/ox-ascii.el (org-ascii-fixed-width):
* lisp/org.el (org-context):
* lisp/org-table.el (org-table-eval-formula)
(org-table-export):
* lisp/org-refile.el:
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
* lisp/org-num.el (org-num):
* lisp/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org-macro.el (org-macro):
* lisp/org-lint.el (org-lint):
* lisp/org-keys.el (org-keys):
* lisp/org-duration.el:
* lisp/org-clock.el (org-clock-get-last-clock-out-time)
(org-clock-update-mode-line, org-find-open-clocks):
* lisp/org-agenda.el (org-diary)
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
(org-agenda-highlight-todo, org-cmp-alpha)
(org-agenda-filter-by-category):
* lisp/ol.el (org-link-expand-abbrev, ol):
* lisp/ol-docview.el (ol-docview):
* lisp/ol-bibtex.el (org-execute-file-search-in-bibtex)
(org-bibtex, org-bibtex-read):
* lisp/ol-bbdb.el (org-bbdb-anniversary-description):
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org):
* lisp/ob-table.el (org-babel-table-truncate-at-newline):
* lisp/ob-stan.el:
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/ob-sql.el:
* lisp/ob-shen.el:
* lisp/ob-shell.el (org-babel-prep-session:shell)
(org-babel-prep-session:shell):
* lisp/ob-sed.el (org-babel-execute:sed)
(org-babel-execute:sed):
* lisp/ob-screen.el:
* lisp/ob-sass.el:
* lisp/ob-ruby.el (org-babel-prep-session:ruby)
(org-babel-prep-session:ruby):
* lisp/ob-ref.el (org-babel-ref-resolve, ob-ref):
* lisp/ob-python.el (org-babel-prep-session:python)
(org-babel-prep-session:python):
* lisp/ob-plantuml.el:
* lisp/ob-picolisp.el:
* lisp/ob-perl.el:
* lisp/ob-org.el:
* lisp/ob-octave.el (org-babel-prep-session:octave)
(org-babel-prep-session:octave)
(org-babel-octave-evaluate-session):
* lisp/ob-ocaml.el:
* lisp/ob-mscgen.el (org-babel-execute:mscgen)
(org-babel-execute:mscgen):
* lisp/ob-maxima.el:
(ob-maxima):
* lisp/ob-matlab.el:
* lisp/ob-makefile.el:
* lisp/ob-lua.el (org-babel-prep-session:lua)
(org-babel-prep-session:lua):
* lisp/ob-lisp.el:
* lisp/ob-ledger.el:
* lisp/ob-latex.el (org-babel-expand-body:latex)
(org-babel-expand-body:latex, ob-latex):
* lisp/ob-js.el:
* lisp/ob-java.el:
* lisp/ob-io.el (org-babel-prep-session:io)
(org-babel-prep-session:io):
* lisp/ob-hledger.el:
* lisp/ob-haskell.el:
* lisp/ob-groovy.el (org-babel-groovy-wrapper-method)
(org-babel-groovy-evaluate):
* lisp/ob-gnuplot.el:
* lisp/ob-fortran.el (org-babel-expand-body:fortran)
(org-babel-expand-body:fortran):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-exp.el (ob-exp):
* lisp/ob-eval.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-ebnf.el:
* lisp/ob-dot.el:
* lisp/ob-ditaa.el:
* lisp/ob-css.el:
* lisp/ob-core.el (org-babel-put-rownames):
* lisp/ob-coq.el:
* lisp/ob-comint.el:
* lisp/ob-calc.el:
* lisp/ob-awk.el:
* lisp/ob-asymptote.el:
* lisp/ob-abc.el:
* lisp/ob-R.el (org-babel-prep-session:R): Formatting fixes.
2020-02-18 22:57:37 +01:00
Bastien 44e17c420b Merge branch 'maint' 2020-02-18 10:31:49 +01:00
Stefan Kangas 2129ece3b5 org-agenda.el: Fix typo
* lisp/org-agenda.el (org-agenda-add-entry-text-descriptive-links):
Fix typo.
2020-02-18 10:31:37 +01:00
Bastien b8a2ad9288 org-agenda.el: New hook `org-agenda-filter-hook'
* 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.
2020-02-17 18:40:11 +01:00
Bastien f25b40621b Merge branch 'maint' 2020-02-17 14:23:00 +01:00
Bastien fb188adda0 org.el: Move `org-agenda-diary-file' to org-agenda.el
* lisp/org-agenda.el (org-agenda-diary-file): Move from org.el.
* lisp/org-colview.el (org-agenda-diary-file): Move to org-agenda.el.
2020-02-17 14:22:30 +01:00
Bastien 5dd7721242 Use `org-switch-to-buffer-other-window' in a few places
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org-attach.el (org-attach):
* lisp/ob-lilypond.el (org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-mark-error-line): Use
`org-switch-to-buffer-other-window' instead of
`switch-to-buffer-other-window'.
2020-02-17 09:04:19 +01:00
Bastien 915a8eade4 org-agenda.el/org-capture.el: Use `user-error' in two places
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-agenda.el (org-agenda-clock-out): Use `user-error'.
2020-02-17 08:55:19 +01:00
Bastien e8402f3cad org-agenda.el: Let `org-agenda-filter' consider group tags
* 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.
2020-02-17 08:20:55 +01:00
Bastien 41c5fe0be8 org-agenda.el: Fix call to `org-agenda-finalize-hook'
* lisp/org-agenda.el (org-agenda-finalize): Run functions in
`org-agenda-finalize-hook' at the very end.
2020-02-17 00:45:28 +01:00
Bastien dfa7a3397b org-agenda.el: Fix call to `org-agenda-finalize-hook'
* lisp/org-agenda.el (org-agenda-finalize): Run functions in
`org-agenda-finalize-hook' at the very end.
2020-02-17 00:45:13 +01:00
Bastien 0fa69d2f1a Merge branch 'maint' 2020-02-14 10:32:44 +01:00
Bastien 27e4d7ce48 Prevent infinite loop when showing new time in agenda
* 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.
2020-02-14 10:32:35 +01:00
Bastien 8b6060a9bb Merge branch 'maint' 2020-02-12 21:33:19 +01:00
Bastien c0d08b7efe org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug
* 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.
2020-02-12 20:00:29 +01:00
Bastien 2508dfa644 Factor out org-scroll and use it in ox.el, org-agenda/attach.el
* 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.
2020-02-11 01:04:28 +01:00
Bastien ceb8086301 Small refactoring
* 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.
2020-02-10 23:22:51 +01:00