Commit Graph

677 Commits

Author SHA1 Message Date
Nicolas Goaziou 541aa0f62d org-clock: Fix clocking in
* lisp/org-clock.el (org-clock-find-position): Correctly position cursor
  on the correct headline.

Reported-by: Jan Malakhovski <oxij@oxij.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102170>
2015-10-25 15:51:53 +01:00
Nicolas Goaziou f01b3fadbc org-clock: Fix clock drawer creation
* lisp/org-clock.el (org-clock-find-position): Create clock drawer when
  a drawer is missing, even though requested, but some clocks are
  already present in the entry.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101973>
2015-10-18 01:39:36 +02:00
Nicolas Goaziou a36c15494e org-clock: Fix quarterly clock reports
* lisp/org-clock.el (org-clock-special-range): Properly set Q according
  to block specification.

Reported-by: "L.C. Karssen" <lennart@karssen.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/101899>
2015-10-15 00:03:36 +02:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Kyle Meyer 077810e521 Modify quote-related backport
These changes are in line with the changes proposed on the mailing list,
but many of those changes weren't necessary because they had already
been reverted in the Emacs repo.

<http://permalink.gmane.org/gmane.emacs.orgmode/100896/>
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
These changes are the combination of the commits below (in order
applied).  Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits.  Changes to message and help quote
display for Emacs 25 seem to be here to stay.  The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.

  Quoting fixes in lisp/org
  6cd2629bd1b3ce77d29ac28e29237c94a4197116
  Paul Eggert
  Mon Aug 31 00:29:40 2015 -0700

  More-conservative ‘format’ quote restyling
  fbb5531fa11d13854b274d28ccd329c9b6652cfc
  Paul Eggert
  Sun Aug 23 22:39:06 2015 -0700

  Prefer directed to neutral quotes
  875a5d0ead827d3da32ecbd30e739a29f07bbc87
  Paul Eggert
  Mon Aug 24 23:57:25 2015 -0700

  Escape ` and ' in doc
  19532d147b431a4fe34f088d6de07891c48e2c5c
  Paul Eggert
  Tue Sep 1 18:23:21 2015 -0700

  Fix some more docstring etc. quoting problems
  26bd978d87dfbf9baa115cd961a67d42b416c4bf
  Paul Eggert
  Thu Sep 3 15:32:54 2015 -0700

  Go back to grave quoting in source-code docstrings etc.
  6afef3f6ca2f3009c722b84e249903b7f807b044
  Paul Eggert
  Mon Sep 7 16:09:27 2015 -0700
2015-09-21 18:38:18 -04:00
Kyle Meyer 0cf9f17c55 Use substitute-command-keys more
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-log-mode-items):
(org-agenda-auto-exclude-function):
(org-search-view):
(org-todo-list):
(org-tags-view):
(org-agenda-log-mode):
(org-agenda-show-the-flagging-note):
* lisp/org-clock.el (org-clock-out-when-done):
* lisp/org-id.el (org-id-link-to-org-use-id):
* lisp/org-table.el (org-table-allow-automatic-line-recalculation):
(org-table-edit-formulas):
* lisp/org.el (org-support-shift-select):
(org-remove-highlights-with-change):
(org-refile-use-cache):
(org-use-fast-todo-selection):
(org-time-stamp-rounding-minutes):
(org-agenda-text-search-extra-files):
(org-cycle):
(org-ctrl-c-ctrl-c): Use substitute-command-keys.
2015-09-21 18:33:45 -04:00
Nicolas Goaziou 2d62c0e173 org-clock: Fix `org-clock-remove-empty-clock-drawer'
* lisp/org-clock.el (org-clock-drawer-name): New function.
(org-clock-find-position): Use new function.
(org-clock-remove-empty-clock-drawer): Remove drawer actually used for
clocks, which may be different from the one used for storing notes.
Also, consider that headlines could use different drawer names in the
same tree.
2015-09-01 10:29:33 +02:00
Tom Hinton 0500bd09e2 Fix clock in when org-clock-into-drawer is integer
* org-clock.el (org-clock-jump-to-current-clock): Fixed a bug wherein
  `org-clock-jump-to-current-clock' did not work if
  `org-clock-into-drawer' was not either a string or nil.

TINYCHANGE
2015-08-13 22:51:09 +02:00
Kyle Meyer 408f6da74d org-clock: Fix org-add-archive-files call
* lisp/org-clock.el (org-dblock-write:clocktable): Check that
  buffer-file-name is non-nil before passing to org-add-archive-files.
2015-08-10 12:19:39 -04:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Kyle Meyer 11e8749102 org-clock: Fix org-agenda-prepare-buffers call
* lisp/org-clock.el (org-dblock-write:clocktable): Pass buffer to
  org-agenda-prepare-buffers when buffer is not visiting file.

This surfaced as an error when 05efa7a ("Backport commit 3a5f751 from
Emacs master branch", 2015-08-08) replaced a
'(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)',
resulting in the body being executed when '(nil)' was passed to
org-agenda-prepare-buffers.
2015-08-09 21:39:18 -04:00
Kyle Meyer 6f9184a294 Merge branch 'maint' into backport-master 2015-07-26 23:56:50 -04:00
Stefan Monnier c6164293fc Backport commit c9a75a4 from Emacs master branch
* lisp/org.el (org-insert-heading, org-sort-entries):
* lisp/org-mouse.el (org-mouse-end-headline)
(org-mouse-context-menu):
* lisp/org-clock.el (org-clock-cancel):
Add explicit second arg to looking-back.

Fix byte-compiler warnings about looking-back.
c9a75a4030a556d700fd95222ec0bf4c1a9f67b5
Stefan Monnier
Mon Apr 20 21:55:00 2015 -0400
2015-07-26 23:29:31 -04:00
Kyle Meyer c115c7b4e8 org-compat: Use different font-lock-ensure alias
* lisp/org-compat.el (org-font-lock-ensure): Remove in favor of
  font-lock-ensure alias from dcbaebc.

Instead of org-font-lock-ensure alias introduced in dcbaebc ("Backport
commit 6711a21 from Emacs master branch", 2014-05-28), use
font-lock-ensure alias added in e6883dd ("org-compat: Provide
compatibility definition for font-lock-ensure", 2014-06-01).
2015-07-26 23:29:14 -04:00
Stefan Monnier d81e6b52b7 Backport commit 6711a21 from Emacs master branch
* lisp/org-compat.el (org-font-lock-ensure): New function.
* lisp/ox-odt.el (org-odt-do-format-code):
* lisp/ox-html.el (org-html-fontify-code):
* lisp/org.el (org-fontify-like-in-org-mode):
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/ox-org.el (org-org-publish-to-org):
Use it. Avoid using find-file from Elisp.

6711a21f1125c0047c56eb266eb374c1ec90a967
Stefan Monnier
Wed May 28 23:45:29 2014 -0400
2015-07-26 23:28:25 -04:00
Paul Eggert a55b5a4269 Backport commit f9acac7 from Emacs master branch
* lisp/org-clock.el (org-clock-save):
Prefer (system-name) to system-name, and avoid naming
locals 'system-name'.

system-name's returned value can vary
f9acac751d4cd22480e62cc63936b1208ca9fe48
Paul Eggert
Mon Dec 29 12:38:58 2014 -0800
2015-07-26 23:28:25 -04:00
Paul Eggert 217ad4aafb Backport commit 123ddec from Emacs master branch
* doc/org.texi (Dynamic blocks):
* lisp/org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling):
* lisp/org-clock.el (org-resolve-clocks, org-clock-get-sum-start)
(org-clock-special-range):
* lisp/org-timer.el (org-timer-seconds):
* lisp/org.el (org-read-date-analyze, org-get-cursor-date):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-icalendar.el (org-icalendar--vtodo):
Omit unnecessary call to current-time.
* lisp/org.el (org-get-cursor-date):
Don't call current-time twice to get the current time stamp,
as this can lead to inconsistent results.
* lisp/org-compat.el (org-float-time):
Simplify to an alias because time-to-seconds now behaves like float-time
with respect to nil arg.
* lisp/org-clock.el (org-clock-get-table-data): Omit unnecessary, lossy
conversion from floating point to Emacs time and back.
(org-resolve-clocks): Prefer two-argument floor.

Simplify use of current-time and friends.
123ddec7f807f4bd7400bbbe08219afb02269c00
Paul Eggert
Tue Oct 28 18:42:51 2014 -0700
2015-07-26 23:25:11 -04:00
Nicolas Goaziou c76fef6b9d org-clock: Add `untilnow' time block
* lisp/org-clock.el (org-clock-special-range): Handle `untilnow'
  range.
(org-clock--oldest-date): New variable.
(org-clock-display-default-range): Add `untilnow' as valid range.  Use
new variable.
(org-clock-display): Offer `untilnow' as a possible range.

* doc/org.texi (The clock table): Document `untilnow'

* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents-at-point): Fix test
when called interactively.
(test-org-clock/clocktable):
(test-org-clock/clocktable1): Update tests.
(test-org-clock/clocktable-until-now): New test.

* etc/ORG-NEWS (title): Document new feature.

Suggested-by: Sébastien Vauban
2015-07-04 14:31:34 +02:00
Bastien 367d48cbd8 Merge branch 'maint'
Conflicts:
	lisp/org-clock.el
2015-04-27 14:17:00 +02:00
Stefan Monnier 9ee9d69a34 org-clock.el (org-x11idle-exists-p): Be honest about which command is actually sent to the shell.
* org-clock.el (org-x11idle-exists-p): Be honest about which
command is actually sent to the shell.
2015-04-27 14:15:45 +02:00
Nicolas Goaziou 9290395405 Silence byte-compiler
* lisp/ob-shell.el (org-babel-sh-evaluate):
* lisp/org-clock.el (org-x11idle-exists-p): Do not use last
  `call-process-shell-command' arg.

* lisp/org-mouse.el (org-mouse-show-context-menu): Ignore
  `redisplay-dont-pause'.

* lisp/org.el (org-icompleting-read): Fix typo.  Small refactoring.
2015-04-22 09:51:52 +02:00
Nicolas Goaziou d4785381ec Change "\..." entities into "\_ "
* lisp/org-element.el (org-element--set-regexps):
(org-element-entity-parser): Update regexps.

* lisp/org-entities.el (org-entities): Modify syntax for space
  entities.

* lisp/org.el (org-fontify-entities): Update comment.

* lisp/org-clock.el (org-clocktable-indent-string): Apply syntax
  change.

* etc/ORG-NEWS (title): Update announce.

Use a less verbose syntax, which cannot interfere with file paths.
2015-03-22 21:45:00 +01:00
Nicolas Goaziou bcaf550826 org-clock: Use new entities for clock table
* lisp/org-clock.el (org-clocktable-indent-string): Use new entities.
  Update docstring.

Fixes: bug#18870
2015-03-22 09:55:52 +01:00
Nicolas Goaziou 18685d9852 org-clock: Fix ignored integer values for `org-clock-into-drawer'
* lisp/org-clock.el (org-clock-into-drawer): Fix ignored integer
  values.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/95504>
2015-02-28 00:43:37 +01:00
Nicolas Goaziou a752684bf0 org-clock: Fix `org-clock-in-last' with universal argument
* lisp/org-clock.el (org-clock-in-last): `org-clock-in' expects an
  universal argument, not the return value of `org-clock-select-task'.

Reported-by: Peter Münster <pmlists@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94331>
2015-01-31 12:46:50 +01:00
Marco Wahl e0879b03d0 Merge branch 'maint' 2015-01-12 13:02:20 +01:00
Marco Wahl ca21b7b86d org*.el: Fix call to calendar API
* lisp/org-clock.el: Replace occurances of
'calendar-absolute-from-iso' with 'calendar-iso-to-absolute'.

* lisp/org-agenda.el: Same as above.

* lisp/org.el: Same as above.

Some (long marked obsolete) calendar entities have been dropped from
Emacs recently.  One of those is 'calendar-absolute-from-iso'.
2015-01-12 12:35:10 +01:00
Nicolas Goaziou e990bedc51 Change default value for `org-clock-into-drawer'
* lisp/org-clock.el (org-clock-into-drawer): Update docstring.  Change
  default value.
(org-clock-jump-to-current-clock): Properly find current clock drawer,
if any.
(org-clock-find-position): Tiny fix.
(org-clock-out): Properly check if clock and log drawers are the same.
(org-clock-find-position, org-clock-out,
(org-clock-remove-empty-clock-drawer): Use new function.
2014-12-14 18:22:31 +01:00
Nicolas Goaziou 83249b668e org-clock: Fix clocking when `org-clock-into-drawer' is a number
* lisp/org-clock.el (org-clock-find-position): Check if
  `org-clock-into-drawer' is a number when inserting the first clock.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/93128>
2014-12-03 15:24:40 +01:00
Nicolas Goaziou 52b63aed04 org-clock: Insert clocks after meta data
* lisp/org-clock.el (org-clock-find-position): Make sure clocks, and
  possibly drawer containing them, are inserted after planning info
  and any property drawer.
2014-10-28 14:23:51 +01:00
Bastien Guerry eb973f90a9 org-clock.el (org-clock-select-task): Kill temporary buffer
* org-clock.el (org-clock-select-task): Kill temporary buffer.

Thanks to Marcin Borkowski for this idea.
2014-10-20 15:27:46 +02:00
Kyle Meyer 70e0b08e66 org-clock: Fix CLOCK_INTO_DRAWER property check
* lisp/org-clock.el (org-clock-into-drawer): Fix processing of
properties so that they can override global value.

Previously, if the 'CLOCK_INTO_DRAWER' or 'LOG_INTO_DRAWER' property was
nil, the local property setting would not override the global
variable [1]. These changes make the behavior match the docstring
description ('CLOCK_INTO_DRAWER' and 'LOG_INTO_DRAWER' properties
override `org-clock-into-drawer', with 'CLOCK_INTO_DRAWER' given
precedence).

[1] http://stackoverflow.com/questions/26405415/how-to-locally-unset-org-clock-into-drawer-t

TINYCHANGE
2014-10-17 00:09:32 +02:00
Konubinix ef5ec3d536 Use `org-clock-string' whenever possible
* lisp/org-clock.el (org-find-open-clocks):
* lisp/org.el (org-clone-subtree-with-time-shift,
 org-insert-property-drawer, org-at-clock-log-p): Use
 `org-clock-string' whenever possible instead of hardcoded "CLOCK".
(org-clock-line-re): New variable.
2014-08-27 10:10:24 +02:00
Bastien Guerry 63160e9aab org-clock.el: Various improvements
* org-clock.el (org-clock-display-default-range): New option.
(org-clock-display): Use the new option.
(org-clock-sum-custom): New parameters `range' and `propname'.
(org-clock-special-range): Allow to enter a special range
through the calendar.
2014-07-28 17:43:15 +02:00
Nicolas Goaziou ced4fa3205 Merge branch 'maint' 2014-07-25 11:05:49 +02:00
Nicolas Goaziou bacfe5b4f7 org-clock: Update syntax for indentation in clock tables
* lisp/org-clock.el (org-clocktable-indent-string): Use "\emsp"
  instead of "\__", which is not supported anymore since Org 8.0.

Thanks to Buddy Butterfly for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88842
2014-07-25 11:02:55 +02:00
Bastien Guerry f36b19eef6 org.el: Send a warning when org-loaddefs.el could not be found
* org.el: Send a warning when org-loaddefs.el could not be
found in the directory where this org.el file is loaded from.

* ox-org.el (org-org-publish-to-org):
* ox-odt.el (org-odt-do-format-code):
* ox-html.el (org-html-fontify-code):
* org.el (org-fontify-like-in-org-mode):
* org-src.el (org-src-font-lock-fontify-block):
* org-clock.el (org-clock-get-clocktable): Use
`font-lock-ensure' instead of `font-lock-fontify-buffer'.

* org.el (org-outline-level, org-copy-subtree)
(org-sort-entries, orgstruct-setup, org-show-context)
(org-create-formula-image-with-dvipng)
(org-create-formula-image-with-imagemagick)
(org-goto-sibling, org-goto-first-child, org-show-entry): Use
`ignore-errors' instead of (condition-case nil ... (error nil)).

People trying to load org.el when org-loaddefs.el is not available
has been a major cause of trouble when installing Org.  The warning
tells them what they need to do.
2014-05-29 22:08:43 +02:00
Bastien Guerry c9ecc225ac org-clock.el (org-clock-display): Allow non-interactive use by making arg optional
* org-clock.el (org-clock-display): Allow non-interactive use
by making arg optional.

Thanks to Noah Slater for pointing this.
2014-05-27 09:45:54 +02:00
Bastien Guerry d978a9e585 org-agenda.el (org-agenda-format-item): Don't add the 'effort and 'effort-minutes text properties
* org-agenda.el (org-agenda-format-item): Don't add the
'effort and 'effort-minutes text properties as they are
already accessible through the 'txt property of agenda lines.

* org-clock.el (org-clock-in): Refresh both the 'effort and
'effort-minutes text properties.

* org-rmail.el (rmail, rmail-file-name): Silent byte-compiler.

* org.el (org-refresh-properties): Allow to set several text
properties by passing an alist to the TPROP argument.
(org-set-effort, org-property-next-allowed-value): Use 'effort
instead of 'org-effort.
(org-agenda-prepare-buffers): Update both 'effort and
'effort-minutes.
(org-mark-jump-unhide): Move up to silent the byte-compiler.
2014-05-23 16:51:55 +02:00
Bastien Guerry b5554077cb org-clock.el: New function `org-clock-sum-custom'
* org-clock.el (org-clock-sum-today): Use `headline-filter'.
Remove interactive form.
(org-clock-display): Change the meaning of prefix argument:
one prefix arg shows today's time; two prefix args show clocks
from a custom range; three prefix args show the total time in
the echo area.
(org-clock-sum-custom): New function.
(org-clock-sum): Remove interactive form.
2014-04-20 15:09:32 +02:00
Bastien Guerry 51c37c5c19 Merge branch 'maint'
Conflicts:
	lisp/org-clock.el
2014-04-18 21:33:52 +02:00
Bastien Guerry 7c5cf02e2f Fix `org-clock-put-overlay' again. 2014-04-18 21:30:12 +02:00
Bastien Guerry d52572d1bc Merge branch 'maint'
Conflicts:
	lisp/org-clock.el
2014-04-18 16:41:29 +02:00
Bastien Guerry bcbc97d902 Fix `org-clock-put-overlay' 2014-04-18 16:35:27 +02:00
Bastien Guerry 13230e3a66 org-clock.el (org-clock-put-overlay): Minor enhancements
* org-clock.el (org-clock-put-overlay): Don't use a line of
dots anymore.  Enhance display of time.

Thanks to Noah Slater for suggesting this.
2014-04-17 13:10:09 +02:00
Bastien Guerry 9448fa263b Merge branch 'maint'
Conflicts:
	lisp/org-clock.el
2014-04-17 11:42:16 +02:00
Bastien Guerry 17fb85b12c org-clock.el (org-clock-put-overlay): Fix display when `org-indent-mode' is on
* org-clock.el (org-clock-put-overlay): Fix display when
`org-indent-mode' is on.

Thanks to Christoph Groth for reporting this.
2014-04-17 11:38:53 +02:00
Bastien Guerry 8f19a42304 Minor enhancements to displaying clocks as overlays
* org-faces.el (org-clock-overlay): Use a gray background and
don't inherit the foreground.

* org-clock.el (org-clock-put-overlay): Don't add the stars.
2014-04-17 10:19:58 +02:00