emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/org ChangeLog org-agenda.el org-arch...


From: Carsten Dominik
Subject: [Emacs-diffs] emacs/lisp/org ChangeLog org-agenda.el org-arch...
Date: Wed, 28 Jan 2009 14:32:03 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Carsten Dominik <cdominik>      09/01/28 14:32:03

Modified files:
        lisp/org       : ChangeLog org-agenda.el org-archive.el 
                         org-attach.el org-bbdb.el org-bibtex.el 
                         org-clock.el org-colview.el org-compat.el 
                         org-exp.el org-export-latex.el org-faces.el 
                         org-footnote.el org-gnus.el org-id.el 
                         org-info.el org-irc.el org-jsinfo.el 
                         org-list.el org-mac-message.el org-macs.el 
                         org-mew.el org-mhe.el org-mouse.el org-plot.el 
                         org-publish.el org-remember.el org-rmail.el 
                         org-table.el org-timer.el org-vm.el org-w3m.el 
                         org-wl.el org.el 

Log message:
        2009-01-28  Carsten Dominik  <address@hidden>
        
                * org-agenda.el (org-agenda-get-todos): Start search from 
correct
                position.
        
                * org.el (org-fast-todo-selection): Make sure TODO selection 
does
                not change buffer position.
        
                * org-list.el (org-toggle-checkbox): Implement adding or 
removing
                checkboxes from line or region when called with a prefix
                argument.
        
                * org-rmail.el (org-rmail-store-link): Protect the call to
                `rmail-narrow-to-non-pruned-header'.
        
                * org-clock.el (org-clock-special-range): Fix week display in
                clock tables.
        
                * org-exp.el (org-get-current-options): Fix bug when in indirect
                buffer.
        
                * org-agenda.el (org-agenda-dim-blocked-tasks): New option.
                (org-finalize-agenda): Call `org-agenda-dim-blocked-tasks'.
                (org-agenda-dim-blocked-tasks): New function.
        
                * org.el (org-enforce-todo-dependencies): New option.
                (org-block-todo-from-children-or-siblings): New function.
        
                * org-faces.el (org-agenda-dimmed-todo-face): New face.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/ChangeLog?cvsroot=emacs&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-agenda.el?cvsroot=emacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-archive.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-attach.el?cvsroot=emacs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-bbdb.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-bibtex.el?cvsroot=emacs&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-clock.el?cvsroot=emacs&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-colview.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-compat.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-exp.el?cvsroot=emacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-export-latex.el?cvsroot=emacs&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-faces.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-footnote.el?cvsroot=emacs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-gnus.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-id.el?cvsroot=emacs&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-info.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-irc.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-jsinfo.el?cvsroot=emacs&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-list.el?cvsroot=emacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mac-message.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-macs.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mew.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mhe.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mouse.el?cvsroot=emacs&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-plot.el?cvsroot=emacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-publish.el?cvsroot=emacs&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-remember.el?cvsroot=emacs&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-rmail.el?cvsroot=emacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-table.el?cvsroot=emacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-timer.el?cvsroot=emacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-vm.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-w3m.el?cvsroot=emacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-wl.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org.el?cvsroot=emacs&r1=1.39&r2=1.40

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/ChangeLog,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- ChangeLog   28 Jan 2009 02:55:34 -0000      1.54
+++ ChangeLog   28 Jan 2009 14:31:59 -0000      1.55
@@ -1,3 +1,33 @@
+2009-01-28  Carsten Dominik  <address@hidden>
+
+       * org-agenda.el (org-agenda-get-todos): Start search from correct
+       position.
+
+       * org.el (org-fast-todo-selection): Make sure TODO selection does
+       not change buffer position.
+
+       * org-list.el (org-toggle-checkbox): Implement adding or removing
+       checkboxes from line or region when called with a prefix
+       argument.
+
+       * org-rmail.el (org-rmail-store-link): Protect the call to
+       `rmail-narrow-to-non-pruned-header'.
+
+       * org-clock.el (org-clock-special-range): Fix week display in
+       clock tables.
+
+       * org-exp.el (org-get-current-options): Fix bug when in indirect
+       buffer.
+
+       * org-agenda.el (org-agenda-dim-blocked-tasks): New option.
+       (org-finalize-agenda): Call `org-agenda-dim-blocked-tasks'.
+       (org-agenda-dim-blocked-tasks): New function.
+
+       * org.el (org-enforce-todo-dependencies): New option.
+       (org-block-todo-from-children-or-siblings): New function.
+
+       * org-faces.el (org-agenda-dimmed-todo-face): New face.
+
 2009-01-27  Carsten Dominik  <address@hidden>
 
        * org.el (org-todo): Return correct state type even if the blocker

Index: org-agenda.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-agenda.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- org-agenda.el       27 Jan 2009 11:38:21 -0000      1.23
+++ org-agenda.el       28 Jan 2009 14:31:59 -0000      1.24
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -513,6 +513,21 @@
   :group 'org-agenda-daily/weekly
   :type 'boolean)
 
+(defcustom org-agenda-dim-blocked-tasks t
+  "Non-nil means, dim blocked tasks in the agenda display.
+This causes some overhead during agenda construction, but if you have turned
+on `org-enforce-todo-dependencies' or any other blocking mechanism, this
+will create useful feedback in the agenda.
+Instead ot t, this variable can also have the value `invisible'.  Then
+blocked tasks will be invisible and only become visible when they
+become unblocked."
+  :group 'org-agenda-daily/weekly
+  :group 'org-agenda-todo-list
+  :type '(choice
+         (const :tag "Do not dim" nil)
+         (const :tag "Dim to a grey face" t)
+         (const :tag "Make invisibe" invisible)))
+
 (defcustom org-timeline-show-empty-dates 3
   "Non-nil means, `org-timeline' also shows dates without an entry.
 When nil, only the days which actually have entries are shown.
@@ -2132,6 +2147,8 @@
          (org-agenda-columns))
       (when org-agenda-fontify-priorities
        (org-fontify-priorities))
+      (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
+       (org-agenda-dim-blocked-tasks))
       (run-hooks 'org-finalize-agenda-hook)
       (setq org-agenda-type (get-text-property (point) 'org-agenda-type))
       )))
@@ -2162,6 +2179,36 @@
               ((equal p h) 'bold)))
        (org-overlay-put ov 'org-type 'org-priority)))))
 
+(defun org-agenda-dim-blocked-tasks ()
+  "Dim currently blocked TODO's in the agenda display."
+  (mapc (lambda (o) (if (eq (org-overlay-get o 'org-type) 'org-blocked-todo)
+                       (org-delete-overlay o)))
+       (org-overlays-in (point-min) (point-max)))
+  (save-excursion
+    (let ((inhibit-read-only t)
+         (invis (eq org-agenda-dim-blocked-tasks 'invisible))
+         b e p ov h l)
+      (goto-char (point-min))
+      (while (let ((pos (next-single-property-change (point) 'todo-state)))
+              (and pos (goto-char (1+ pos))))
+       (let ((marker (get-text-property (point) 'org-hd-marker)))
+         (when (and marker
+                    (not (with-current-buffer (marker-buffer marker)
+                           (save-excursion
+                             (goto-char marker)
+                             (run-hook-with-args-until-failure
+                              'org-blocker-hook
+                              (list :type 'todo-state-change
+                                    :position marker
+                                    :from 'todo
+                                    :to 'done))))))
+           (setq b (if invis (max (point-min) (1- (point))) (point))
+                 e (point-at-eol)
+                 ov (org-make-overlay b e))
+           (if invis
+               (org-overlay-put ov 'invisible t)
+             (org-overlay-put ov 'face 'org-agenda-dimmed-todo-face))
+           (org-overlay-put ov 'org-type 'org-blocked-todo)))))))
 
 (defvar org-agenda-skip-function nil
   "Function to be called at each match during agenda construction.
@@ -3272,7 +3319,7 @@
       (catch :skip
        (save-match-data
          (beginning-of-line)
-         (setq beg (point) end (progn (outline-next-heading) (point)))
+         (setq beg (point) end (save-excursion (outline-next-heading) (point)))
          (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item 
end)
            (goto-char (1+ beg))
            (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))

Index: org-archive.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-archive.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-archive.el      27 Jan 2009 11:38:21 -0000      1.20
+++ org-archive.el      28 Jan 2009 14:31:59 -0000      1.21
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-attach.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-attach.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- org-attach.el       27 Jan 2009 11:38:21 -0000      1.13
+++ org-attach.el       28 Jan 2009 14:31:59 -0000      1.14
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley <address@hidden>
 ;; Keywords: org data task
-;; Version: 6.19e
+;; Version: 6.20c
 
 ;; This file is part of GNU Emacs.
 ;;

Index: org-bbdb.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-bbdb.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-bbdb.el 27 Jan 2009 11:38:21 -0000      1.20
+++ org-bbdb.el 28 Jan 2009 14:31:59 -0000      1.21
@@ -7,7 +7,7 @@
 ;;         Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-bibtex.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-bibtex.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- org-bibtex.el       27 Jan 2009 11:38:21 -0000      1.18
+++ org-bibtex.el       28 Jan 2009 14:31:59 -0000      1.19
@@ -5,7 +5,7 @@
 ;; Author: Bastien Guerry <bzg at altern dot org>
 ;;         Carsten Dominik <carsten dot dominik at gmail dot com>
 ;; Keywords: org, wp, remember
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-clock.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-clock.el,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- org-clock.el        27 Jan 2009 11:38:21 -0000      1.21
+++ org-clock.el        28 Jan 2009 14:31:59 -0000      1.22
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -724,6 +724,7 @@
       (setq date (calendar-gregorian-from-absolute
                  (calendar-absolute-from-iso (list w 1 y))))
       (setq d (nth 1 date) month (car date) y (nth 2 date)
+           dow 1
            key 'week))
      ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)$" 
skey)
       (setq y (string-to-number (match-string 1 skey))

Index: org-colview.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-colview.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-colview.el      27 Jan 2009 11:38:22 -0000      1.19
+++ org-colview.el      28 Jan 2009 14:32:00 -0000      1.20
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-compat.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-compat.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-compat.el       27 Jan 2009 11:38:22 -0000      1.19
+++ org-compat.el       28 Jan 2009 14:32:00 -0000      1.20
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-exp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-exp.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- org-exp.el  27 Jan 2009 11:38:22 -0000      1.23
+++ org-exp.el  28 Jan 2009 14:32:00 -0000      1.24
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -3031,7 +3031,10 @@
    (mapconcat 'identity org-export-exclude-tags " ")
    org-export-html-link-up
    org-export-html-link-home
-   (file-name-nondirectory buffer-file-name)
+   (or (ignore-errors
+        (file-name-sans-extension
+         (file-name-nondirectory (buffer-file-name (buffer-base-buffer)))))
+       "NOFILENAME")
    "TODO FEEDBACK VERIFY DONE"
    "Me Jason Marie DONE"
    org-highest-priority org-lowest-priority org-default-priority

Index: org-export-latex.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-export-latex.el,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- org-export-latex.el 27 Jan 2009 11:38:22 -0000      1.22
+++ org-export-latex.el 28 Jan 2009 14:32:00 -0000      1.23
@@ -4,7 +4,7 @@
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-export-latex.el
-;; Version: 6.19e
+;; Version: 6.20c
 ;; Author: Bastien Guerry <bzg AT altern DOT org>
 ;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: org, wp, tex

Index: org-faces.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-faces.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-faces.el        27 Jan 2009 11:38:22 -0000      1.20
+++ org-faces.el        28 Jan 2009 14:32:00 -0000      1.21
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -400,15 +400,15 @@
 (defface org-clock-overlay ;; copied from secondary-selection
   (org-compatible-face nil
     '((((class color) (min-colors 88) (background light))
-       :background "yellow1")
+       (:background "yellow1"))
       (((class color) (min-colors 88) (background dark))
-       :background "SkyBlue4")
+       (:background "SkyBlue4"))
       (((class color) (min-colors 16) (background light))
-       :background "yellow")
+       (:background "yellow"))
       (((class color) (min-colors 16) (background dark))
-       :background "SkyBlue4")
+       (:background "SkyBlue4"))
       (((class color) (min-colors 8))
-       :background "cyan" :foreground "black")
+       (:background "cyan" :foreground "black"))
       (t (:inverse-video t))))
     "Basic face for displaying the secondary selection."
     :group 'org-faces)
@@ -456,6 +456,11 @@
   "Face for items scheduled for a certain day."
   :group 'org-faces)
 
+(defface org-agenda-dimmed-todo-face
+  '((((background light)) (:foreground "grey50"))
+    (((background dark)) (:foreground "grey50")))
+  "Face used to dimm blocked tasks in the agenda."
+  :group 'org-faces)
 
 (defface org-scheduled-previously
   (org-compatible-face nil

Index: org-footnote.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-footnote.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- org-footnote.el     27 Jan 2009 11:38:22 -0000      1.2
+++ org-footnote.el     28 Jan 2009 14:32:00 -0000      1.3
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-gnus.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-gnus.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-gnus.el 27 Jan 2009 11:38:22 -0000      1.19
+++ org-gnus.el 28 Jan 2009 14:32:00 -0000      1.20
@@ -7,7 +7,7 @@
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-id.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-id.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- org-id.el   27 Jan 2009 11:38:22 -0000      1.18
+++ org-id.el   28 Jan 2009 14:32:00 -0000      1.19
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-info.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-info.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-info.el 27 Jan 2009 11:38:22 -0000      1.20
+++ org-info.el 28 Jan 2009 14:32:00 -0000      1.21
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-irc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-irc.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-irc.el  27 Jan 2009 11:38:22 -0000      1.19
+++ org-irc.el  28 Jan 2009 14:32:00 -0000      1.20
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Philip Jackson <address@hidden>
 ;; Keywords: erc, irc, link, org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-jsinfo.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-jsinfo.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- org-jsinfo.el       27 Jan 2009 11:38:22 -0000      1.18
+++ org-jsinfo.el       28 Jan 2009 14:32:01 -0000      1.19
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-list.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-list.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- org-list.el 27 Jan 2009 11:38:22 -0000      1.15
+++ org-list.el 28 Jan 2009 14:32:01 -0000      1.16
@@ -7,7 +7,7 @@
 ;;        Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -248,11 +248,15 @@
         (skip-chars-forward " \t")
         (looking-at "\\[[- X]\\]"))))
 
-(defun org-toggle-checkbox (&optional arg)
-  "Toggle the checkbox in the current line."
+(defun org-toggle-checkbox (&optional toggle-presence)
+  "Toggle the checkbox in the current line.
+With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.
+When there is an active region, toggle status or presence of the checkbox
+in the first line, and make every item in the region have the same
+status or precence, respectively."
   (interactive "P")
   (catch 'exit
-    (let (beg end status (firstnew 'unknown))
+    (let (beg end status first-present first-status)
       (cond
        ((org-region-active-p)
        (setq beg (region-beginning) end (region-end)))
@@ -260,23 +264,46 @@
        (setq beg (point) end (save-excursion (outline-next-heading) (point))))
        ((org-at-item-checkbox-p)
        (let ((pos (point)))
+         (if toggle-presence
+             (progn
+               (replace-match "")
+               (goto-char (match-beginning 0))
+               (just-one-space))
          (replace-match
-          (cond (arg "[-]")
-                ((member (match-string 0) '("[ ]" "[-]")) "[X]")
+            (cond ((member (match-string 0) '("[ ]" "[-]")) "[X]")
                 (t "[ ]"))
-          t t)
+            t t))
          (goto-char pos))
        (throw 'exit t))
+       ((org-at-item-p)
+       ;; add a checkbox
+       (save-excursion
+         (goto-char (match-end 0))
+         (insert "[ ] "))
+       (throw 'exit t))
        (t (error "Not at a checkbox or heading, and no active region")))
+      (setq end (move-marker (make-marker) end))
       (save-excursion
        (goto-char beg)
+       (setq first-present (org-at-item-checkbox-p)
+             first-status (and first-present (equal (match-string 0) "[X]")))
        (while (< (point) end)
+         (if toggle-presence
+             (cond
+              ((and first-present (org-at-item-checkbox-p))
+               (save-excursion
+                 (replace-match "")
+                 (goto-char (match-beginning 0))
+                 (just-one-space)))
+              ((and (not first-present) (not (org-at-item-checkbox-p))
+                    (org-at-item-p))
+               (save-excursion
+                 (goto-char (match-end 0))
+                 (insert "[ ] "))))
          (when (org-at-item-checkbox-p)
            (setq status (equal (match-string 0) "[X]"))
-           (when (eq firstnew 'unknown)
-             (setq firstnew (not status)))
            (replace-match
-            (if (if arg (not status) firstnew) "[X]" "[ ]") t t))
+              (if first-status "[ ]" "[X]") t t)))
          (beginning-of-line 2)))))
   (org-update-checkbox-count-maybe))
 

Index: org-mac-message.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mac-message.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-mac-message.el  27 Jan 2009 11:38:22 -0000      1.20
+++ org-mac-message.el  28 Jan 2009 14:32:01 -0000      1.21
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <address@hidden>
-;; Version: 6.19e
+;; Version: 6.20c
 ;; Keywords: outlines, hypermedia, calendar, wp
 
 ;; This file is part of GNU Emacs.

Index: org-macs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-macs.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-macs.el 27 Jan 2009 11:38:22 -0000      1.20
+++ org-macs.el 28 Jan 2009 14:32:01 -0000      1.21
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-mew.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mew.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-mew.el  27 Jan 2009 11:38:23 -0000      1.19
+++ org-mew.el  28 Jan 2009 14:32:01 -0000      1.20
@@ -5,7 +5,7 @@
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 
 ;; This file is part of GNU Emacs.
 

Index: org-mhe.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mhe.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-mhe.el  27 Jan 2009 11:38:23 -0000      1.19
+++ org-mhe.el  28 Jan 2009 14:32:01 -0000      1.20
@@ -6,7 +6,7 @@
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-mouse.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mouse.el,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- org-mouse.el        27 Jan 2009 11:38:23 -0000      1.21
+++ org-mouse.el        28 Jan 2009 14:32:01 -0000      1.22
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-plot.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-plot.el,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- org-plot.el 27 Jan 2009 11:38:23 -0000      1.14
+++ org-plot.el 28 Jan 2009 14:32:02 -0000      1.15
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
 ;; Keywords: tables, plotting
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-publish.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-publish.el,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- org-publish.el      27 Jan 2009 11:38:23 -0000      1.24
+++ org-publish.el      28 Jan 2009 14:32:02 -0000      1.25
@@ -4,7 +4,7 @@
 ;; Author: David O'Toole <address@hidden>
 ;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: hypermedia, outlines, wp
-;; Version: 6.19e
+;; Version: 6.20c
 
 ;; This file is part of GNU Emacs.
 ;;

Index: org-remember.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-remember.el,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- org-remember.el     27 Jan 2009 11:38:23 -0000      1.21
+++ org-remember.el     28 Jan 2009 14:32:02 -0000      1.22
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-rmail.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- org-rmail.el        28 Jan 2009 02:54:00 -0000      1.20
+++ org-rmail.el        28 Jan 2009 14:32:02 -0000      1.21
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -52,7 +52,8 @@
       (save-restriction
        (when (eq major-mode 'rmail-summary-mode)
          (rmail-show-message rmail-current-message))
-       (rmail-narrow-to-non-pruned-header)
+       (when (fboundp 'rmail-narrow-to-non-pruned-header)
+         (rmail-narrow-to-non-pruned-header))
        (let* ((folder buffer-file-name)
               (message-id (mail-fetch-field "message-id"))
               (from (mail-fetch-field "from"))

Index: org-table.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-table.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- org-table.el        27 Jan 2009 11:38:23 -0000      1.23
+++ org-table.el        28 Jan 2009 14:32:02 -0000      1.24
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-timer.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-timer.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- org-timer.el        27 Jan 2009 11:38:23 -0000      1.7
+++ org-timer.el        28 Jan 2009 14:32:02 -0000      1.8
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-vm.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-vm.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-vm.el   27 Jan 2009 11:38:23 -0000      1.19
+++ org-vm.el   28 Jan 2009 14:32:02 -0000      1.20
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-w3m.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-w3m.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- org-w3m.el  27 Jan 2009 11:38:23 -0000      1.7
+++ org-w3m.el  28 Jan 2009 14:32:02 -0000      1.8
@@ -5,7 +5,7 @@
 ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org-wl.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-wl.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- org-wl.el   27 Jan 2009 11:38:23 -0000      1.19
+++ org-wl.el   28 Jan 2009 14:32:02 -0000      1.20
@@ -6,7 +6,7 @@
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;

Index: org.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org.el,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- org.el      27 Jan 2009 11:38:23 -0000      1.39
+++ org.el      28 Jan 2009 14:32:02 -0000      1.40
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.19e
+;; Version: 6.20c
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -94,7 +94,7 @@
 
 ;;; Version
 
-(defconst org-version "6.19e"
+(defconst org-version "6.20c"
   "The version number of the file org.el.")
 
 (defun org-version (&optional here)
@@ -1603,6 +1603,49 @@
   :group 'org-todo
   :type 'hook)
 
+(defvar org-blocker-hook nil
+  "Hook for functions that are allowed to block a state change.
+
+Each function gets as its single argument a property list, see
+`org-trigger-hook' for more information about this list.
+
+If any of the functions in this hook returns nil, the state change
+is blocked.")
+
+(defvar org-trigger-hook nil
+  "Hook for functions that are triggered by a state change.
+
+Each function gets as its single argument a property list with at least
+the following elements:
+
+ (:type type-of-change :position pos-at-entry-start
+  :from old-state :to new-state)
+
+Depending on the type, more properties may be present.
+
+This mechanism is currently implemented for:
+
+TODO state changes
+------------------
+:type  todo-state-change
+:from  previous state (keyword as a string), or nil, or a symbol
+       'todo' or 'done', to indicate the general type of state.
+:to    new state, like in :from")
+
+(defcustom org-enforce-todo-dependencies nil
+  "Non-nil means, undone TODO entries will block switching the parent to DONE.
+Also, if a parent has an :ORDERED: property, switching an entry to DONE will
+be blocked if any prior sibling is not yet done.
+You need to set this variable through the customize interface, or to
+restart emacs after changing the value."
+  :set (lambda (var val)
+        (set var val)
+        (if val
+            (add-hook 'org-blocker-hook 
'org-block-todo-from-children-or-siblings)
+          (remove-hook 'org-blocker-hook 
'org-block-todo-from-children-or-siblings)))
+  :group 'org-todo
+  :type 'boolean)
+
 (defcustom org-todo-state-tags-triggers nil
   "Tag changes that should be triggered by TODO state changes.
 This is a list.  Each entry is
@@ -8272,34 +8315,6 @@
              (push (nth 2 e) rtn)))
          rtn)))))
 
-(defvar org-blocker-hook nil
-  "Hook for functions that are allowed to block a state change.
-
-Each function gets as its single argument a property list, see
-`org-trigger-hook' for more information about this list.
-
-If any of the functions in this hook returns nil, the state change
-is blocked.")
-
-(defvar org-trigger-hook nil
-  "Hook for functions that are triggered by a state change.
-
-Each function gets as its single argument a property list with at least
-the following elements:
-
- (:type type-of-change :position pos-at-entry-start
-  :from old-state :to new-state)
-
-Depending on the type, more properties may be present.
-
-This mechanism is currently implemented for:
-
-TODO state changes
-------------------
-:type  todo-state-change
-:from  previous state (keyword as a string), or nil
-:to    new state (keyword as a string), or nil")
-
 (defvar org-agenda-headline-snapshot-before-repeat)
 (defun org-todo (&optional arg)
   "Change the TODO state of an item.
@@ -8492,6 +8507,60 @@
          (save-excursion
            (run-hook-with-args 'org-trigger-hook change-plist)))))))
 
+(defun org-block-todo-from-children-or-siblings (change-plist)
+  "Block turning an entry into a TODO, using the hierarchy.
+This checks whether the current task should be blocked from state
+changes.  Such blocking occurs when:
+
+  1. The task has children which are not all in a completed state.
+
+  2. A task has a parent with the property :ORDERED:, and there
+     are siblings prior to the current task with incomplete
+     status."
+  (catch 'dont-block
+    ;; If this is not a todo state change, or if this entry is already DONE,
+    ;; do not block
+    (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
+             (member (plist-get change-plist :from)
+                     (cons 'done org-done-keywords)))
+      (throw 'dont-block t))
+    ;; If this task has children, and any are undone, it's blocked
+    (save-excursion
+      (org-back-to-heading t)
+      (let ((this-level (funcall outline-level)))
+       (outline-next-heading)
+       (let ((child-level (funcall outline-level)))
+         (while (and (not (eobp))
+                     (> child-level this-level))
+           ;; this todo has children, check whether they are all
+           ;; completed
+           (if (and (not (org-entry-is-done-p))
+                    (org-entry-is-todo-p))
+               (throw 'dont-block nil))
+           (outline-next-heading)
+           (setq child-level (funcall outline-level))))))
+    ;; Otherwise, if the task's parent has the :ORDERED: property, and
+    ;; any previous siblings are undone, it's blocked
+    (save-excursion
+      (org-back-to-heading t)
+      (when (save-excursion
+             (ignore-errors
+               (outline-up-heading 1)
+               (org-entry-get (point) "ORDERED")))
+       (let* ((this-level (funcall outline-level))
+              (current-level this-level))
+         (while (and (not (bobp))
+                     (= current-level this-level))
+           (outline-previous-heading)
+           (setq current-level (funcall outline-level))
+           (if (= current-level this-level)
+               ;; this todo has children, check whether they are all
+               ;; completed
+               (if (and (not (org-entry-is-done-p))
+                        (org-entry-is-todo-p))
+                   (throw 'dont-block nil)))))))
+    t))                                        ; don't block
+
 (defun org-update-parent-todo-statistics ()
   "Update any statistics cookie in the parent of the current headline."
   (interactive)
@@ -8599,6 +8668,7 @@
         (ncol (/ (- (window-width) 4) fwidth))
         tg cnt e c tbl
         groups ingroup)
+    (save-excursion
     (save-window-excursion
       (if expert
          (set-buffer (get-buffer-create " *Org todo*"))
@@ -8641,7 +8711,7 @@
        ((= c ?\ ) nil)
        ((setq e (rassoc c fulltable) tg (car e))
        tg)
-       (t (setq quit-flag t))))))
+        (t (setq quit-flag t)))))))
 
 (defun org-entry-is-todo-p ()
   (member (org-get-todo-state) org-not-done-keywords))




reply via email to

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