Преглед изворни кода

fix tangle bug, checking empty headlines commented

  Thanks to Michael Brand for catching this bug.

* lisp/ob-tangle.el (org-babel-under-commented-heading-p): robust to
  empty headlines.
Eric Schulte пре 11 година
родитељ
комит
e4984e2783
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      lisp/ob-tangle.el

+ 2 - 2
lisp/ob-tangle.el

@@ -361,8 +361,8 @@ that the appropriate major-mode is set.  SPEC has the form:
 (defvar org-comment-string) ;; Defined in org.el
 (defun org-babel-under-commented-heading-p ()
   "Return t if currently under a commented heading."
-  (if (string-match (concat "^" org-comment-string)
-		    (nth 4 (org-heading-components)))
+  (if (let ((hd (nth 4 (org-heading-components))))
+	(and hd (string-match (concat "^" org-comment-string) hd)))
       t
     (save-excursion
       (and (org-up-heading-safe)