Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs Org-Mode: How to find all TODOs that don't have a deadline specified

In Emacs org-mode I know that I can call up the agenda "match" view (using C-a m) and then use the following search string to find all TODO items that have their deadline set to today:

DEADLINE="<today>"

However, I want to find all items in my TODO list that don't have any deadline set at all. I've searched but can't seem to find an answer; the following doesn't seem to work either:

DEADLINE=""

How do I search for all TODOs that don't have a DEADLINE specified?

(The same also applies to finding items that haven't been scheduled, but I'm guessing the solution will be the same.)

like image 644
FixMaker Avatar asked Jun 08 '13 20:06

FixMaker


People also ask

How do you search in Org mode?

Org-mode uses Emacs' multi-occur command to search for any lines in the agenda files containing a regular expression. Simply type C-c a / followed by a word or regular expression and you will be presented a buffer with all lines that match the query, with each line conveniently linked to its original location.

How do I use org Mode in Emacs?

Emacs does not actually understand you are editing an Org document, yet. To enable Org mode on your current document, type M-x org-mode which will enable the Org mode on the current document. Those are minuses, not underscores.

Is org mode built in Emacs?

Emacs has included Org Mode as a major mode by default since 2006. Bastien Guerry is the current maintainer, in cooperation with an active development community. Since its success in Emacs, some other systems now provide functions to work with org files.


2 Answers

You can use

-DEADLINE={.+}

and

-SCHEDULED={.+}

which searches for items that don't have a DEADLINE/SCHEDULED tag with any content in it -- ie, no scheduled or deadline dates are set. The curlies are used to identify a regular expression (that matches anything longer than the empty string in this case).

For example, I use the following:

 (setq org-agenda-custom-commands
       `(;; match those tagged with :inbox:, are not scheduled, are not DONE.
         ("ii" "[i]nbox tagged unscheduled tasks" tags "+inbox-SCHEDULED={.+}/!+TODO|+STARTED|+WAITING")))

Reference: http://orgmode.org/manual/Matching-tags-and-properties.html

like image 119
fgeller Avatar answered Sep 20 '22 15:09

fgeller


Another approach would be to use org-agenda-skip-entry. Where I skip the tasks that are scheduled or with a deadline or timestamp and also those that contain the word/tag "desparche".

("X" "Not scheduled"
     ( (todo "TODO"
             (
              (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline 'timestamp 'regexp "desparche"                                                               ))
              )
             )
       )
     )
like image 36
mfcabrera Avatar answered Sep 22 '22 15:09

mfcabrera