+(defun elpher-build-link-map ()
+ "Build alist mapping link names to destination nodes in current buffer."
+ (let ((link-map nil)
+ (b (next-button (point-min) t)))
+ (while b
+ (add-to-list 'link-map (cons (button-label b) b))
+ (setq b (next-button (button-start b))))
+ link-map))
+
+(defun elpher-menu ()
+ "Select a directory entry by name. Similar to the info browser (m)enu command."
+ (interactive)
+ (let* ((link-map (elpher-build-link-map)))
+ (if link-map
+ (let* ((key (let ((completion-ignore-case t))
+ (completing-read "Menu item: " link-map nil t)))
+ (b (cdr (assoc key link-map))))
+ (goto-char (button-start b))
+ (button-activate b)))))
+