emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Clock history as autocomplete?
@ 2015-04-03  8:42 Marcin Borkowski
  2015-04-03 10:36 ` Mike McLean
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2015-04-03  8:42 UTC (permalink / raw)
  To: Org-Mode mailing list

Hi there,

I use C-u C-c C-x C-i (selecting clocking task from the history) /all
the time/.  However, I would very much prefer entering the clocking task
with autocompletion, from a longer history, or even all headings that
already have a clock (I have (setq org-clock-history-length 20) in my
init.el, and sometimes it's not enough...).  Is that possible?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Clock history as autocomplete?
  2015-04-03  8:42 Clock history as autocomplete? Marcin Borkowski
@ 2015-04-03 10:36 ` Mike McLean
  2015-04-03 14:02   ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Mike McLean @ 2015-04-03 10:36 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

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

I get the general effect using Emacs Helm with some additional commands as
part of the helm definitions. My original idea was from Sacha Chua (
http://sachachua.com/blog/2015/03/getting-helm-org-refile-clock-create-tasks/
) but I didn't implement her stuff as written (in part I didn't
conceptually merge capture/create with goto/refile/clock as she did). I
went for simpler. I can call my mlm/helm-org-agenda-files-headings
with (kbd "C-x c o"), use Helm completion to find the right headline, and
then Goto, Refile current heading to, Clock In, Clock In and Goto, or
Insert Link


#+begin_src emacs-lisp :tangle "package-init/init-helm.el" :comments both
(defun my/helm-org-clock-in (marker)
  (save-window-excursion
    (helm-org-goto-marker marker)
    (if (derived-mode-p 'org-agenda-mode) (org-agenda-clock-in)
(org-clock-in))
    t))

(defun my/helm-org-clock-in-and-goto (marker)
  (helm-org-goto-marker marker)
  (if (derived-mode-p 'org-agenda-mode) (org-agenda-clock-in)
(org-clock-in)))

(cl-defun mlm/helm-source-org-headings-for-files (filenames
                                                  &optional (min-depth 1)
(max-depth 8))
  (helm-build-sync-source "Org Headings"
    :candidates (helm-org-get-candidates filenames min-depth max-depth)
    :persistent-help "Go to line (keeping session); <f1> Go to line; <f2>
Refile to this heading; <f3> Clock In; <f4> Clock in and Goto; <f5> Insert
link to this heading"
    :action '(("Go to line" . helm-org-goto-marker)
              ("Refile to this heading" . helm-org-heading-refile)
              ("Clock in" . my/helm-org-clock-in)
              ("Clock in and Go to" . my/helm-org-clock-in-and-goto)
              ("Insert link to this heading" .
helm-org-insert-link-to-heading-at-marker))))


(defun mlm/helm-org-agenda-files-headings ()
  (interactive)
  (helm :sources (mlm/helm-source-org-headings-for-files (org-agenda-files))
        :candidate-number-limit 99999
        :buffer "*helm org headings*"))

(global-set-key (kbd "C-x c o") 'mlm/helm-org-agenda-files-headings)
#+end_src


On Fri, Apr 3, 2015 at 4:42 AM, Marcin Borkowski <mbork@wmi.amu.edu.pl>
wrote:

> Hi there,
>
> I use C-u C-c C-x C-i (selecting clocking task from the history) /all
> the time/.  However, I would very much prefer entering the clocking task
> with autocompletion, from a longer history, or even all headings that
> already have a clock (I have (setq org-clock-history-length 20) in my
> init.el, and sometimes it's not enough...).  Is that possible?
>
> Best,
>
> --
> Marcin Borkowski
> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
> Faculty of Mathematics and Computer Science
> Adam Mickiewicz University
>
>

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

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

* Re: Clock history as autocomplete?
  2015-04-03 10:36 ` Mike McLean
@ 2015-04-03 14:02   ` Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-04-03 14:02 UTC (permalink / raw)
  To: Org-Mode mailing list


On 2015-04-03, at 12:36, Mike McLean <mike.mclean@pobox.com> wrote:

> I get the general effect using Emacs Helm with some additional commands as
> part of the helm definitions. My original idea was from Sacha Chua (
> http://sachachua.com/blog/2015/03/getting-helm-org-refile-clock-create-tasks/
> [...]

Thanks a lot!  I'll look into your code soon (I don't use Helm, I used
to use Ido, but now I moved to Icicles - but I guess adapting this to
Icicles will be relatively easy).

Best, and Happy Easter to everyone!

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

end of thread, other threads:[~2015-04-03 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03  8:42 Clock history as autocomplete? Marcin Borkowski
2015-04-03 10:36 ` Mike McLean
2015-04-03 14:02   ` Marcin Borkowski

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