all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* FR: more flexible customization of org-agenda-custom-commands key bindings
@ 2007-10-16 16:20 Adam Spiers
  2007-10-16 16:36 ` Adam Spiers
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Adam Spiers @ 2007-10-16 16:20 UTC (permalink / raw)
  To: org-mode mailing list

First, apologies for the constant "gimme" nature of my recent
feature-request posts!

org-agenda-custom-commands is awesome in its power.  There are one or
two respects in which I think it could be improved, however.

I make extensive use of the functionality added relatively recently
which enables you to select a tag or TODO keyword with a single
keystroke.  I would now like to build a load of corresponding custom
agenda commands which search for the tag or keyword created with the
same keystroke.  So for example, if I marked a TODO with the :sub60:
tag via C-c C-c 6 <RET> to indicate that I think the task will take
less than 60 minutes to complete, I would also like to be able to
press C-c C-a 6 to search all agenda files for that tag.

This poses no problems in this and most cases.  However, I would like
to have a quick binding for listing priorities:

  C-c C-a A  - to list anything marked [#A]
  C-c C-a B  - to list anything marked [#B]
  C-c C-a C  - to list anything marked [#C]

I copied the elisp using org-agenda-skip-entry-if from John's great
day planner page[1] to achieve these, and it works great.  But it
overwrites the default binding of C-c C-a C which is a handy shortcut
for customizing org-agenda-custom-commands.  So I would like to be
able to move that to another key.  I noticed there is an option to
make a custom agenda command call "Other, user-defined function", but
the relevant bit of org-agenda seems to be:

            ((fboundp type)
                      (org-let lprops '(funcall type match)))

which doesn't allow lambda functions.  If I define my own function: 

  (defun as-test (match)
    (interactive)
    (customize-group 'org-agenda-custom-commands))

and refer to that, it works, but it would be nice if lambdas worked.

Similarly, I would like to bind C-c C-a 1 to search for tasks which
can be done in under 10 minutes (`:sub10:'), and C-c C-a 0 for
something else, but they are hard-bound to limiting the scope of an
imminent search.

It seems to me there are two possible approaches to solve these
binding conflicts.  One would be to move the currently hard-coded
bindings all into org-agenda-custom-commands as default values.  This
would require extending what a custom command can do in some cases, as
witnessed with the lambda issue above.

Another approach, and this is my personal preference, would be to
allow "sub-keymaps", so that e.g. I could press C-c C-a s and it would
present me with a further menu of single keystrokes bound to custom
agenda commands:

   C-c C-a s 1    search for :sub10:  (10 minute tasks)
   C-c C-a s 2    search for :sub120: (2 hour tasks)
   C-c C-a s 3    search for :sub30:  (30 minute tasks)
   C-c C-a s 4    search for :sub40:  (4 hour tasks)

etc.

Not only would this approach make it easier to avoid binding conflicts
with hard-coded bindings, but it also has the advantage of providing
distinct keymaps for different types of searches, e.g. one keymap
could be for searching by GTD context, another by task A/B/C priority,
another by TODO keyword, and so on.

Thoughts?


[1] http://www.newartisans.com/blog_files/org.mode.day.planner.php

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

end of thread, other threads:[~2007-10-30 17:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 16:20 FR: more flexible customization of org-agenda-custom-commands key bindings Adam Spiers
2007-10-16 16:36 ` Adam Spiers
2007-10-18  5:35   ` Carsten Dominik
2007-10-18  9:59     ` Bastien
2007-10-27 13:40       ` Adam Spiers
2007-10-28 14:42         ` Bastien
2007-10-30  6:06           ` Carsten Dominik
2007-10-30  8:53             ` Adam Spiers
2007-10-30 18:18             ` Bastien
2007-10-16 17:38 ` Bastien
2007-10-17 13:03 ` Bastien
2007-10-17 14:04   ` Adam Spiers
2007-10-17 22:06 ` Carsten Dominik

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.