2

I'd like to show an additional property (e.g. EFFORT) on the same line as my tasks, so that it is always visible in both org-mode and agenda view. An example is below.

Current display:
TODO [#A] Description of my task <2019-11-18> :tag1:
:PROPERTIES:
:Effort: 15
:END:

I'd like something like this:
TODO [#A] [15] Description of my task <2019-11-18> :tag1:

Is this possible, preferably not using column view? Thanks.

2 Answers 2

3

I don't know how to get it in to both normal view and the agenda view. But, in case it's helpful, one simple way to get effort into headlines in to the agenda view at least, is to edit org-agenda-prefix-format.

(Also with this, you are restricted as to where exactly you can place the effort indicator. The prefix is everything before the headline itself, so you can't put the effort after TODO for example).


That said, here is how I do it:

M-x customize-variable
Customize variable: org-agenda-prefix-format

Look specifically for the agenda value. The default value of this is:

%i %-12:c%?-12t% s

I have changed it to:

%i %-12:c%?-12t [%-4e] % s

It's the [%-4e] that adds in the effort indicator.

So,

GTD:        Sched. 7x:  TODO [#A] Do the thing

becomes

GTD:        [0:15] Sched. 7x:  TODO [#A] Do the thing

See describe-variable (C-hv) for org-agenda-prefix-format for more details on formatting options.

2
  • Thank you this works sufficiently for me, with changing 'customize-variable' to 'describe-variable'. While it doesn't display the effort in normal view, I can use follow mode to quickly find a task from my agenda view to edit the effort.
    – Nidstang
    Nov 20, 2019 at 1:21
  • You can also set the effort from the agenda view with (org-agenda-set-effort) - C-c C-x e.
    – ngm
    Nov 20, 2019 at 20:49
1

In normal/org mode you could use overlays, although I was told Org does similar things which might get in the way (see here). For now @ngm's answer is probably your best option, but in case it helps, here's one way to solve the first part of your question:

(add-hook 'org-mode-hook
          (lambda ()
            (org-map-entries
             (lambda ()
               (let (match-end)
                 (when (looking-at org-complex-heading-regexp)
                   (setq match-end (or (match-end 3)
                                       (match-end 2)
                                       (match-end 1)))
                   (let ((ov (make-overlay match-end (1+ match-end))))
                     (overlay-put ov
                                  'display
                                  (when-let (ef (org-entry-get nil "Effort"))
                                    (org-add-props
                                        (concat " [" ef "] ") nil
                                      'face 'bold))))))))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.