Commit Graph

1658 Commits

Author SHA1 Message Date
Paul Eggert 9a8462771f Backport commit a4a3c92e9 from Emacs
* lisp/org-agenda.el (org-cmp-ts): Avoid arbitrary limit to
most-positive-fixnum or to most-negative-fixnum.
* lisp/org-footnote.el (org-footnote-new): Simplify.
* lisp/org-element.el (org-element--cache-generate-key):
Document fixnum limitation.

Prune most-positive-fixnum from Lisp source
a4a3c92e9de59bd0251f36326375cce898919edc
Paul Eggert
Wed Aug 22 20:46:08 2018 -0700
2019-01-13 12:43:04 -05:00
Glenn Morris 3d11e4c69b Backport commit 9c3eeba4d from Emacs
* lisp/org-agenda.el (org-agenda-search-view-search-words-only)
(org-agenda-remove-tags-when-in-prefix)
(org-agenda-align-tags-to-column, org-agenda-keymap):
* lisp/org.el (org-special-ctrl-a)
(org-log-state-notes-into-drawer)
(org-agenda-multi-occur-extra-files):
Move aliases before targets, to silence new compiler warning.

The tedious game of whack-a-mole with compiler warnings continues
9c3eeba4db26ddaeead100beea7a96f9fa640918
Glenn Morris
Fri Apr 20 18:34:39 2018 -0400
2019-01-13 12:43:04 -05:00
Glenn Morris 6a5082fccf Backport commit b1d7e5852 from Emacs
* lisp/org-agenda.el (org-agenda-mode):
* lisp/org-indent.el (org-indent-mode):
Replace filter-buffer-substring-functions, obsolete since 24.4.

Replace some obsolete uses of filter-buffer-substring-functions
b1d7e58520dc42a4eda902aa934a250fda6a04ca
Glenn Morris
Thu Mar 15 20:23:09 2018 -0400
2019-01-13 12:43:04 -05:00
Paul Eggert eb10ad9360 Backport commit c75f505de from Emacs
* 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.
2019-01-13 12:43:03 -05:00
Marco Wahl 295d149f46 agenda: Fix get category for habit lines
* lisp/org-agenda.el (org-agenda-get-category): New function to wrap
  the identification of the category of an agenda line.
2019-01-13 15:09:04 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Marco Wahl feb44212b5 org-agenda: slightly changed hints for user about searching again 2018-11-12 12:47:40 +01:00
Kyle Meyer aa4e0a5453 Merge branch 'maint' 2018-10-13 12:13:06 -04:00
Kyle Meyer e2f2502757 Fix typo in docstring
* lisp/org-agenda.el
(org-agenda-move-date-from-past-immediately-to-today): Fix typo.
2018-10-13 11:55:04 -04:00
Marco Wahl b19e7737dd org,org-agenda: New: open info depending on context
* lisp/org.el (org-info-find-node): Function to jump to info depending
  on context.  For an org file the context is the element type at point.
2018-10-01 22:47:33 +02:00
Marco Wahl e22d32b023 org-agenda: Reveal bulk mark pesistent feature for user
* lisp/org-agenda.el (org-agenda-bulk-action): Added a hint to "p"
  for toggling the persitent mark state for bulk action.
2018-09-27 16:28:51 +02:00
Adam Porter 98755f6296 org-agenda: `org-agenda-get-progress' set type text-property
* 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.
2018-09-06 21:41:07 +02:00
Adam Porter 83fa313cf8 Fix logbook list bullets with 2+ spaces
* 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.
2018-09-02 14:28:45 +02:00
Marco Wahl a6b4cec691 org-agenda: Refactored. Add test.
* 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.
2018-06-24 09:52:29 +02:00
Marco Wahl d6ebe38e2c Merge branch 'keep-some-local-variables-at-rebuild' into keep-text-scale-in-agenda-at-reload 2018-06-23 20:36:04 +02:00
Nicolas Goaziou fbd138f527 org-agenda: Fix SPC in agenda
* 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>
2018-06-21 20:25:03 +02:00
Marco Wahl 00c1184a04 org-agenda: Keep local-variables defining text-scale
* lisp/org-agenda.el (org-agenda-mode): Save and restore local
	   variables text-scale-mode-amount, text-scale-mode,
	   text-scale-mode-lighter, face-remapping-alist.  In effect
	   this keeps the text-scale at agenda rebuild and redo.

This commit is predicated on the newsgroup post of Samuel Wales "point
moves and zoom level reverts when refreshing agenda" at Sun, 27 May
2018.
2018-06-20 17:22:52 +02:00
Nicolas Goaziou 640e05523a org-agenda: Fix the last fix...
* lisp/org-agenda.el (org-tags-view): Fix last commit.
2018-05-11 21:55:23 +02:00
Nicolas Goaziou 68b376dee0 org-agenda: Fix "org-agenda: one-armed “if” -> “when”"
* lisp/org-agenda.el (org-tags-view): Re-instate delete `else' part.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00286.html>
2018-05-11 21:49:25 +02:00
Aaron Ecay 9d5852e3b8 org-agenda: misc code improvements
* lisp/org-agenda.el:
(org-agenda-todo-nextset, org-agenda-set-tags): Use “(foo ...)”
instead of “(funcall 'foo ...)”.
(org-agenda-add-entry-to-org-agenda-diary-file): Convert a cond to a
cl-case.

Also remove some compatibility code to work around an emacs feature
that was changed in 2005 (emacs commit 9a20c79b)
2018-05-10 04:22:30 +01:00
Aaron Ecay c9dd7a6a9d org-agenda: one-armed “if” -> “when”
* lisp/org-agenda.el (org-agenda-mode):
(org-agenda-undo, org-agenda):
(org-agenda-get-restriction-and-command):
(org-batch-agenda-csv, org-fix-agenda-info):
(org-agenda-get-some-entry-text):
(org-agenda-prepare, org-agenda-finalize):
(org-agenda-fontify-priorities, org-agenda-entry-text-hide):
(org-agenda-list, org-agenda-ndays-to-span):
(org-search-view, org-todo-list):
(org-tags-view, org-modify-diary-entry-string):
(org-agenda-get-day-entries, org-agenda-get-progress):
(org-agenda-get-deadlines, org-prefix-category-max-length):
(org-agenda-format-item, org-agenda-fix-displayed-tags):
(org-compile-prefix-format):
(org-agenda-before-sorting-filter-function):
(org-agenda-limit-interactively, org-cmp-time):
(org-agenda-set-restriction-lock-from-agenda):
(org-agenda-get-represented-tags, org-agenda-filter-apply):
(org-agenda-filter-top-headline-apply):
(org-agenda-remove-filter, org-agenda-compute-starting-span):
(org-unhighlight, org-unhighlight-once):
(org-agenda-show-tags, org-agenda-check-no-diary):
(org-agenda-date-later-minutes, org-agenda-diary-entry-in-org-file):
(org-agenda-add-entry-to-org-agenda-diary-file):
(org-agenda-bulk-unmark, org-agenda-to-appt): Convert ‘if’ without
‘else’ to ‘when,’ or ‘unless’ in the case of “(if (not ...))”
(org-batch-agenda-csv): Also convert while-catch to dolist.
(org-agenda-prepare): Also simplify a quasiquoted structure.
(org-agenda-entry-text-hide): Also convert a bogus ‘mapcar’ to ‘mapc’.
(org-compile-prefix-format): Also convert sequential ‘if’s to ‘cl-case’.
2018-05-10 04:22:30 +01:00
Nicolas Goaziou 0dda9bf1c1 Mark `org-get-indentation' as obsolete
* lisp/org-macs.el (org-get-indentation): Move function...
* lisp/org-compat: ... here.
* lisp/ob-core.el (org-babel-demarcate-block):
(org-babel-insert-result):
(org-babel-update-block-body):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-agenda.el (org-agenda-get-some-entry-text):
* lisp/org-capture.el (org-capture-place-item):
* lisp/org-clock.el (org-clock-in):
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-feed.el (org-feed-format-entry):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-list.el (org-in-item-p):
(org-list-struct):
(org-list-struct-apply-struct):
(org-list-item-body-column):
(org-toggle-item):
* lisp/org-src.el (org-src--edit-element):
* lisp/org.el (org-fixup-indentation):
(org-cdlatex-environment-indent):
(org--get-expected-indentation):
(org-indent-region):
(org-toggle-fixed-width):
* lisp/ox.el (org-export-expand-include-keyword): Use
  `current-indentation' instead.
2018-05-09 01:26:31 +02:00
Nicolas Goaziou 298eaa1c32 org-agenda: Fix last commit
* lisp/org-agenda.el (org-agenda-align-tags): Fix thinko in last
  commit.
2018-04-29 10:03:31 +02:00
Nicolas Goaziou 031b75f500 org-agenda: Fix tags alignment
* lisp/org-agenda.el (org-agenda-align-tags): Fix regexp.  Improve
  docstring.

The regression was introduced in "Use `org-tag-line-re'".

Reported-by: Xu Chunyang <mail@xuchunyang.me>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00587.html>
2018-04-29 09:57:33 +02:00
Bastien 2b6004f57e org-agenda.el: Update the logic of regexp filters
* lisp/org-agenda.el (org-agenda-filter-by-regexp): Remove
existing regexp filter.  Only cumulate filters when called
with two prefix arguments.

It seems more common and reasonable to hit "=" to filter
then hit "=" again to remove the filter.  Cumulative filters
are still accessible through hitting `C-u C-u ='.
2018-04-28 14:12:37 +02:00
Bastien f2af4a37a6 Fix commit 011f1c6 2018-04-28 13:53:06 +02:00
Bastien ed50e13e91 org-agenda.el: Only remove agenda restriction if it exists
* lisp/org-agenda.el (org-agenda-remove-restriction-lock):
Only remove agenda restriction if it exists.
2018-04-28 13:02:45 +02:00
Bastien 011f1c6181 Let `org-agenda-set-restriction-lock' remove restriction at point
* lisp/org-compat.el (org-speedbar-set-agenda-restriction):
* lisp/org-agenda.el (org-agenda-set-restriction-lock):
If there is an agenda restriction at point, remove it.

* doc/org-manual.org:
* etc/ORG-NEWS: Document the new feature.
2018-04-28 12:09:56 +02:00
Bastien 1a5ca5fa83 Merge branch 'maint' 2018-04-27 03:17:44 +02:00
Bastien 5d0792057d Fix commit f21fb8a 2018-04-27 03:17:12 +02:00
Bastien 8b6e5d5f2e Revert "org-agenda.el: Fix bug when getting the warning delay of a deadline"
This reverts commit f21fb8ad3b.
2018-04-27 03:09:28 +02:00
Bastien 8fd176ee76 Merge branch 'maint' into wip 2018-04-27 01:09:51 +02:00
Bastien f21fb8ad3b org-agenda.el: Fix bug when getting the warning delay of a deadline
* lisp/org-agenda.el (org-agenda-get-deadlines): Fix bug when
getting the warning delay of a deadline.

Thanks to Alex Branham for reporting this.
2018-04-26 22:59:36 +02:00
Bastien 877617d467 org-agenda: Act on the current entry if there is no mark
* lisp/org-agenda.el (org-agenda-bulk-action): When there is
no mark, act on the agenda entry at point.

Thanks to Marco Wahl for suggesting this.
2018-04-26 21:12:20 +02:00
Bastien 2742211ec6 org-agenda.el: Fix bug when keyboard-quitting the match prompt
* lisp/org-agenda.el (org-tags-view): Don't leave an empty
*Org agenda* buffer when keyboard-quitting the match prompt.

Thanks to Xu Chunyang for reporting this.
2018-04-26 18:44:58 +02:00
Allen Li 8944b578b8 Remove agenda-archives even with buffer restriction
* lisp/org-agenda.el (org-search-view): Remove agenda-archives even
  with buffer restriction.
2018-04-26 16:12:39 +02:00
Nicolas Goaziou 8b121d3aa2 org-agenda: Fix missing colons in agenda tags
* lisp/org-agenda.el (org-agenda-format-item): Fix missing colons in
  agenda tags.

This regression was introduced in "Standardize tag regexps" commit.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00321.html>
2018-04-21 11:54:25 +02:00
Nicolas Goaziou 4d152b994e Rewrite tags setting functions
* lisp/org.el (org-setting-tags): Remove variable.
(org-set-tags-command): Change signature.  For interactive use only.
(org-set-tags-to): Remove function.
(org-align-all-tags): Remove function.
(org-align-tags): New function.
(org-set-tags): Change signature.  For non-interactive use only.
(org-promote):
(org-demote):
(org-refile):
(org-todo):
(org-priority):
(org-toggle-tag):
(org-entry-put):
(org-fix-tags-on-the-fly):
(org-ctrl-c-ctrl-c):
(org-delete-indentation):
(org-return):
(org-kill-line): Apply signature change.  Use new functions.
* lisp/ox-beamer.el (org-beamer-property-changed):
(org-beamer-select-environment): Apply signature change.  Use new
functions.
* testing/lisp/test-org-archive.el (test-org-archive/to-archive-sibling):
  Update test.
* testing/lisp/test-org.el (test-org/set-tags): Add tests.
(test-org/set-tags-command): New test.
(test-org/set-tags-to): Remove test.
2018-04-20 10:51:21 +02:00
Nicolas Goaziou be31a0c459 Standardize tag regexps
* 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.
2018-04-19 14:28:54 +02:00
Nicolas Goaziou e87ebca2a7 Use `org-tag-line-re'
* lisp/org.el (org-activate-tags):
(org-toggle-tag):
(org--align-tags-here):
(org-fast-tag-selection):
(org-kill-line):
* lisp/org-agenda.el (org-agenda-align-tags): Use `org-tag-line-re'.
2018-04-19 11:52:07 +02:00
Nicolas Goaziou f05493504a Replace `org-get-tags-at' with `org-get-tags'
* contrib/lisp/org-drill.el (org-part-of-drill-entry-p):
* lisp/org-agenda.el (org-agenda-finalize):
(org-search-view):
(org-agenda-get-todos):
(org-agenda-get-timestamps):
(org-agenda-get-sexps):
(org-agenda-get-progress):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks):
(org-agenda-change-all-lines):
* lisp/org-bibtex.el (org-bibtex-headline):
* lisp/org-clock.el (org-clock-get-table-data):
* lisp/org-pcomplete.el (org-get-tags):
* lisp/org.el (org-trust-scanner-tags):
(org-get-local-tags-at):
(org-get-local-tags):
(org-set-tags):
(org-map-entries):
(org-entry-properties): Use `org-get-tags' instead of
`org-get-tags-at'.
2018-04-19 11:51:54 +02:00
Nicolas Goaziou 717b0f039d Merge branch 'maint' 2018-04-05 16:46:11 +02:00
Pierre Téchoueyres befc92b9c0 org-agenda: Call `recenter' only if buffer has a window
* lisp/org-agenda.el (org-agenda-list): Condition the call to
  `recenter` only when the buffer has a window associated.

This permit to call `org-agenda-list` in a `with-temp-buffer` like
below:

(with-temp-buffer
  (let ((org-agenda-sticky nil)
        (org-agenda-buffer-tmp-name (buffer-name)))
    (org-agenda-list 1)
    (buffer-string))
2018-04-05 16:45:40 +02:00
Nicolas Goaziou 30b7fba2ae Merge branch 'maint' 2018-03-26 23:27:07 +02:00
Nicolas Goaziou 842a5ba6d3 org-agenda: Fix temporary delays
* lisp/org-agenda.el (org-agenda-get-scheduled): Ignore "--Xd" delays
  after first repeat.

Reported-by: hhkg@protonmail.com
<http://lists.gnu.org/r/emacs-orgmode/2018-03/msg00481.html>
2018-03-26 23:22:38 +02:00
Nicolas Goaziou a1659053d5 Merge branch 'maint' 2018-03-01 10:56:01 +01:00
Nicolas Goaziou 428ab7942a org-agenda: Obey to "++" prefix when bulk rescheduling/resetting deadline
* lisp/org-agenda.el (org-agenda-bulk-action): When date starts with
  "++", shift every marked entry.

Reported-by: Michael Hoffman <gmane4-hoffman@sneakemail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2018-03/msg00001.html>
2018-03-01 10:53:35 +01:00
Nicolas Goaziou 1b259f95aa Merge branch 'maint' 2018-02-24 22:38:27 +01:00
Nicolas Goaziou 6ef5d2497c Revert "org-agenda: Fix lprops when recreating sticky agendas"
This reverts commit b306aa2245.
2018-02-24 22:36:29 +01:00
Nicolas Goaziou f3c20eb912 Merge branch 'maint' 2018-02-22 14:38:35 +01:00