emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-clock-select-task: how does it work?
@ 2015-01-24 13:57 Peter Münster
  2015-01-24 15:08 ` Tory S. Anderson
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Münster @ 2015-01-24 13:57 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

How does this function work please?

When I start this function, I get a *Clock Task Select* buffer with the
line "Recent Tasks" and this prompt in the minibuffer: "Select task for
clocking:". There is no more cursor and whatever I type (TAB for
example), I get "user-error: Invalid task choice". Attached is a
screenshot of my emacs after M-x org-clock-select-task.

I would like to get a list of the most recent clocked tasks (most recent
at first) and then chose one.

TIA for any hints,
-- 
           Peter

[-- Attachment #2: screenshot.jpg --]
[-- Type: image/jpeg, Size: 30281 bytes --]

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 13:57 org-clock-select-task: how does it work? Peter Münster
@ 2015-01-24 15:08 ` Tory S. Anderson
  2015-01-24 15:30   ` Peter Münster
  0 siblings, 1 reply; 11+ messages in thread
From: Tory S. Anderson @ 2015-01-24 15:08 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Peter Münster

Wow; I didn't know about this function and am also intrigued. When I run it I get what looks like a nice list of my recent clocked projects, with numbers to "select" them. When I press a number, though, it seems to finish without doing anything. I hoped maybe it would clock me in without me visiting that buffer, but no such luck. There also seems to be little documentation on this that I can find. 

Peter, on my run Org-mode version 8.2.10, I see just what you are describing: a numbered list with the most recent things at the top. It just doesn't seem to do anything after that. 

- Tory

Peter Münster <pmlists@free.fr> writes:

> Hi,
>
> How does this function work please?
>
> When I start this function, I get a *Clock Task Select* buffer with the
> line "Recent Tasks" and this prompt in the minibuffer: "Select task for
> clocking:". There is no more cursor and whatever I type (TAB for
> example), I get "user-error: Invalid task choice". Attached is a
> screenshot of my emacs after M-x org-clock-select-task.
>
> I would like to get a list of the most recent clocked tasks (most recent
> at first) and then chose one.
>
> TIA for any hints,

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 15:08 ` Tory S. Anderson
@ 2015-01-24 15:30   ` Peter Münster
  2015-01-24 15:42     ` Tory S. Anderson
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Peter Münster @ 2015-01-24 15:30 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Jan 24 2015, Tory S. Anderson wrote:

> Peter, on my run Org-mode version 8.2.10, I see just what you are describing:
> a numbered list with the most recent things at the top.

Ok, 8.2.10 seems to work. My version is git HEAD and my list is empty.


> It just doesn't seem to do anything after that.

Indeed. Please try (org-clock-in (org-clock-select-task)) or
C-u M-x org-clock-in-last (or C-u C-c C-x C-x).


After switching to 8.2.10, I have 3 other problems:

- I get a list with some items, but only very few (only items, where
  I've clocked in in this same emacs session).
- There are duplicates in the list.
- When selecting an item, another one is clocked in.

TIA for any help,
-- 
           Peter

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 15:30   ` Peter Münster
@ 2015-01-24 15:42     ` Tory S. Anderson
  2015-01-24 19:35     ` Peter Münster
  2015-01-24 20:15     ` Peter Münster
  2 siblings, 0 replies; 11+ messages in thread
From: Tory S. Anderson @ 2015-01-24 15:42 UTC (permalink / raw)
  To: Peter Münster; +Cc: emacs-orgmode

Ah; nice potential functionality hiding there. Unfortunately, although it prompts me for a task, it just ends up clocking me in to whatever task is at point in the current buffer (probably the same behavior you are getting with problem #3); the practical result is the same as C-c C-x TAB. Has this ever worked correctly? 

I don't see any duplicates in the list. And I assume you're right with problem #1, but since my sessions usually span days or weeks I don't have any problem with that. 

Peter Münster <pmlists@free.fr> writes:

> On Sat, Jan 24 2015, Tory S. Anderson wrote:
>
>> Peter, on my run Org-mode version 8.2.10, I see just what you are describing:
>> a numbered list with the most recent things at the top.
>
> Ok, 8.2.10 seems to work. My version is git HEAD and my list is empty.
>
>
>> It just doesn't seem to do anything after that.
>
> Indeed. Please try (org-clock-in (org-clock-select-task)) or
> C-u M-x org-clock-in-last (or C-u C-c C-x C-x).
>
>
> After switching to 8.2.10, I have 3 other problems:
>
> - I get a list with some items, but only very few (only items, where
>   I've clocked in in this same emacs session).
> - There are duplicates in the list.
> - When selecting an item, another one is clocked in.
>
> TIA for any help,

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 15:30   ` Peter Münster
  2015-01-24 15:42     ` Tory S. Anderson
@ 2015-01-24 19:35     ` Peter Münster
  2015-01-24 20:15     ` Peter Münster
  2 siblings, 0 replies; 11+ messages in thread
From: Peter Münster @ 2015-01-24 19:35 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Jan 24 2015, Peter Münster wrote:

> My version is git HEAD and my list is empty.

No, it was not HEAD. I did not realise, that my "git pull" failed
because of local changes...  Finally, git HEAD is just like 8.2.10.


> - I get a list with some items, but only very few (only items, where
>   I've clocked in in this same emacs session).
> - There are duplicates in the list.
> - When selecting an item, another one is clocked in.

I cannot reproduce the duplicates, but there are still the 2 other
issues. Should I send a bug report?

-- 
           Peter

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 15:30   ` Peter Münster
  2015-01-24 15:42     ` Tory S. Anderson
  2015-01-24 19:35     ` Peter Münster
@ 2015-01-24 20:15     ` Peter Münster
  2015-01-27 10:00       ` Sebastien Vauban
  2 siblings, 1 reply; 11+ messages in thread
From: Peter Münster @ 2015-01-24 20:15 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Jan 24 2015, Peter Münster wrote:

> - I get a list with some items, but only very few (only items, where
>   I've clocked in in this same emacs session).

Solved:
  (setq org-clock-persist 'history)
  (org-clock-persistence-insinuate)


> - There are duplicates in the list.

Not reproducible.


> - When selecting an item, another one is clocked in.

Ok, with org-clock-in-last the clock of the task at the cursor position
is selected, but org-clock-in ("C-u C-c C-x C-i") works nicely!
Ergo: solved too.


Sorry for the noise...
-- 
           Peter

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

* Re: org-clock-select-task: how does it work?
  2015-01-24 20:15     ` Peter Münster
@ 2015-01-27 10:00       ` Sebastien Vauban
  2015-01-28 11:27         ` Tory S. Anderson
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastien Vauban @ 2015-01-27 10:00 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Peter Münster wrote:
> On Sat, Jan 24 2015, Peter Münster wrote:
>
>> - There are duplicates in the list.
>
> Not reproducible.

I still do have duplicates in my list as well.  It never has been fixed,
but I don't have either a reproducible recipe.

See https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00568.html.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: org-clock-select-task: how does it work?
  2015-01-27 10:00       ` Sebastien Vauban
@ 2015-01-28 11:27         ` Tory S. Anderson
  2015-01-28 12:52           ` Sebastien Vauban
  2015-01-28 13:15           ` Marco Wahl
  0 siblings, 2 replies; 11+ messages in thread
From: Tory S. Anderson @ 2015-01-28 11:27 UTC (permalink / raw)
  To: orgmode list

Now I'm loving this tool but I'm looking for two tweaks that would make a big difference. 

1) I use "work.org" to track my weekly work hours; each week is mostly the same tasks, but new time frames. I need to be able to make sure my "recent clock list" is talking about the item for this week, not the identically named item for a previous week. If I could see the tree-path of the items (in the same way putting the point over an item in agenda shows you the hierarchy) that would be great. 

2) As Peter originally mentioned, I see only five tasks on the list; I have more than that each week. Can this be expanded with some variable? 

Having looked into problem 2 by going to `org-clock-select-task` in 'org-clock.el', I found the following which is mostly beyond my current elisp capabilities: 

	(insert (org-add-props "Recent Tasks\n" nil 'face 'bold))
	(mapc
	 (lambda (m)
	   (when (marker-buffer m)
	     (setq i (1+ i)
		   s (org-clock-insert-selection-line
		      (if (< i 10)
			  (+ i ?0)
			(+ i (- ?A 10))) m))
	     (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
	     (push s sel-list)))
	 och)

While I'd love it if someone could explain to me what the "?" operator means with "?0" and "?A", one thing I get out of this is that a list length of something less than 10 seems hardcoded (right?). What would it take to be able customize this with a variable? 


Sebastien Vauban <sva-news@mygooglest.com> writes:

> Peter Münster wrote:
>> On Sat, Jan 24 2015, Peter Münster wrote:
>>
>>> - There are duplicates in the list.
>>
>> Not reproducible.
>
> I still do have duplicates in my list as well.  It never has been fixed,
> but I don't have either a reproducible recipe.
>
> See https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00568.html.
>
> Best regards,
>   Seb

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

* Re: org-clock-select-task: how does it work?
  2015-01-28 11:27         ` Tory S. Anderson
@ 2015-01-28 12:52           ` Sebastien Vauban
  2015-01-28 13:15           ` Marco Wahl
  1 sibling, 0 replies; 11+ messages in thread
From: Sebastien Vauban @ 2015-01-28 12:52 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Tory S. Anderson wrote:
> Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes:
>> Peter Münster wrote:
>>> On Sat, Jan 24 2015, Peter Münster wrote:
>>>
>>>> - There are duplicates in the list.
>>>
>>> Not reproducible.
>>
>> I still do have duplicates in my list as well.  It never has been fixed,
>> but I don't have either a reproducible recipe.
>>
>> See https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00568.html.
>
> Now I'm loving this tool but I'm looking for two tweaks that would
> make a big difference.
>
> 1) I use "work.org" to track my weekly work hours; each week is mostly
> the same tasks, but new time frames. I need to be able to make sure my
> "recent clock list" is talking about the item for this week, not the
> identically named item for a previous week. If I could see the
> tree-path of the items (in the same way putting the point over an item
> in agenda shows you the hierarchy) that would be great.

Not sure I'd like that, or at least not always / by default. That'd make
tasks become truncated or going on multiple lines in my case.

Dunno what would be the best for all of us.

> 2) As Peter originally mentioned, I see only five tasks on the list;
> I have more than that each week. Can this be expanded with some
> variable?

--8<---------------cut here---------------start------------->8---
    ;; Number of clock tasks to remember in history.
    (setq org-clock-history-length 35)  ; 1 to 9 + A to Z
--8<---------------cut here---------------end--------------->8---

Though, I don't understand why it's never that long -- while it should
grow up to that amount before forgetting about old tasks.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: org-clock-select-task: how does it work?
  2015-01-28 11:27         ` Tory S. Anderson
  2015-01-28 12:52           ` Sebastien Vauban
@ 2015-01-28 13:15           ` Marco Wahl
  2015-01-28 13:26             ` Tory S. Anderson
  1 sibling, 1 reply; 11+ messages in thread
From: Marco Wahl @ 2015-01-28 13:15 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

torys.anderson@gmail.com (Tory S. Anderson) writes:

> 2) As Peter originally mentioned, I see only five tasks on the list; I
> have more than that each week. Can this be expanded with some
> variable?

AFAICS this is variable org-clock-history-length.

> Having looked into problem 2 by going to `org-clock-select-task` in
> 'org-clock.el', I found the following which is mostly beyond my
> current elisp capabilities:
>
> 	(insert (org-add-props "Recent Tasks\n" nil 'face 'bold))
> 	(mapc
> 	 (lambda (m)
> 	   (when (marker-buffer m)
> 	     (setq i (1+ i)
> 		   s (org-clock-insert-selection-line
> 		      (if (< i 10)
> 			  (+ i ?0)
> 			(+ i (- ?A 10))) m))
> 	     (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
> 	     (push s sel-list)))
> 	 och)
>
> While I'd love it if someone could explain to me what the "?" operator
> means with "?0" and "?A", one thing I get out of this is that a list
> length of something less than 10 seems hardcoded (right?). What would
> it take to be able customize this with a variable?

?0 is the integer representing character "0" see (info "(elisp)Basic
Char Syntax").  The above is a possibility to map the numbers 0, 1,...,
9, 10, ... onto the characters '1', '2', ..., 'A', 'B', .... AFAICS.

The letters should come into play when you have more than 9 items in the
clock-history.


HTH,  Marco
-- 
http://www.wahlzone.de
GPG: 0x49010A040A3AE6F2

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

* Re: org-clock-select-task: how does it work?
  2015-01-28 13:15           ` Marco Wahl
@ 2015-01-28 13:26             ` Tory S. Anderson
  0 siblings, 0 replies; 11+ messages in thread
From: Tory S. Anderson @ 2015-01-28 13:26 UTC (permalink / raw)
  To: Marco Wahl; +Cc: emacs-orgmode

Excellent answers, on both fronts. Thanks! I couldn't spot `org-clock-history-length` in the code. That does the trick!

Thanks for the answer about the "?A". It's devilishly hard to Google that kind of thing... time to RTM. 

Marco Wahl <marcowahlsoft@gmail.com> writes:

> Hi!
>
> torys.anderson@gmail.com (Tory S. Anderson) writes:
>
>> 2) As Peter originally mentioned, I see only five tasks on the list; I
>> have more than that each week. Can this be expanded with some
>> variable?
>
> AFAICS this is variable org-clock-history-length.
>
>> Having looked into problem 2 by going to `org-clock-select-task` in
>> 'org-clock.el', I found the following which is mostly beyond my
>> current elisp capabilities:
>>
>> 	(insert (org-add-props "Recent Tasks\n" nil 'face 'bold))
>> 	(mapc
>> 	 (lambda (m)
>> 	   (when (marker-buffer m)
>> 	     (setq i (1+ i)
>> 		   s (org-clock-insert-selection-line
>> 		      (if (< i 10)
>> 			  (+ i ?0)
>> 			(+ i (- ?A 10))) m))
>> 	     (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
>> 	     (push s sel-list)))
>> 	 och)
>>
>> While I'd love it if someone could explain to me what the "?" operator
>> means with "?0" and "?A", one thing I get out of this is that a list
>> length of something less than 10 seems hardcoded (right?). What would
>> it take to be able customize this with a variable?
>
> ?0 is the integer representing character "0" see (info "(elisp)Basic
> Char Syntax").  The above is a possibility to map the numbers 0, 1,...,
> 9, 10, ... onto the characters '1', '2', ..., 'A', 'B', .... AFAICS.
>
> The letters should come into play when you have more than 9 items in the
> clock-history.
>
>
> HTH,  Marco

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

end of thread, other threads:[~2015-01-28 13:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-24 13:57 org-clock-select-task: how does it work? Peter Münster
2015-01-24 15:08 ` Tory S. Anderson
2015-01-24 15:30   ` Peter Münster
2015-01-24 15:42     ` Tory S. Anderson
2015-01-24 19:35     ` Peter Münster
2015-01-24 20:15     ` Peter Münster
2015-01-27 10:00       ` Sebastien Vauban
2015-01-28 11:27         ` Tory S. Anderson
2015-01-28 12:52           ` Sebastien Vauban
2015-01-28 13:15           ` Marco Wahl
2015-01-28 13:26             ` Tory S. Anderson

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).