From: Anders Johansson <mejlaandersj@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix bug in org-num check for commented headlines
Date: Tue, 25 Aug 2020 15:55:45 +0200 [thread overview]
Message-ID: <CAKJdtO9xFqOvXwi+C24N8uwEyF+-NGoshZCuZbHP1PTECqmgqQ@mail.gmail.com> (raw)
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
next reply other threads:[~2020-08-25 13:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 13:55 Anders Johansson [this message]
2020-08-27 9:31 ` [PATCH] Fix bug in org-num check for commented headlines Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKJdtO9xFqOvXwi+C24N8uwEyF+-NGoshZCuZbHP1PTECqmgqQ@mail.gmail.com \
--to=mejlaandersj@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).