emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Adam Spiers <orgmode@adamspiers.org>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: key bindings for quickly setting effort estimates
Date: Tue, 3 Nov 2009 07:32:58 +0100	[thread overview]
Message-ID: <4A61C92B-7A1F-4C63-B3A8-E5956CB0110B@gmail.com> (raw)
In-Reply-To: <20091102135230.GD25581@atlantic.linksys.moosehall>

We do have `org-set-effort', bound to `C-c C-x e'.  You can use a  
prefix arg
to get to a value directly.  But your approach is faster, if you have  
to do
this a lot.

- Carsten

On Nov 2, 2009, at 2:52 PM, Adam Spiers wrote:

> I found myself needing a quick way of setting effort estimates outside
> column view, and came up with the following:
>
> ;; Zero effort is last (10th) element of global Effort_ALL property
> ;; so that we get zero effort when pressing '0' in the Effort column
> ;; in Column view, since this invokes `org-set-effort' with arg 0,
> ;; which stands for the 10th allowed value.
> (let ((effort-values
>       (org-property-get-allowed-values nil org-effort-property)))
>  (dotimes (effort-index 10)
>    (let* ((effort (nth effort-index effort-values))
>           (key-suffix (number-to-string
>                 (if (= effort-index 9) 0 (1+ effort-index))))
>           (fn-name (concat "org-set-effort-"
>                            (number-to-string effort-index)))
>           (fn (intern fn-name)))
>      ;; (message "Binding M-o %s to %s which sets effort to %s"
>      ;;          key-suffix fn-name effort)
>      (fset fn `(lambda ()
>                  ,(format "Sets effort to %s." effort)
>                  (interactive)
>                  (org-set-effort ,(1+ effort-index))))
>      (global-set-key (concat "\eo" key-suffix) fn))))
>
> This assumes that Effort_ALL has 9 non-zero effort values, which in my
> case is conveniently true:
>
> ("0:10" "0:20" "0:30" "1:00" "2:00" "3:00" "4:00" "8:00" "16:00" "0")
>
> Hope this is of interest.
>
> Adam
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

  reply	other threads:[~2009-11-03  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 13:52 key bindings for quickly setting effort estimates Adam Spiers
2009-11-03  6:32 ` Carsten Dominik [this message]
2009-11-03 12:33   ` Tim O'Callaghan
2009-11-03 16:51     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A61C92B-7A1F-4C63-B3A8-E5956CB0110B@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@adamspiers.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).