+2013-11-29 Andreas Politz <politza@fh-trier.de>
+ * imenu.el (imenu--subalist-p): Don't error on non-conses and
+ allow non-lambda lists as functions.
+ (imenu--in-alist): Don't recurse into non-subalists.
+ (imenu): Don't pass function itself as an argument (Bug#14029).
+
2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/python.el (python-mode-map): Remove binding for ":".
(defun imenu--subalist-p (item)
- (and (consp (cdr item)) (listp (cadr item))
- (not (eq (car (cadr item)) 'lambda))))
+ (and (consp item)
+ (consp (cdr item))
+ (listp (cadr item))
+ (not (functionp (cadr item)))))
(defmacro imenu-progress-message (_prevpos &optional _relpos _reverse)
"Macro to display a progress message.
;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...)
;; while a bottom-level element looks like
;; (INDEX-NAME . INDEX-POSITION)
+ ;; or
+ ;; (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...)
;; We are only interested in the bottom-level elements, so we need to
- ;; recurse if TAIL is a list.
- (cond ((listp tail)
+ ;; recurse if TAIL is a nested ALIST.
+ (cond ((imenu--subalist-p elt)
(if (setq res (imenu--in-alist str tail))
(setq alist nil)))
((if imenu-name-lookup-function
(nth 2 index-item) imenu-default-goto-function))
(position (if is-special-item
(cadr index-item) (cdr index-item)))
- (rest (if is-special-item (cddr index-item))))
- (apply function (car index-item) position rest))
+ (args (if is-special-item (cdr (cddr index-item)))))
+ (apply function (car index-item) position args))
(run-hooks 'imenu-after-jump-hook)))
(provide 'imenu)