From mboxrd@z Thu Jan 1 00:00:00 1970 From: Friedrich Delgado Friedrichs Subject: Supporting non-stuck projects view with minimal effort Date: Tue, 22 Dec 2009 18:58:03 +0100 Message-ID: <20091222175803.GA22580@taupan.ath.cx> Reply-To: friedel@nomaden.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2073830105==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NN8zu-0005p5-F6 for emacs-orgmode@gnu.org; Tue, 22 Dec 2009 12:58:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NN8zp-0005n9-E5 for emacs-orgmode@gnu.org; Tue, 22 Dec 2009 12:58:13 -0500 Received: from [199.232.76.173] (port=47728 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN8zp-0005mw-AQ for emacs-orgmode@gnu.org; Tue, 22 Dec 2009 12:58:09 -0500 Received: from dudelab.org ([212.12.33.202]:10381 helo=mail.dudelab.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NN8zo-0003KW-NK for emacs-orgmode@gnu.org; Tue, 22 Dec 2009 12:58:09 -0500 Received: from abrasax.taupan.ath.cx (p5DE893C3.dip.t-dialin.net [93.232.147.195]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Friedrich Delgado Friedrichs", Issuer "User CA" (verified OK)) by mail.dudelab.org (Postfix) with ESMTP id 4D77A228149 for ; Tue, 22 Dec 2009 18:58:59 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode mailing list --===============2073830105== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I've been thinking, the view of stuck projects is nice, but I'd need a view of non-stuck projects to complement it. I came up with this ugly mess: (defun fdf/org-agenda-list-unstuck-projects (&rest ignore) "Create agenda view for projects that are NOT stuck. Stuck projects are project that have no next actions. For the definitions of what a project is and how to check if it stuck, customize the variable `org-stuck-projects'. MATCH is being ignored." (interactive) (let* ((org-agenda-overriding-header (or org-agenda-overriding-header "List of unstuck projects: ")) (matcher (nth 0 org-stuck-projects)) (todo (nth 1 org-stuck-projects)) (todo-wds (if (member "*" todo) (progn (org-prepare-agenda-buffers (org-agenda-files nil 'ifmode)) (org-delete-all org-done-keywords-for-agenda (copy-sequence org-todo-keywords-for-agenda))) todo)) (todo-re (concat "^\\*+[ \t]+\\(" (mapconcat 'identity todo-wds "\\|") "\\)\\>")) (tags (nth 2 org-stuck-projects)) (tags-re (if (member "*" tags) (org-re "^\\*+ .*:[[:alnum:]_@]+:[ \t]*$") (if tags (concat "^\\*+ .*:\\(" (mapconcat 'identity tags "\\|") (org-re "\\):[[:alnum:]_@:]*[ \t]*$"))))) (gen-re (nth 3 org-stuck-projects)) (re-list (delq nil (list (if todo todo-re) (if tags tags-re) (and gen-re (stringp gen-re) (string-match "\\S-" gen-re) gen-re)))) (skip-regexp (if re-list (mapconcat 'identity re-list "\\|") (error "No information how to identify unstuck projects")))) (org-tags-view nil matcher) (let ((org-agenda-skip-function (lambda () (org-agenda-skip-if t 'notregexp skip-regexp)))) (with-current-buffer org-agenda-buffer-name (setq org-agenda-redo-command '(org-agenda-list-stuck-projects (or current-prefix-arg org-last-arg))))))) As you will notice, this is blatantly copied and pasted from org-agenda-list-stuck-projects (which is why it's ugly), the only difference is that it doesn't set org-agenda-skip-function but uses org-agenda-skip-if. I think this could be very easily integrated into org-agenda-list-stuck-projects (with an optional parameter 'negate'), but I somehow feel reluctant to patch org-core for some irrational reason. Kind regards Friedel --=20 Friedrich Delgado Friedrichs TauPan on Ircnet and Freenode ;) --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAksxCKMACgkQCTmCEtF2zEDVCgCfTmzRyTYbw2/3sVAb9B7Xt1mA Dl0AniLHvfERka2e21dWnUZ3twzAVg4x =L10L -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V-- --===============2073830105== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2073830105==--