Explorar o código

Dependencies: Make them work reliably even if variables are set too late.

Turns out a number of people set their variables too late so that
activating dependencies does not work correctly.  We now double-check
in the mode hook that everything is in order.....
Carsten Dominik %!s(int64=16) %!d(string=hai) anos
pai
achega
c11a0b2de9
Modificáronse 3 ficheiros con 15 adicións e 0 borrados
  1. 1 0
      doc/org.texi
  2. 2 0
      lisp/ChangeLog
  3. 12 0
      lisp/org.el

+ 1 - 0
doc/org.texi

@@ -8174,6 +8174,7 @@ tdepth:  @r{The depth of the table of contents.  The defaults are taken from}
 ftoc:    @r{Does the css of the page specify a fixed position for the toc?}
          @r{If yes, the toc will never be displayed as a section.}
 ltoc:    @r{Should there be short contents (children) in each section?}
+         @r{Make this @code{above} it the section should be above initial text.}
 mouse:   @r{Headings are highlighted when the mouse is over them.  Should be}
          @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
 buttons: @r{Should view-toggle buttons be everywhere?  When @code{nil} (the}

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2009-02-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-mode): Make dependence stuff work more reliably.
+
 	* org-export-latex.el (org-export-latex-emphasis-alist): Use = and
 	~ as verbatim delimiters.
 

+ 12 - 0
lisp/org.el

@@ -3597,6 +3597,18 @@ The following commands are available:
   (org-set-autofill-regexps)
   (setq indent-line-function 'org-indent-line-function)
   (org-update-radio-target-regexp)
+  ;; Make sure dependence stuff works reliably, even for users who set it
+  ;; too late :-(
+  (if org-enforce-todo-dependencies
+      (add-hook 'org-blocker-hook
+		'org-block-todo-from-children-or-siblings)
+    (remove-hook 'org-blocker-hook
+		 'org-block-todo-from-children-or-siblings))
+  (if org-enforce-todo-checkbox-dependencies
+      (add-hook 'org-blocker-hook
+		'org-block-todo-from-checkboxes)
+    (remove-hook 'org-blocker-hook
+		 'org-block-todo-from-checkboxes))
 
   ;; Comment characters
 ;  (org-set-local 'comment-start "#") ;; FIXME: this breaks wrapping