Function: reftex-index-level-down
reftex-index-level-down is an interactive and byte-compiled function
defined in reftex-index.el.gz.
Signature
(reftex-index-level-down)
Documentation
Make index entry a subitem of another entry.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/reftex-index.el.gz
(defun reftex-index-level-down ()
"Make index entry a subitem of another entry."
(interactive)
(let* ((data (get-text-property (point) :data))
(docstruct (symbol-value reftex-docstruct-symbol))
old new prefix key)
(unless data (error "Don't know which index entry to change"))
(setq old (nth 2 data)
key (nth 6 data)
prefix (completing-read
"Prefix: "
(reftex-sublist-nth
docstruct 6
(lambda (x)
(and (eq (car x) 'index)
(string= (nth 1 x) reftex-index-tag))) t)))
(unless (string-match
(concat (regexp-quote (car reftex-index-special-chars)) "\\'")
prefix)
(setq prefix (concat prefix (car reftex-index-special-chars))))
(if (string-match (regexp-quote key) old)
(setq new (replace-match (concat prefix key) t t old))
(error "Cannot construct new index key"))
(reftex-index-change-entry new (format "Added prefix: %s" prefix))))