Function: reftex-index-level-up
reftex-index-level-up is an interactive and byte-compiled function
defined in reftex-index.el.gz.
Signature
(reftex-index-level-up)
Documentation
Remove the highest level of a hierarchical index entry.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/reftex-index.el.gz
(defun reftex-index-level-up ()
"Remove the highest level of a hierarchical index entry."
(interactive)
(let* ((data (get-text-property (point) :data))
old new prefix)
(unless data (error "Don't know which entry to change"))
(setq old (nth 2 data))
(if (string-match (concat "{\\([^" (nth 0 reftex-index-special-chars) "]*"
"[^" (nth 3 reftex-index-special-chars) "]"
(regexp-quote (nth 0 reftex-index-special-chars))
"\\)")
old)
(setq prefix (substring old (match-beginning 1) (match-end 1))
new (concat (substring old 0 (match-beginning 1))
(substring old (match-end 1))))
(error "Entry is not a subitem"))
(reftex-index-change-entry new (format "Removed prefix: %s" prefix))))