1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

texinfo: Fix off-by-one error

* lisp/ox-texinfo.el (org-texinfo--menu-entries): Fix off-by-one
error.

This is a follow-up to f99f26306c.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg01290.html>
This commit is contained in:
Nicolas Goaziou 2021-06-02 17:21:15 +02:00
parent 37f69bf86d
commit 093c94e31b

View File

@ -1232,13 +1232,13 @@ holding contextual information."
:texinfo-entries-cache)))
(cached-entries (gethash scope cache 'no-cache)))
(if (not (eq cached-entries 'no-cache)) cached-entries
(let ((sections (org-texinfo--sectioning-structure info)))
(let* ((sections (org-texinfo--sectioning-structure info))
(max-depth (length sections)))
(puthash scope
(cl-remove-if
(lambda (h)
(or (org-not-nil (org-export-get-node-property :COPYING h t))
(>= (org-export-get-relative-level h info)
(length sections))))
(< max-depth (org-export-get-relative-level h info))))
(org-export-collect-headlines info 1 scope))
cache)))))