Function: reftex-replace-label-list-segment
reftex-replace-label-list-segment is a byte-compiled function defined
in reftex-parse.el.gz.
Signature
(reftex-replace-label-list-segment OLD INSERT &optional ENTIRELY)
Documentation
Replace the segment in OLD which corresponds to INSERT.
Works with side effects, directly changes old. If ENTIRELY is t, just return INSERT. This function also makes sure the old toc markers do not point anywhere.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/reftex-parse.el.gz
(defun reftex-replace-label-list-segment (old insert &optional entirely)
"Replace the segment in OLD which corresponds to INSERT.
Works with side effects, directly changes old.
If ENTIRELY is t, just return INSERT.
This function also makes sure the old toc markers do not point anywhere."
(cond
(entirely
(reftex-silence-toc-markers old (length old))
insert)
(t (let* ((new old)
(file (nth 1 (car insert)))
(eof-list (member (list 'eof file) old))
(bof-list (member (list 'bof file) old))
n)
(if (not (and bof-list eof-list))
(error "Cannot splice")
;; Splice
(reftex-silence-toc-markers bof-list (- (length bof-list)
(length eof-list)))
(setq n (- (length old) (length bof-list)))
(setcdr (nthcdr n new) (cdr insert))
(setcdr (nthcdr (1- (length new)) new) (cdr eof-list)))
new))))