emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix bug in org-num check for commented headlines
@ 2020-08-25 13:55 Anders Johansson
  2020-08-27  9:31 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Johansson @ 2020-08-25 13:55 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-27  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-25 13:55 [PATCH] Fix bug in org-num check for commented headlines Anders Johansson
2020-08-27  9:31 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).