Browse Source

Merge branch 'maint'

Bastien Guerry 12 years ago
parent
commit
8c5b47935f
2 changed files with 21 additions and 10 deletions
  1. 20 10
      lisp/org-agenda.el
  2. 1 0
      lisp/org.el

+ 20 - 10
lisp/org-agenda.el

@@ -856,7 +856,7 @@ entry, the rest of the entry will not be searched."
   :group 'org-agenda-daily/weekly
   :group 'org-agenda-daily/weekly
   :type 'boolean)
   :type 'boolean)
 
 
-(defcustom org-agenda-dim-blocked-tasks t
+(defcustom org-agenda-dim-blocked-tasks nil
   "Non-nil means dim blocked tasks in the agenda display.
   "Non-nil means dim blocked tasks in the agenda display.
 This causes some overhead during agenda construction, but if you
 This causes some overhead during agenda construction, but if you
 have turned on `org-enforce-todo-dependencies',
 have turned on `org-enforce-todo-dependencies',
@@ -873,6 +873,7 @@ that is blocked because of checkboxes will never be made invisible, it
 will only be dimmed."
 will only be dimmed."
   :group 'org-agenda-daily/weekly
   :group 'org-agenda-daily/weekly
   :group 'org-agenda-todo-list
   :group 'org-agenda-todo-list
+  :version "24.3"
   :type '(choice
   :type '(choice
 	  (const :tag "Do not dim" nil)
 	  (const :tag "Do not dim" nil)
 	  (const :tag "Dim to a gray face" t)
 	  (const :tag "Dim to a gray face" t)
@@ -2037,6 +2038,7 @@ The following commands are available:
 (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
 (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
 (org-defkey org-agenda-mode-map "m"        'org-agenda-bulk-mark)
 (org-defkey org-agenda-mode-map "m"        'org-agenda-bulk-mark)
 (org-defkey org-agenda-mode-map "*"        'org-agenda-bulk-mark-all)
 (org-defkey org-agenda-mode-map "*"        'org-agenda-bulk-mark-all)
+(org-defkey org-agenda-mode-map "#"        'org-agenda-dim-blocked-tasks)
 (org-defkey org-agenda-mode-map "%"        'org-agenda-bulk-mark-regexp)
 (org-defkey org-agenda-mode-map "%"        'org-agenda-bulk-mark-regexp)
 (org-defkey org-agenda-mode-map "u"        'org-agenda-bulk-unmark)
 (org-defkey org-agenda-mode-map "u"        'org-agenda-bulk-unmark)
 (org-defkey org-agenda-mode-map "U"        'org-agenda-bulk-unmark-all)
 (org-defkey org-agenda-mode-map "U"        'org-agenda-bulk-unmark-all)
@@ -3547,7 +3549,9 @@ generating a new one."
 	  (while (org-activate-plain-links (point-max))
 	  (while (org-activate-plain-links (point-max))
 	    (add-text-properties (match-beginning 0) (match-end 0)
 	    (add-text-properties (match-beginning 0) (match-end 0)
 				 '(face org-link))))
 				 '(face org-link))))
-	(org-agenda-align-tags)
+	(when (cadr (assoc 'org-prefix-has-tag
+			   (car org-prefix-format-compiled)))
+	  (org-agenda-align-tags))
 	(unless org-agenda-with-colors
 	(unless org-agenda-with-colors
 	  (remove-text-properties (point-min) (point-max) '(face nil))))
 	  (remove-text-properties (point-min) (point-max) '(face nil))))
       (if (and (boundp 'org-agenda-overriding-columns-format)
       (if (and (boundp 'org-agenda-overriding-columns-format)
@@ -3560,16 +3564,18 @@ generating a new one."
       (when org-agenda-fontify-priorities
       (when org-agenda-fontify-priorities
 	(org-agenda-fontify-priorities))
 	(org-agenda-fontify-priorities))
       (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
       (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
-	(org-agenda-dim-blocked-tasks))
+      	(org-agenda-dim-blocked-tasks))
       ;; We need to widen when `org-agenda-finalize' is called from
       ;; We need to widen when `org-agenda-finalize' is called from
       ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
       ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
-      (save-restriction
-      	(widen)
-	(org-agenda-mark-clocking-task))
+      (when org-clock-current-task
+	(save-restriction
+	  (widen)
+	  (org-agenda-mark-clocking-task)))
       (when org-agenda-entry-text-mode
       (when org-agenda-entry-text-mode
 	(org-agenda-entry-text-hide)
 	(org-agenda-entry-text-hide)
 	(org-agenda-entry-text-show))
 	(org-agenda-entry-text-show))
-      (if (functionp 'org-habit-insert-consistency-graphs)
+      (if (and (functionp 'org-habit-insert-consistency-graphs)
+	       (save-excursion (next-single-property-change (point-min) 'org-habit-p)))
 	  (org-habit-insert-consistency-graphs))
 	  (org-habit-insert-consistency-graphs))
       (let ((inhibit-read-only t))
       (let ((inhibit-read-only t))
 	(run-hooks 'org-agenda-finalize-hook))
 	(run-hooks 'org-agenda-finalize-hook))
@@ -3634,15 +3640,18 @@ generating a new one."
 	       ((equal p h) 'bold)))
 	       ((equal p h) 'bold)))
 	(overlay-put ov 'org-type 'org-priority)))))
 	(overlay-put ov 'org-type 'org-priority)))))
 
 
-(defun org-agenda-dim-blocked-tasks ()
+(defun org-agenda-dim-blocked-tasks (&optional invisible)
+  (interactive "P")
   "Dim currently blocked TODO's in the agenda display."
   "Dim currently blocked TODO's in the agenda display."
+  (message "Dim or hide blocked tasks...")
   (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo)
   (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo)
 			(delete-overlay o)))
 			(delete-overlay o)))
 	(overlays-in (point-min) (point-max)))
 	(overlays-in (point-min) (point-max)))
   (save-excursion
   (save-excursion
     (let ((inhibit-read-only t)
     (let ((inhibit-read-only t)
 	  (org-depend-tag-blocked nil)
 	  (org-depend-tag-blocked nil)
-	  (invis (eq org-agenda-dim-blocked-tasks 'invisible))
+	  (invis (or (not (null invisible))
+		     (eq org-agenda-dim-blocked-tasks 'invisible)))
 	  org-blocked-by-checkboxes
 	  org-blocked-by-checkboxes
 	  invis1 b e p ov h l)
 	  invis1 b e p ov h l)
       (goto-char (point-min))
       (goto-char (point-min))
@@ -3663,7 +3672,8 @@ generating a new one."
 	    (if invis1
 	    (if invis1
 		(overlay-put ov 'invisible t)
 		(overlay-put ov 'invisible t)
 	      (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
 	      (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
-	    (overlay-put ov 'org-type 'org-blocked-todo)))))))
+	    (overlay-put ov 'org-type 'org-blocked-todo))))))
+    (message "Dim or hide blocked tasks...done"))
 
 
 (defvar org-agenda-skip-function nil
 (defvar org-agenda-skip-function nil
   "Function to be called at each match during agenda construction.
   "Function to be called at each match during agenda construction.

+ 1 - 0
lisp/org.el

@@ -15598,6 +15598,7 @@ user."
 		    (setcar (nthcdr 1 org-defdecode) 59)
 		    (setcar (nthcdr 1 org-defdecode) 59)
 		    (setq org-def (apply 'encode-time org-defdecode)
 		    (setq org-def (apply 'encode-time org-defdecode)
 			  org-defdecode (decode-time org-def)))))
 			  org-defdecode (decode-time org-def)))))
+	 (mouse-autoselect-window nil) ; Don't let the mouse jump
 	 (calendar-frame-setup nil)
 	 (calendar-frame-setup nil)
 	 (calendar-setup nil)
 	 (calendar-setup nil)
 	 (calendar-move-hook nil)
 	 (calendar-move-hook nil)