I have the following (sub)tree in an org file
* Project
** SubProject
*** TODO Do this action 1
*** TODO Do this action 2
I want my agenda to only show the entries with a TODO keyword. Currently the agenda gives me
Project
SubProject
TODO Do this action 1
TODO Do this action 2
I want it to show only
TODO Do this action 1
TODO Do this action 2
Currently I use org-agenda-skip-function-global to skip DONE and CANCELLED actions
(setq org-agenda-skip-function-global
'(org-agenda-skip-entry-if 'todo '("DONE" "CANCELLED")))
Is there a way to tell this to also skip actions with no TODO state? I've tried adding nil or "" but that doesn't work? If not, is there any other way to do this?
You can use the condition nottodo for an inverted match and use:
(org-agenda-skip-entry-if 'nottodo '("TODO"))
Use C-h f org-agenda-skip-if RET to see the full documentation.
Related
Current org file
* TODO test
** TODO test 1
** TODO test 2
** DONE test 3
* DONE test 4
** DONE test 5
The expected output to current file
* TODO test
** TODO test 1
** TODO test 2
** DONE test 3
Archive file
* DONE test 4
** DONE test 5
I used the agenda mode way to archive, ie C-c a t N r (mark items) B $
but that moved the item ** DONE test 3 as well.
I found an alternative technique to achieve similar results.
C-^ O // order by todo order
C-c $ // archive
C-x z // repeat previous command
z // repeat
z
z
In Org-mode a task can have one of several process states (e.g. TODO, DONE...). The process state list is configurable and the user may either set a task state directly, or they may cycle over all states using the S-Left and S-Right key combinations.
What I find counter-intuitive, however, is the interaction between state change tracking and the use of the S-Left and S-Right keys. More specifically, when using those keys one may go over several states before settling on the one they need, especially if they type too fast and skip a desired state. Unfortunately, Org-mode will happily log every single one of those state changes, despite the fact that they happened within a few seconds and cannot correspond to what happened with an actual real-life task.
Is there a way to have Org-mode filter the generated log entries, so that those intermediate state changes are not inadvertently logged? E.g. a setting that would merge state changes when they happen in less than X seconds?
To select a TODO state and bypass any logging associated with that, use:
(setq org-treat-S-cursor-todo-selection-as-state-change nil)
in your Emacs configuration file.
Call org-todo with a prefix argument using C-u followed by a number. This avoids the extra window.
From M-x describe-function RET org-todo RET:
With C-u prefix arg, use completion to determine the new state. With
numeric prefix arg, switch to that state. With a double C-u prefix,
switch to the next set of TODO keywords (nextset). With a triple C-u
prefix, circumvent any state blocking. With a numeric prefix arg of 0,
inhibit note taking for the change.
So, using the example from the manual you linked, let's say you had the following workflow states defined:
(setq org-todo-keywords
'((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
And you had the following in an org file:
* TODO Go Grocery Shopping
You could go immediate from TODO to DONE by typing C-u 4 C-c C-t. The result should look something like:
* DONE Go Grocery Shopping
:LOGBOOK:
- State "DONE" from "TODO" [2014-10-30 Thu 09:20]
:END:
Assuming you have the following in your init.el / .emacs file (which I highly recommend):
(setq org-log-into-drawer t)
Keep in mind if you have multiple workflow states defined (e.g. one for tasks, one for events, etc.), the prefix number goes in order of the keywords. Org-mode doesn't distinguish between different workflow sequences.
I use Emacs org-mode to organise my todo list. Recently I found under each todo item it automatically generates a property drawer containing a key ID and the corresponding value, something like this:
** TODO meeting XXX
SCHEDULED: <2014-07-12 Sat 14:00>
:PROPERTIES:
:ID: 46673B08-F9D9-4966-B70A-A2ADBC2ADE0E
:END:
Entered on [2014-07-08 Tue 20:40]
I have no idea how this property drawer is generated, and I did not have it before. If delete it, next time I start Emacs to read the file, it will come back again. What would I do?
Would you have used MobileOrg? If yes, that's the culprit (and that clutter is something more that keeps me away from using MobileOrg ATM).
Posting your configuration file would definitely help diagnose what's causing this. For some, this is the desired behavior of the org-id package, which is explained in Handling Links in the Org-mode Manual:
The library org-id.el must first be loaded, either through org-customize by enabling org-id in org-modules, or by adding (require 'org-id) in your .emacs.
An init.el / .emacs file that enables this functionality, might for example, include the following:
;; Use global IDs
(require 'org-id)
(setq org-id-link-to-org-use-id t)
;; Update ID file .org-id-locations on startup
(org-id-update-id-locations)
Additionally, you could check your .emacs.d directory to see if there is a .org-id-locations file, which is generated by the org-id package.
To disable this behavior, you should remove all org-id package related code from your configuration files.
It's likely that this behavior occurs every time you use (org-store-link), commonly bound to C-l l. You might also want to check out Assign IDs to every entry in Org-mode
My list looks like this:
* TODAY
** TODO Item 1
** TODO Item 2
* TOMORROW
** TODO Item 3
** TODO Item 4
...as a single list, based on some advice I received here.
I'd like to move TODO Item 2 from under TODAY to under TOMORROW.
The manual says:
M-up
M-down
Move the item including subitems up/down (swap with previous/next item of same indentation). If the list is ordered, renumbering is automatic.
But while I can change the places of Item 1 and Item 2, I cannot move Item 2 outside of the Today heading---I cannot move it down under TOMORROW to precede Item 3. The buffer tells me:
cannot move past superior level or buffer limit org mode
What is the keystroke that lets me move sub-items "past superior level" to under new headings?
You could use C-c C-w (org-refile) and specify the heading where you want to send your TODO item.
As you'll see in this function's documentation (C-h forg-refile), you can customize the org-refile-targets and org-reverse-note-order variables to determine the list of possible target headings and the position of the moved item within the target heading.
Here are 2 options:
Promote Item 2 to the top level with M-left, then move it down below "TOMORROW" with M-down, and finally demote it under "TOMORROW" with M-right.
Cut the "Item 2" subtree with org-cut-special (C-c C-x C-w), then paste it under "TOMORROW" using org-paste-special (C-c C-x C-y).
the simplest way, Just use M-shift-up or M-shift-down you can move item past superior level.
I have to do this a lot when making beamer presentations. The simplest way for me is to just fold then item as you have in your example list and essentially kill and yank the region. That is, go to the beginning of the ** TODO Item 2 line, set the mark (C-[SPACE]), move the point to the beginning of the next line (C-n), kill the region (C-w), move the point to where you want under the * Tomorrow heading, and yank it back (C-y). It is important to get the region rather than just the line (with C-k) so that you get all the bits that are folded.
Similar to sanityinc's above, the solution I've adopted is to...
Move cursor to *TOMORROW
Demote it to ** with M-right
Move cursor up to TODO item 2
Pull it down beneath **TOMORROW with M-down
Return cursor to **TOMORROW and re-promote it with M-left
Constructing a macro for this would probably be better, but it's intuitive and not as bad as it looks. Still, it would be more convenient if C-M-down or something did this.
Bit late to the party, but to expand Mittenchops answers I created the following macro.
(defun org-move-subtree-to-next-superior()
"Moving subtree to next superior."
(interactive)
(org-promote-subtree)
(org-move-subtree-down)
(org-demote-subtree))
(global-set-key (kbd "C-c C-x t") 'org-move-subtree-to-next-superior)
I would like to create a custom agenda in org mode that will show me all the TODO items with a particular tag that are either overdue or due today.
However, I can't find any search function that will allow me to combine the two. Am I missing something, or am I trying to use the tool incorrectly?
You can use org-agenda-filter-apply. In addition, I found it useful to hide tags in the agenda for current day or week. As the result you have something like that.
(setq org-agenda-custom-commands
`(("o" "tasks with tag1"
((org-agenda-list)
(org-agenda-filter-apply ,(list "+tag1")))
((org-agenda-remove-tags t)))
("d" "tasks with tag2"
((org-agenda-list)
(org-agenda-filter-apply ,(list "+tag2")))
((org-agenda-remove-tags t)))
))
You show tasks with tag1 using Ctrl-a-o and tasks with tag2 using Ctrl-a-d
The org-agenda-list is meant to do this. You can invoke it with C-c a a. It displays the agenda for the week, which includes all tasks that are due in the week or are overdue. You can narrow it down to see all tasks scheduled today, due today and all tasks overdue by pressing d Further, if you only wish to see tasks with a particular tag, you can do so by pressing / and choosing the tag you want to see.
This way you'll get what you want.