浏览代码

org-num: Fix bug in check for commented headlines

* lisp/org-num.el (org-num--skip-value): Handle empty headlines.

This happens when org-num-skip-commented is non-nil.  When creating
a new headline, often org-num--skip-value is invoked before any
headline text is created. This means that ‘title‘ is nil and the
string-match check breaks. Checking if title is non-nil fixes this.

TINYCHANGE
Anders Johansson 4 年之前
父节点
当前提交
40474827ea
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lisp/org-num.el

+ 1 - 0
lisp/org-num.el

@@ -254,6 +254,7 @@ otherwise."
              org-footnote-section
              (equal title org-footnote-section))
         (and org-num-skip-commented
+	     title
              (let ((case-fold-search nil))
                (string-match org-num--comment-re title))
              t)