-;;;
-;;; Macro to display a progress message.
-;;; RELPOS is the relative position to display.
-;;; If RELPOS is nil, then the relative position in the buffer
-;;; is calculated.
-;;; PREVPOS is the variable in which we store the last position displayed.
+;;;###autoload
+(defvar imenu-name-lookup-function nil
+ "Function to compare string with index item.
+
+This function will be called with two strings, and should return
+non-nil if they match.
+
+If nil, comparison is done with `string='.
+Set this to some other function for more advanced comparisons,
+such as \"begins with\" or \"name matches and number of
+arguments match\".
+
+This variable is local in all buffers.")
+;;;###autoload
+(make-variable-buffer-local 'imenu-name-lookup-function)
+
+;;;###autoload
+(defvar imenu-default-goto-function 'imenu-default-goto-function
+ "The default function called when selecting an Imenu item.
+The function in this variable is called when selecting a normal index-item.")
+;;;###autoload
+(make-variable-buffer-local 'imenu-default-goto-function)
+
+
+(defun imenu--subalist-p (item)
+ (and (consp (cdr item)) (listp (cadr item))
+ (not (eq (car (cadr item)) 'lambda))))
+
+;; Macro to display a progress message.
+;; RELPOS is the relative position to display.
+;; If RELPOS is nil, then the relative position in the buffer
+;; is calculated.
+;; PREVPOS is the variable in which we store the last position displayed.