Browse Source

Maintenance: Cleanup and minor fixed.

Carsten Dominik 16 years ago
parent
commit
452f7352f6
3 changed files with 18 additions and 6 deletions
  1. 10 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-agenda.el
  3. 7 5
      lisp/org.el

+ 10 - 0
lisp/ChangeLog

@@ -1,5 +1,15 @@
 2009-01-27  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-01-27  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org.el (org-todo): Return correct state type even if the blocker
+	throws an error.
+	(org-modifier-cursor-error): Renamed from
+	`org-shiftcursor-error'.
+	(org-shiftmetaleft, org-shiftmetaright, org-shiftmetaup)
+	(org-shiftmetadown): Call `org-modifier-cursor-error'.
+
+	* org-agenda.el (org-agenda-todo): Call `org-todo' interactively,
+	to get real errors from the blocker hook.
+
 	* org.el (org-shiftselect-error, org-call-for-shift-select): New
 	* org.el (org-shiftselect-error, org-call-for-shift-select): New
 	functions.
 	functions.
 	(org-set-visibility-according-to-property): Turn off the setting
 	(org-set-visibility-according-to-property): Turn off the setting

+ 1 - 1
lisp/org-agenda.el

@@ -5084,7 +5084,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
 	(save-excursion
 	(save-excursion
 	  (and (outline-next-heading)
 	  (and (outline-next-heading)
 	       (org-flag-heading nil)))   ; show the next heading
 	       (org-flag-heading nil)))   ; show the next heading
-	(org-todo arg)
+	(call-interactively 'org-todo)
 	(and (bolp) (forward-char 1))
 	(and (bolp) (forward-char 1))
 	(setq newhead (org-get-heading))
 	(setq newhead (org-get-heading))
 	(when (and (org-bound-and-true-p
 	(when (and (org-bound-and-true-p

+ 7 - 5
lisp/org.el

@@ -8411,6 +8411,8 @@ For calling through lisp, arg is also interpreted in the following way:
 				 :position startpos))
 				 :position startpos))
 	     dolog now-done-p)
 	     dolog now-done-p)
 	(when org-blocker-hook
 	(when org-blocker-hook
+	  (setq org-last-todo-state-is-todo
+		(not (member this org-done-keywords)))
 	  (unless (save-excursion
 	  (unless (save-excursion
 		    (save-match-data
 		    (save-match-data
 		      (run-hook-with-args-until-failure
 		      (run-hook-with-args-until-failure
@@ -12939,7 +12941,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
 	     'delete-backward-char 'org-delete-backward-char)
 	     'delete-backward-char 'org-delete-backward-char)
   (org-defkey org-mode-map "|" 'org-force-self-insert))
   (org-defkey org-mode-map "|" 'org-force-self-insert))
 
 
-(defun org-shiftcursor-error ()
+(defun org-modifier-cursor-error ()
   "Throw an error, a modified cursor command was applied in wrong context."
   "Throw an error, a modified cursor command was applied in wrong context."
   (error "This command is active in special context like tables, headlines or items"))
   (error "This command is active in special context like tables, headlines or items"))
 
 
@@ -12977,7 +12979,7 @@ See the individual commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-delete-column))
    ((org-at-table-p) (call-interactively 'org-table-delete-column))
    ((org-on-heading-p) (call-interactively 'org-promote-subtree))
    ((org-on-heading-p) (call-interactively 'org-promote-subtree))
    ((org-at-item-p) (call-interactively 'org-outdent-item))
    ((org-at-item-p) (call-interactively 'org-outdent-item))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 
 (defun org-shiftmetaright ()
 (defun org-shiftmetaright ()
   "Demote subtree or insert table column.
   "Demote subtree or insert table column.
@@ -12989,7 +12991,7 @@ See the individual commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-insert-column))
    ((org-at-table-p) (call-interactively 'org-table-insert-column))
    ((org-on-heading-p) (call-interactively 'org-demote-subtree))
    ((org-on-heading-p) (call-interactively 'org-demote-subtree))
    ((org-at-item-p) (call-interactively 'org-indent-item))
    ((org-at-item-p) (call-interactively 'org-indent-item))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 
 (defun org-shiftmetaup (&optional arg)
 (defun org-shiftmetaup (&optional arg)
   "Move subtree up or kill table row.
   "Move subtree up or kill table row.
@@ -13001,7 +13003,7 @@ for more information."
    ((org-at-table-p) (call-interactively 'org-table-kill-row))
    ((org-at-table-p) (call-interactively 'org-table-kill-row))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-up))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-up))
    ((org-at-item-p) (call-interactively 'org-move-item-up))
    ((org-at-item-p) (call-interactively 'org-move-item-up))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 (defun org-shiftmetadown (&optional arg)
 (defun org-shiftmetadown (&optional arg)
   "Move subtree down or insert table row.
   "Move subtree down or insert table row.
 Calls `org-move-subtree-down' or `org-table-insert-row' or
 Calls `org-move-subtree-down' or `org-table-insert-row' or
@@ -13012,7 +13014,7 @@ commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-insert-row))
    ((org-at-table-p) (call-interactively 'org-table-insert-row))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-down))
    ((org-on-heading-p) (call-interactively 'org-move-subtree-down))
    ((org-at-item-p) (call-interactively 'org-move-item-down))
    ((org-at-item-p) (call-interactively 'org-move-item-down))
-   (t (org-shiftcursor-error))))
+   (t (org-modifier-cursor-error))))
 
 
 (defun org-metaleft (&optional arg)
 (defun org-metaleft (&optional arg)
   "Promote heading or move table column to left.
   "Promote heading or move table column to left.