emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] RFC: interactive tag query adjustment


From: Christopher League
Subject: Re: [Orgmode] RFC: interactive tag query adjustment
Date: Sat, 12 Jan 2008 17:45:08 -0500


Hi again, last month I proposed an idea for interactively manipulating the current query in a tags agenda match (C-c a m, org-tags-view). Attached here is a patch against 5.18a that implements this idea. It's pretty slick, if I may be so bold!

In a tags match buffer, the prompt will now say, for example:

Headlines with TAGS match: office
Press `C-u r' to enter new search string; use `/;\=' to adjust interactively

The extra keys are / (and), ; (or), \ (not), = (clear). Any one of them will bring up another window, much like fast tag selection. You can press one key to select the tag or TODO keyword, and that will be added to or removed from the query string accordingly.

So, starting with the query "office", I can hit the keys ";p/N-f" to transform it to "office|phone-focus/NEXT", assuming my tags and TODO keywords are assigned those keys already. Like fast tag selection, it supports single-key (the default), multi-key (waits for RET), and expert (no separate window) modes.

Enjoy.. comments & critiques welcome.
Chris

Attachment: org-interactive-query.patch.txt
Description: Text document





CAVEATS:

1. Carsten, my signed papers are on their way back to FSF; I'll let you know when I have a copy with their signature too.

2. Keys (even auto-assigned ones) can conflict between the tags and todo-keywords; in this case, the todo takes precedence. This is disappointing if you have a key assigned to tag "focus(f)" and meanwhile have a "#+TYP_TODO: Fred" in some buffer. Fred will get assigned the key "f" and make "focus" inaccessible. Same thing happens with fast-tag-selection if include-todo is on, so it's not unique to my patch, and maybe needs a more general solution.

3. The main function `org-agenda-query-selection' started as a copy of `org-fast-tag-selection' and there are possibly some parts that could be reasonably factored out of both and shared. (Mostly the code that lays out the tag names and keys in the buffer.)

4. ...? Let me know if you find anything else strange.


On Dec 8, 2007, at 9:00 AM, Christopher League wrote:
Hi, I've been using org-mode for about a year, and recently updated to the latest release. I was happy to discover the enhanced tag query features ("phone|email/NEXT|SOMEDAY", etc) and started rethinking my configuration a little.

I'd like to have an interface for interactive query adjustment. For example, in a tags match (C-c a m, org-tags-view), I could begin with the query "phone/NEXT" and type the keys "/h" to quickly turn it into "phone+home/NEXT" and then ";s" to get "phone+home/NEXT| SOMEDAY", then "=[" to clear all the tags to "/NEXT|SOMEDAY", and so on. Then, one more keystroke to save the current query into org- agenda-custom-commands would be icing on the cake.

I'm new to the mailing list, so maybe some functionality like this was discussed before. Closest I found was a thread begun by John W in October, wherein "interactive" and "query" were mentioned together a few times... http://thread.gmane.org/gmane.emacs.orgmode/3628 but I don't think it's the same idea.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]