branch: externals-release/org commit 093c94e31b875107e749449ba0c44e5719c120f8 Author: Nicolas Goaziou <m...@nicolasgoaziou.fr> Commit: Nicolas Goaziou <m...@nicolasgoaziou.fr>
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 f99f26306c57d2342069880eac4dca324d7579ec. Reported-by: Jonas Bernoulli <jo...@bernoul.li> <http://lists.gnu.org/r/emacs-orgmode/2021-05/msg01290.html> --- lisp/ox-texinfo.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 3463544..c1f4197 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -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)))))