Commit Graph

15333 Commits

Author SHA1 Message Date
Kyle Meyer c7c04b0447 Merge branch 'maint' 2019-08-18 17:44:08 -04:00
Kyle Meyer 9e1b9fe627 Port more time-related changes
* 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.
2019-08-18 17:37:51 -04:00
Kyle Meyer d72b4af96e org-clock: Adjust steps calculation for Emacs 24 compatibility
* lisp/org-clock.el (org-clocktable-increment-day): Use
org-decode-time so that integer can be given for time on Emacs 24.
(org-clocktable-steps): Work with a float rather than internal time to
avoid "Invalid time specification" error on Emacs 24.

This fixes the failure of test-org-clock/clocktable/step on Emacs 24.
Note that the version of org-clocktable-steps on master has been
reworked and does not share this issue.
2019-08-18 17:36:13 -04:00
Kyle Meyer a23d0225ab org-time-stamp: Simplify encode-time call
* lisp/org.el (org-time-stamp): Use org-time-string-to-time.

This should have been applied with a6cead0d2 (Backport commit
476066e89 from Emacs, 2019-02-22).
2019-08-18 17:36:13 -04:00
Paul Eggert 74bf99502d Backport commit 988e37fa0 from Emacs
* 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.
2019-08-18 17:36:13 -04:00
Paul Eggert a3fcf6dff4 Backport commit 3d1c9a77c from Emacs
* lisp/org-timer.el (org-timer-show-remaining-time):
Don’t assume the remaining time is less than one hour.
Simplify.  The simplification removes the need for a
decode-time, and fixes a typo I introduced recently.

Fix org-timer-show-remaining-time > 1 hour
3d1c9a77c52664c8c3e4fa1ae25e1d13aab9b2f9
Paul Eggert
Sat Aug 17 17:22:25 2019 -0700

Note(km): This replaces porting of Emacs's c90a420779 (Add FIXMEs for
subsecond support, 2019-08-17).  It's modified to use
org-time-subtract and org-time-convert-to-integer for backward
compatibility.
2019-08-18 17:36:13 -04:00
Kyle Meyer bdc5861cf7 org-compat: Add kludges for time-related functions
* lisp/org-compat.el (org-decode-time, org-format-time-string)
(org-time-add, org-time-less-p, org-time-since, org-time-subtract):
New compatibility functions.

On Emacs 24, these functions are stricter about what they accept for
time.  These new function will be used to port over changes in the
Emacs repo.  Don't bother doing a bulk substitution in existing Org
code because that would produce a lot of churn and these calls should
already be compatible with Emacs 24.
2019-08-18 17:36:12 -04:00
Kyle Meyer 24ba689506 org-compat: Add time-convert compatibility wrappers
* lisp/org-compat.el (org-time-convert-to-integer)
(org-time-convert-to-list): New defsubt's to replace common
invocations of time-convert (new in Emacs 27).
* lisp/org-compat.el (org-current-time-as-list): Drop in favor of
org-time-convert-to-list.

These will be used to port changes from the Emacs repo.
2019-08-18 17:31:05 -04:00
Nicolas Goaziou 3405b9afac Hide newly created properties drawers
* lisp/org.el (org-flag-drawer): Change signature.
(org-insert-property-drawer): Hide newly created properties drawers.
2019-08-17 17:47:01 +02:00
Kyle Meyer 4e3a1b3f5a org-compat: Move proper-list-p kludge to proper section 2019-08-17 09:54:35 -04:00
Kyle Meyer 531f4be256 org-compat: Define org-xor as alias for xor if available
* lisp/org-macs.el (org-xor): Move to ...
* lisp/org-compat.el (org-xor): ... here, making it an alias for xor
on Emacs 27.

This is an alternative to porting Emacs's
c676444a43e4634c1f98ec286b5bd9e46b23216b, which targets the code prior
to 45a1918ef (Move `org-xor' into "org-macs.el", 2017-10-17).
2019-08-17 09:54:32 -04:00
Paul Eggert 218e694964 Backport commit c6ba8100e from Emacs
* lisp/org-id.el (org-id-time-to-b36):
Remove unnecessary ‘or’.

Fix minor Org timestamp inefficiencies
c6ba8100ea1db4616d3fe8485430b29143bc3d2e
Paul Eggert
Mon Aug 5 17:38:15 2019 -0700
2019-08-17 09:45:22 -04:00
Paul Eggert 08c7bbbf71 Backport commit a5b796a87 from Emacs
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs):
Omit unnecessary ‘?’ after nullable pattern.
* lisp/org-capture.el (org-capture-fill-template):
Match upper-case as well as lower-case letters.

Fix 2019-08-04 regex lint
a5b796a8798a809044d847568e6472cc5eca077e
Paul Eggert
Sun Aug 4 11:39:54 2019 -0700
2019-08-17 09:45:22 -04:00
Paul Eggert 71ce18920a Backport commit 5f3f3884a from Emacs
Improve time function doc
5f3f3884a0d2a88101d330b82ef5b584cfc02aa6
Paul Eggert
Sun Aug 4 10:09:25 2019 -0700
2019-08-17 09:45:22 -04:00
Basil L. Contovounesios 765577d9b3 Backport commit 2267110b6 from Emacs
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-agenda.el (org-agenda-show-new-time):
Always pass an explicit plist to remove-text-properties.

Fix usage of remove-text-properties
2267110b6f00bbb0ad87f4621e6ecd9dc1bd8581
Basil L. Contovounesios
Thu Aug 1 17:04:53 2019 +0300
2019-08-17 09:45:22 -04:00
Eric S Fraga cfe4598aa1 Add split-window-right option for editing source blocks
* org-src.el (org-src-window-setup, org-src-switch-to-buffer): Added
  new split-window-right option which splits horizontally.

This has been motivated by the increasing use of wide monitors.
2019-08-17 15:26:32 +02:00
Henrik Koschitzki 4e854974be ob-plantuml: Allow different @start-/@end clauses
* lisp/ob-plantuml (org-babel-plantuml-make-body) Do not insert
@startuml and @enduml if body already starts with "@start".

PlantUML supports non-UML diagrams that have to be enclosed with
@startgantt/@endgantt for example.  The code for these diagrams can
contain the proper clauses without being enclosed additionally with
@startuml/@enduml.
2019-08-17 14:26:26 +02:00
Renato Ferreira 413736f315 org-todo: Respect state argument when called from elisp
* lisp/org.el (org-todo): Respect argument when called from elisp when
calling from elisp (such as in `org-clock-in').

Fast selection should only be shown if a state argument was not used.
This fixes a regression introduced by f1c030bed (Prefix argument to
`org-todo' forces stage change logging, 2019-08-14).

TINYCHANGE
2019-08-16 18:30:09 -04:00
Marco Wahl f51e88bed8 Fix descriptive text in the menu of org-search-view 2019-08-16 13:17:28 +02:00
Carsten Dominik 59ae60c26a Add `org-overriding-columns-format' as an option in custom views
* lisp/org-agenda.el (org-agenda-custom-commands-local-options): Add
`org-overriding-columns-format'.
2019-08-16 09:49:29 +02:00
Carsten Dominik 07e48a7af6 Merge branch 'fix-org-columns-formatdocumentation' 2019-08-16 09:37:54 +02:00
Carsten Dominik 6dda536f9f Clear up unclear setting of columns format for the agenda
* lisp/org.el (org-columns-default-format-for-agenda): New option.

* lisp/org-colview.el (org-overriding-columns-format): Updated documentation.
(org-agenda-columns): `Use org-columns-default-format-for-agenda'

* doc/org-manual.org (Using Column View in the Agenda): Fix the
description how to set the columns format for agenda views.
2019-08-16 09:34:55 +02:00
Carsten Dominik 92c2265794 Merge branch 'improve-fast-todo-selection' 2019-08-16 08:49:43 +02:00
Nicolas Goaziou 299ec9e721 Merge branch 'maint' 2019-08-15 10:06:21 +02:00
Nicolas Goaziou bf8ae63588 ox-latex: Fix typo in Brazilian language code
* lisp/ox-latex.el (org-latex-babel-language-alist): Fix typo.
2019-08-15 10:05:42 +02:00
Carsten Dominik 4d88d41430 Cleanup code 2019-08-14 10:32:03 +02:00
Carsten Dominik f1c030bed5 Prefix argument to `org-todo' forces stage change logging
* lisp/org.el (org-use-fast-todo-selection): Allow values
`auto' and `expert'.
(org-todo): Change the interpretation of the prefix argument.
A single `C-u' now forces taking a logging time stamp and note.
(org-fast-todo-selection): Implement the `expert' option of
`org-use-fast-todo-selection' and avoid showing the selection
window.  Instead, show the options in the prompt.

* doc/org-manual.org: (Basic TODO Functionality): Document that `C-u
C-c C-t' is the simplest way to log a TODO state change.
(TODO keywords as workflow states): Slightly simplify text.
(TODO keywords as types): Document that tags should be used instead.
(Progress Logging, Closing items, Tracking TODO state changes):
Document that `C-u C-c C-t' is the simplest way to log a TODO
state change.
(Remote editing): Document using a prefix to the `org-agenda-todo'
command logs the state change.
(Using CDLaTeX to enter math): Document that CDLaTeX is	available on
MELPA.

* doc/org-guide.org (Progress Logging): Document the use of a
prefix to `org-todo' to force logging.
2019-08-14 09:58:38 +02:00
Carsten Dominik f5d27e046a Fix bug dealing with the width field of categories in agenda
lisp/org-agenda.el (org-compile-prefix-format): Fix bug dealing with
the width field of categories.  Fix by Héctor Enríquez Ramón.
2019-08-12 13:30:38 +02:00
Carsten Dominik e3856a0c8e Fix tag alignment after todo state change with empty headline
* lisp/org.el (org-todo): Fix tag alignment with empty headline.
2019-08-12 11:35:29 +02:00
Carsten Dominik 495826e897 Make it customizable if block lines should be fontified to end
* lisp/org.el (org-fontify-whole-block-delimiter-line): New option.

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Use
`org-fontify-whole-block-delimiter-line'. Also, clean-up the function.
2019-08-12 09:03:29 +02:00
Carsten Dominik 20d9fefe4e Hide drawer contenxt after sorting entries
2019-08-10  Carsten Dominik  <carsten.dominik@gmail.com>

* lisp/org.el (org-sort-entries): Hide drawers after sort.
2019-08-10 07:58:28 +02:00
Carsten Dominik de3faf0767 Improve TODO selection if some keys are present in several sequences
* lisp/org.el (org-todo): Give the current state as an
argument to `org-fast-todo-selection'.
(org-fast-todo-selection): Accept current state as an
argument.  Use that state to find out to which TODO sequence
the current state belongs and use that to make the right
choice if selection keys are not unique globally.  For
example, if you have a task sequence, and a project sequence,
you could use the "d" selection key in both sequences to
switch to the appropriate DONE (or e.g. PRDN) state.
2019-08-09 23:00:21 +02:00
Carsten Dominik db6952cfe4 Improve docstring of `org-todo' 2019-08-09 10:04:02 +02:00
Gustav Wikström 60e5faf676 org-element: Fixing typo's 2019-08-03 13:35:27 +02:00
Gustav Wikström b082de626d org-id: Additional id method; ISO8601 timestamp
* New choice in org-id-method

Timestamps can be chosen as org-id-method.  This id-method has the
benefit of being human-readable and has synergies with org-attach if
one likes to organize attachment directories by timestamp instead of
by random names.
2019-08-02 17:02:01 +02:00
Gustav Wikström 9104c0c52d org-id: New customization, org-id-locations-file-relative
* org-id-locations-file-relative

New customization that allows the user to specify that filenames
should be saved relative to the file specified in
org-id-locations-file, instead of being absolute paths.

* org-id-locations-save

Respects new custom variable, org-id-locations-file-relative, and
can save locations with relative filenames.

* org-id-locations-load

Updated to be able to deal with relative filenames if they exist.
2019-08-02 17:00:01 +02:00
Gustav Wikström 9865e6bd8b org-id: Speedup, minor functional change and fix
* org-id-update-id-locations

Major speedup and minor functionality change.  This function is more
predictable now since local open files are not considered.  Providing
files as arguments to the function does no longer override other
files.  They are instead seen as a complement.

* org-id-add-location

Don't add duplicates.

* org-id-hash-to-alist

Fixed function, previously didn't do its job correctly.
2019-08-02 15:35:19 +02:00
Nicolas Goaziou ff6508ad4b Bump Version keyword
* lisp/org.el: Bump Version keyword.

This is necessary for GNU ELPA. Ideally, such a change should be
tagged with the official release.
2019-08-02 09:55:53 +02:00
Carsten Dominik 4910bec3aa Bug fix for previous commit 2019-08-01 08:35:47 +02:00
Carsten Dominik 64739aa065 Implement force logging of a TODO state change
* lisp/org.el (org-todo): Make a tripple `C-u' prefix force
          logging the todo state change with timestamp and a note.
          Ignoting blocking a change now needs four `C-u' prefixes,
          because this is probably hardly ever used.

	* doc/org-manual.org (Tracking TODO state changes): Document
          forcing of state change logging with `C-u C-u C-u C-c C-t'.
2019-08-01 08:10:20 +02:00
Carsten Dominik 2d08e9d4be Merge branch 'master' of code.orgmode.org:bzg/org-mode 2019-07-27 22:04:06 +02:00
Carsten Dominik e413e7695c Keep brackets around capture link annotation, to protect spaces
2019-07-27  Carsten Dominik  <carsten.dominik@gmail.com>

	* lisp/org-capture.el (org-capture-fill-template): Keep [[]]
	around the %l link annotation.

When capture is called from a buffer and the template includes a %l
annotation, then this link needs to be enclosed in [[ ... ]].  The
default link is a search link that searches for the line at point -
and when the link contains whitespace, it needs to be part of the link.
2019-07-27 21:57:21 +02:00
Kyle Meyer 29f96ef1b7 Merge branch 'maint' 2019-07-23 23:25:05 -04:00
Kyle Meyer be47489c31 org-gnus: Add note about integer overflow guard
* lisp/org-gnus.el (org-gnus-follow-link): Add compatibility note to
code that guards against integer overflow.

Emacs's 7e294d55e1 (Remove some obsolete integer overflow handling,
2019-07-22) removes this, but we can't port that for compatibility
reasons.
2019-07-23 23:24:13 -04:00
Marco Wahl 09a15f4d7f org-agenda: Unify user interfaces for bulk action and tag filtering 2019-07-24 00:37:01 +02:00
Marco Wahl 669cbe4653 Merge remote-tracking branch 'origin/master' 2019-07-15 00:31:35 +02:00
Marco Wahl dc2198971b org-agenda: Respect narrowing for agenda restricted to buffer
* 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.
2019-07-15 00:22:51 +02:00
Nicolas Goaziou 6786fb2e31 Merge branch 'maint' 2019-07-15 00:00:25 +02:00
Marcin Borkowski 3b006f9a3e Fix a bug when `org-agenda-todo-ignore-deadlines` is set to t
* 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).
2019-07-14 23:59:55 +02:00
Kyle Meyer 57e254e67c Merge branch 'maint' 2019-07-14 11:14:54 -04:00