summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-17 00:31:14 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2013-02-17 00:31:14 (GMT)
commit8e2318a722632b66df8a27784250be085c2cf570 (patch)
treee5a26f69da3f5d279c27246b542876ebb80ac4df
parentfb039937f9665c2f1a2dfe94325adfe4c14c99c8 (diff)
downloadorg-mode-8e2318a722632b66df8a27784250be085c2cf570.zip
org-mode-8e2318a722632b66df8a27784250be085c2cf570.tar.gz
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.
-rw-r--r--lisp/ox-publish.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index eec44c0..f2af098 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -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,