From 40474827eade4ab4d3667b4dde5f0833562c7b87 Mon Sep 17 00:00:00 2001 From: Anders Johansson Date: Tue, 25 Aug 2020 15:55:45 +0200 Subject: [PATCH] org-num: Fix bug in check for commented headlines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- lisp/org-num.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/org-num.el b/lisp/org-num.el index e816080d1..a5b044e0d 100644 --- a/lisp/org-num.el +++ b/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)