Hi Leo;

On Wed, 13 Feb 2019 at 17:46, Leo Gaspard <orgm...@leo.gaspard.io> wrote:
> Michaël Cadilhac <mich...@cadilhac.name> writes:
> > This is not possible out of the box; can you say a bit more about how
> > you expect to indicate which tasks are to be always present?
>
> I would be thinking of something like defining a list of key -> link to
> a task (that may be generated with org-id's task ID, [[*foobar]] links
> or whatever) in my `init.el`.

Alright, can you give this patch a spin and see if that's what you want?

Cheers;
M.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 343264f7e..1f0870e62 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -164,6 +164,13 @@ which case all digits and capital letters are used up by the
   :group 'org-clock
   :type 'integer)
 
+(defcustom org-clock-default-tasks nil
+  "List of pairs (KEY . ID) ..."
+  :group 'org-clock
+  :type '(repeat (cons :tag "Key and ID"
+		       (character :tag "Access char")
+		       (string    :tag "Task ID"))))
+
 (defcustom org-clock-goto-may-find-recent-task t
   "Non-nil means `org-clock-goto' can go to recent task if no active clock."
   :group 'org-clock
@@ -622,6 +629,15 @@ there is no recent clock to choose from."
 		       (+ i (- ?A 10))) m))
 	    (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
 	    (push s sel-list)))
+	(let (has-elt m)
+	  (dolist (charid org-clock-default-tasks)
+	    (setq m (org-id-find (cdr charid) 'marker))
+	    (when m
+	      (unless has-elt
+		(setq has-elt t)
+		(insert (org-add-props "Default Tasks\n" nil 'face 'bold)))
+	      (setq s (org-clock-insert-selection-line (car charid) m))
+	      (push s sel-list))))
 	(run-hooks 'org-clock-before-select-task-hook)
 	(goto-char (point-min))
 	;; Set min-height relatively to circumvent a possible but in

Reply via email to