Browse Source

Archiving: Fix new bug with archiving when heading is not given.

Reported by Ed Hirgelt.
Carsten Dominik 16 years ago
parent
commit
f33787b7a8
2 changed files with 4 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-03-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-get-valid-level): Catch the case where the level
+	change is nil.
+
 	* org-clock.el (org-clock-find-position): Better indentation of
 	new clock drawers.
 

+ 1 - 1
lisp/org.el

@@ -5358,7 +5358,7 @@ even level numbers will become the next higher odd number."
       (cond ((or (not change) (= 0 change)) (1+ (* 2 (/ level 2))))
 	    ((> change 0) (1+ (* 2 (/ (+ level (* 2 change)) 2))))
 	    ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
-    (max 1 (+ level change))))
+    (max 1 (+ level (or change 0)))))
 
 (if (boundp 'define-obsolete-function-alias)
     (if (or (featurep 'xemacs) (< emacs-major-version 23))