Function: texinfo-copy-menu

texinfo-copy-menu is a byte-compiled function defined in texnfo-upd.el.gz.

Signature

(texinfo-copy-menu)

Documentation

Return the entries of an existing menu as a list.

Start with point just after the word menu in the @menu line and leave point on the line before the @end menu line.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/texnfo-upd.el.gz
(defun texinfo-copy-menu ()
  "Return the entries of an existing menu as a list.
Start with point just after the word `menu' in the `@menu' line
and leave point on the line before the `@end menu' line."
  (let* (this-menu-list
	 (end-of-menu (texinfo-menu-end)) ; position of end of `@end menu'
	 (last-entry (save-excursion      ; position of beginning of
					  ; last `* ' entry
		      (goto-char end-of-menu)
		      ;; handle multi-line description
		      (if (not (re-search-backward "^\\* " nil t))
			  (error "No entries in menu"))
		      (point))))
    (while (< (point) last-entry)
      (if (re-search-forward  "^\\* " end-of-menu t)
	  (push (buffer-substring
		 (point)
		 ;; copy multi-line descriptions
		 (save-excursion
		   (re-search-forward "\\(^\\* \\|^@e\\)" nil t)
		   (- (point) 3)))
		this-menu-list)))
    this-menu-list))