Function: texinfo-incorporate-menu-entry-names
texinfo-incorporate-menu-entry-names is a byte-compiled function
defined in texnfo-upd.el.gz.
Signature
(texinfo-incorporate-menu-entry-names NEW-MENU-LIST)
Documentation
Copy any old menu entry names to the new menu.
Point must be at beginning of old menu.
If the node-name of the new menu entry cannot be found in the old menu, do nothing.
For this function, the new menu is a list made up of lists of dotted pairs in which the first element of the pair is the node name and the second element is the description (or nil).
If we find an existing menu entry name, we change the first element of the pair to be another dotted pair in which the car is the menu entry name and the cdr is the node name.
NEW-MENU-LIST is changed destructively. The old menu is the menu as it appears in the texinfo file.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/texnfo-upd.el.gz
(defun texinfo-incorporate-menu-entry-names (new-menu-list)
"Copy any old menu entry names to the new menu.
Point must be at beginning of old menu.
If the node-name of the new menu entry cannot be found in the old
menu, do nothing.
For this function, the new menu is a list made up of lists of dotted
pairs in which the first element of the pair is the node name and the
second element is the description (or nil).
If we find an existing menu entry name, we change the first element of
the pair to be another dotted pair in which the car is the menu entry
name and the cdr is the node name.
NEW-MENU-LIST is changed destructively. The old menu is the menu as it
appears in the texinfo file."
(let ((end-of-menu (texinfo-menu-end)))
(dolist (new-menu new-menu-list new-menu-list)
(save-excursion ; keep point at beginning of menu
(if (re-search-forward
;; Existing nodes can have the form
;; * NODE NAME:: DESCRIPTION
;; or
;; * MENU ITEM: NODE NAME. DESCRIPTION.
;;
;; We're interested in the second case.
(concat "\\* " ; so only menu entries are found
"\\(.*\\): " (regexp-quote (car new-menu))
"[.,\t\n]")
end-of-menu
t)
(setcar
new-menu ; replace the node name
(cons (buffer-substring (match-beginning 1) (match-end 1))
(car new-menu))))))))