diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/imenu.el | 16 |
2 files changed, 16 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6e1e8d17fee..ab72f160670 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-11-29 Andreas Politz <politza@fh-trier.de> | ||
| 2 | * imenu.el (imenu--subalist-p): Don't error on non-conses and | ||
| 3 | allow non-lambda lists as functions. | ||
| 4 | (imenu--in-alist): Don't recurse into non-subalists. | ||
| 5 | (imenu): Don't pass function itself as an argument (Bug#14029). | ||
| 6 | |||
| 1 | 2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * progmodes/python.el (python-mode-map): Remove binding for ":". | 9 | * progmodes/python.el (python-mode-map): Remove binding for ":". |
diff --git a/lisp/imenu.el b/lisp/imenu.el index f41fcda2713..5e03a3a9081 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -293,8 +293,10 @@ The function in this variable is called when selecting a normal index-item.") | |||
| 293 | 293 | ||
| 294 | 294 | ||
| 295 | (defun imenu--subalist-p (item) | 295 | (defun imenu--subalist-p (item) |
| 296 | (and (consp (cdr item)) (listp (cadr item)) | 296 | (and (consp item) |
| 297 | (not (eq (car (cadr item)) 'lambda)))) | 297 | (consp (cdr item)) |
| 298 | (listp (cadr item)) | ||
| 299 | (not (functionp (cadr item))))) | ||
| 298 | 300 | ||
| 299 | (defmacro imenu-progress-message (_prevpos &optional _relpos _reverse) | 301 | (defmacro imenu-progress-message (_prevpos &optional _relpos _reverse) |
| 300 | "Macro to display a progress message. | 302 | "Macro to display a progress message. |
| @@ -645,9 +647,11 @@ Non-nil arguments are in recursive calls." | |||
| 645 | ;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...) | 647 | ;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...) |
| 646 | ;; while a bottom-level element looks like | 648 | ;; while a bottom-level element looks like |
| 647 | ;; (INDEX-NAME . INDEX-POSITION) | 649 | ;; (INDEX-NAME . INDEX-POSITION) |
| 650 | ;; or | ||
| 651 | ;; (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...) | ||
| 648 | ;; We are only interested in the bottom-level elements, so we need to | 652 | ;; We are only interested in the bottom-level elements, so we need to |
| 649 | ;; recurse if TAIL is a list. | 653 | ;; recurse if TAIL is a nested ALIST. |
| 650 | (cond ((listp tail) | 654 | (cond ((imenu--subalist-p elt) |
| 651 | (if (setq res (imenu--in-alist str tail)) | 655 | (if (setq res (imenu--in-alist str tail)) |
| 652 | (setq alist nil))) | 656 | (setq alist nil))) |
| 653 | ((if imenu-name-lookup-function | 657 | ((if imenu-name-lookup-function |
| @@ -1033,8 +1037,8 @@ for more information." | |||
| 1033 | (nth 2 index-item) imenu-default-goto-function)) | 1037 | (nth 2 index-item) imenu-default-goto-function)) |
| 1034 | (position (if is-special-item | 1038 | (position (if is-special-item |
| 1035 | (cadr index-item) (cdr index-item))) | 1039 | (cadr index-item) (cdr index-item))) |
| 1036 | (rest (if is-special-item (cddr index-item)))) | 1040 | (args (if is-special-item (cdr (cddr index-item))))) |
| 1037 | (apply function (car index-item) position rest)) | 1041 | (apply function (car index-item) position args)) |
| 1038 | (run-hooks 'imenu-after-jump-hook))) | 1042 | (run-hooks 'imenu-after-jump-hook))) |
| 1039 | 1043 | ||
| 1040 | (provide 'imenu) | 1044 | (provide 'imenu) |