emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* specify time of day for org-resolve-clocks, not number of minutes
@ 2020-01-03 15:05 Dan Drake
  2020-01-07  8:17 ` Nicolas Goaziou
  2020-02-13  0:31 ` Bastien
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Drake @ 2020-01-03 15:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]

Hello,

I posted a question on emacs.stackexchange:
https://emacs.stackexchange.com/questions/54445/specify-time-of-day-for-org-resolve-clocks-not-number-of-minutes

...about using a time of day when using org-resolve clocks, but didn't get
an answer. Here's my question; perhaps this more targeted group can help:

I can use org-resolve-clocks if I've been away from a task but kept the
clock for the task running -- but when I do that and select K ("keeps
however many minutes you request and then immediately clock out of that
task."), I have to specify a number of *minutes*.

Instead, I want to specify a *time*, since usually that's what I remember
("my coworker stopped to ask a question at 10:45"). I'd like a way to get
the K functionality, but instead of doing the math to figure out a number
of minutes, I want to just type in a time of day.

Is there a way to do this already? Or would this require a new clock
resolution command -- perhaps "t", for "time": it would effectively just be
a wrapper around "k" that parses the provided time, looks at the current
clocked-in task, computes the appropriate number of minutes, and then just
does whatever "k" (or "K") does.

Thanks!

-- 
Ceci n'est pas une .signature.

[-- Attachment #2: Type: text/html, Size: 1674 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-01-03 15:05 specify time of day for org-resolve-clocks, not number of minutes Dan Drake
@ 2020-01-07  8:17 ` Nicolas Goaziou
  2020-02-13  0:31 ` Bastien
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2020-01-07  8:17 UTC (permalink / raw)
  To: Dan Drake; +Cc: emacs-orgmode

Hello,

Dan Drake <dan.drake@gmail.com> writes:

> Instead, I want to specify a *time*, since usually that's what I remember
> ("my coworker stopped to ask a question at 10:45"). I'd like a way to get
> the K functionality, but instead of doing the math to figure out a number
> of minutes, I want to just type in a time of day.
>
> Is there a way to do this already?

I don't think so.

> Or would this require a new clock resolution command -- perhaps "t",
> for "time": it would effectively just be a wrapper around "k" that
> parses the provided time, looks at the current clocked-in task,
> computes the appropriate number of minutes, and then just does
> whatever "k" (or "K") does.

This is a good idea. It might be useful to provide a date somehow, e.g.,
if you want to rewind to yesterday at 11:00pm. I'm not sure what a good
interface would be, though. `org-read-date' is pretty much future
oriented.

WDYT?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-01-03 15:05 specify time of day for org-resolve-clocks, not number of minutes Dan Drake
  2020-01-07  8:17 ` Nicolas Goaziou
@ 2020-02-13  0:31 ` Bastien
  2020-02-13  1:40   ` Kyle Meyer
  1 sibling, 1 reply; 7+ messages in thread
From: Bastien @ 2020-02-13  0:31 UTC (permalink / raw)
  To: Dan Drake; +Cc: emacs-orgmode

Hi Dan,

Dan Drake <dan.drake@gmail.com> writes:

> I posted a question on emacs.stackexchange: https://
> emacs.stackexchange.com/questions/54445/
> specify-time-of-day-for-org-resolve-clocks-not-number-of-minutes

good idea -- please test from latest master branch, you can now use
`t' and `T' as you suggested.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-02-13  0:31 ` Bastien
@ 2020-02-13  1:40   ` Kyle Meyer
  2020-02-13  7:16     ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Kyle Meyer @ 2020-02-13  1:40 UTC (permalink / raw)
  To: Bastien, Dan Drake; +Cc: emacs-orgmode

Hi Bastien,

Bastien <bzg@gnu.org> writes:

> good idea -- please test from latest master branch, you can now use
> `t' and `T' as you suggested.

Thanks, though sadly Dan had already taken the time to follow up with a
patch:

  https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00175.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-02-13  1:40   ` Kyle Meyer
@ 2020-02-13  7:16     ` Bastien
  2020-02-13 14:02       ` Dan Drake
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2020-02-13  7:16 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Dan Drake, emacs-orgmode

Hi Kyle and Dan,

Kyle Meyer <kyle@kyleam.com> writes:

> Thanks, though sadly Dan had already taken the time to follow up with a
> patch:
>
>   https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00175.html

Err, my bad, sorry Dan -- and thanks Kyle for the warning.

(I too hastily assume 1 thread = 1 topic, I should have checked.)

I reverted my changes and pushed Dan's commit to master.

I took the liberty of inlining the function and making the message a
bit more explicit.  Dan, let me know if that's okay.

Interestingly, our (different and complementary) implementations may
lead to a new idea: your implementation is like the `k' option while
mine is like the `g' option (when you "got back").  I guess both can
make sense, and what the user expect is to be able to enter a number
of minutes *or* a HH:MM time spec in both `t' and `g'.

That would also have the advantage of having less options while still
having the possibility to use HH:MM.  (Also, using org-read-date here
seems a bit too much here, but maybe that's okay.)

Dan, what do you think?  Would you like to try implementing this or
can I give it a try?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-02-13  7:16     ` Bastien
@ 2020-02-13 14:02       ` Dan Drake
  2020-02-13 14:53         ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Drake @ 2020-02-13 14:02 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

I like the idea of using g/G and intelligently interpreting the user's
response -- it's good UI / UX design. (Imagine asking a friend when they
"got back" -- both "20 minutes ago" and "8:35" are unambiguous answers to
the question.)

Now we need to decide how to distinguish the two. Would it work to just
examine the user input for a colon and branch based on that? I'll see if I
can get this working.

On Thu, Feb 13, 2020 at 1:16 AM Bastien <bzg@gnu.org> wrote:

> Hi Kyle and Dan,
>
> Kyle Meyer <kyle@kyleam.com> writes:
>
> > Thanks, though sadly Dan had already taken the time to follow up with a
> > patch:
> >
> >   https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00175.html
>
> Err, my bad, sorry Dan -- and thanks Kyle for the warning.
>
> (I too hastily assume 1 thread = 1 topic, I should have checked.)
>
> I reverted my changes and pushed Dan's commit to master.
>
> I took the liberty of inlining the function and making the message a
> bit more explicit.  Dan, let me know if that's okay.
>
> Interestingly, our (different and complementary) implementations may
> lead to a new idea: your implementation is like the `k' option while
> mine is like the `g' option (when you "got back").  I guess both can
> make sense, and what the user expect is to be able to enter a number
> of minutes *or* a HH:MM time spec in both `t' and `g'.
>
> That would also have the advantage of having less options while still
> having the possibility to use HH:MM.  (Also, using org-read-date here
> seems a bit too much here, but maybe that's okay.)
>
> Dan, what do you think?  Would you like to try implementing this or
> can I give it a try?
>
> Thanks,
>
> --
>  Bastien
>


-- 
Ceci n'est pas une .signature.

[-- Attachment #2: Type: text/html, Size: 2494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: specify time of day for org-resolve-clocks, not number of minutes
  2020-02-13 14:02       ` Dan Drake
@ 2020-02-13 14:53         ` Bastien
  0 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2020-02-13 14:53 UTC (permalink / raw)
  To: Dan Drake; +Cc: emacs-orgmode

Hi Dan,

Dan Drake <dan.drake@gmail.com> writes:

> I like the idea of using g/G and intelligently interpreting the
> user's response -- it's good UI / UX design. (Imagine asking a friend
> when they "got back" -- both "20 minutes ago" and "8:35" are
> unambiguous answers to the question.)

Yes.

> Now we need to decide how to distinguish the two. Would it work to
> just examine the user input for a colon and branch based on that?

You can use `read-string' and try to match either a wholenumberp (as
"[0-9]\+") or a time spec (as "[0-9]\+:[0-9]\\{2\\}").

I don't think we need to trigger the calendar: relying on (concat
(format-time-string "%F " last-valid) time) is good enough.

No need to support am/pm notation either, as long as we advertize the
need to enter HH:MM time.

We shall support this for both k/K ("keep") and g/K ("got back"),
don't you think so?

> I'll see if I can get this working.

Thanks a lot!  Since this is a new feature, I'd like to polish it
before Org 9.4 (which I initially planned for tomorrow, but I will
adapt.)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-13 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03 15:05 specify time of day for org-resolve-clocks, not number of minutes Dan Drake
2020-01-07  8:17 ` Nicolas Goaziou
2020-02-13  0:31 ` Bastien
2020-02-13  1:40   ` Kyle Meyer
2020-02-13  7:16     ` Bastien
2020-02-13 14:02       ` Dan Drake
2020-02-13 14:53         ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).