Commit graph

1855 commits

Author SHA1 Message Date
Kyle Meyer 5dc375434c Clean up spacing to pass Emacs's pre-commit check
* lisp/org-agenda.el (org-agenda-todo): Avoid space before tab in
indent.

This is in preparation for syncing with the Emacs repo.
2020-12-12 14:41:42 -05:00
Stefan Kangas 00bc3097cd Backport commit affe9b225 from Emacs
* lisp/org-agenda.el (org-agenda-mode):
* lisp/org-table.el (org-table-edit-formulas, orgtbl-mode):
* lisp/org.el: Don't call easy-menu-add, an obsolete XEmacs compat
alias.

Make XEmacs compat aliases easy-menu-{add,remove} obsolete
affe9b225de711429248a73f920dc9f38b15c932
Stefan Kangas
Tue Nov 24 18:06:05 2020 +0100
2020-11-26 19:31:48 -05:00
Kyle Meyer 104d92199e agenda: Fix toggling of archive files
* 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
2020-11-17 00:49:22 -05:00
Kyle Meyer 95af0a244f agenda: Consistently clear temporary agenda name
* 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
2020-11-09 01:07:35 -05:00
Adam Spiers 752c466a63 org-agenda.el: Fix typo in docstring
* lisp/org-agenda.el (org-agenda-new-marker): Fix typo in docstring.

TINYCHANGE
2020-10-24 13:34:02 +02:00
Kyle Meyer b1de0c8e4b Fix regression in priority fontification
* 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
2020-10-11 02:04:11 -04:00
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