|author||Nicolas Goaziou <email@example.com>||2013-02-17 00:31:14 (GMT)|
|committer||Nicolas Goaziou <firstname.lastname@example.org>||2013-02-17 00:31:14 (GMT)|
ox-publish: Fix error when two index entries were identical
* lisp/ox-publish.el (org-publish-index-generate-theindex): Fix error when two index entries were identical.
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index eec44c0..f2af098 100644
@@ -976,9 +976,10 @@ publishing directory."
;; Compute the first difference between last entry and
;; current one: it tells the level at which new items
;; should be added.
- (let* ((rank (loop for n from 0 to (length entry)
- unless (equal (nth n entry) (nth n last-entry))
- return n))
+ (let* ((rank (if (equal entry last-entry) (1- (length entry))
+ (loop for n from 0 to (length entry)
+ unless (equal (nth n entry) (nth n last-entry))
+ return n)))
(len (length (nthcdr rank entry))))
;; For each term after the first difference, create
;; a new sub-list with the term as body. Moreover,