emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix bug in org-num check for commented headlines


From: Anders Johansson
Subject: [PATCH] Fix bug in org-num check for commented headlines
Date: Tue, 25 Aug 2020 15:55:45 +0200

I found an easily solved bug in org-num.

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 e816080..a5b044e 100644
--- a/lisp/org-num.el
+++ b/lisp/org-num.el
@@ -254,6 +254,7 @@ (defun org-num--skip-value ()
              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)
-- 
2.28.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]