emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115279: * doc/lispref/modes.texi (Imenu): Make it c


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r115279: * doc/lispref/modes.texi (Imenu): Make it clear that sub-alist is the cdr.
Date: Fri, 29 Nov 2013 03:38:32 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115279
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14029
author: Andreas Politz <address@hidden>
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-11-29 05:38:20 +0200
message:
  * doc/lispref/modes.texi (Imenu): Make it clear that sub-alist is the cdr.
  
  * lisp/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.
modified:
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/modes.texi         modes.texi-20091113204419-o5vbwnq5f7feedwu-6201
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/imenu.el                  imenu.el-20091113204419-o5vbwnq5f7feedwu-696
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2013-11-27 06:15:06 +0000
+++ b/doc/lispref/ChangeLog     2013-11-29 03:38:20 +0000
@@ -1,3 +1,8 @@
+2013-11-29  Andreas Politz  <address@hidden>
+
+       * modes.texi (Imenu): Make it clear that sub-alist is the cdr
+       (Bug#14029).
+
 2013-11-27  Glenn Morris  <address@hidden>
 
        * loading.texi (Library Search):

=== modified file 'doc/lispref/modes.texi'
--- a/doc/lispref/modes.texi    2013-08-17 11:14:10 +0000
+++ b/doc/lispref/modes.texi    2013-11-29 03:38:20 +0000
@@ -2483,7 +2483,7 @@
 A nested sub-alist element looks like this:
 
 @example
-(@var{menu-title} @var{sub-alist})
+(@var{menu-title} . @var{sub-alist})
 @end example
 
 It creates the submenu @var{menu-title} specified by @var{sub-alist}.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-29 02:03:39 +0000
+++ b/lisp/ChangeLog    2013-11-29 03:38:20 +0000
@@ -1,3 +1,9 @@
+2013-11-29  Andreas Politz  <address@hidden>
+       * 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  <address@hidden>
 
        * progmodes/python.el (python-mode-map): Remove binding for ":".

=== modified file 'lisp/imenu.el'
--- a/lisp/imenu.el     2013-11-24 21:23:47 +0000
+++ b/lisp/imenu.el     2013-11-29 03:38:20 +0000
@@ -293,8 +293,10 @@
 
 
 (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.
@@ -645,9 +647,11 @@
       ;;   (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
@@ -1033,8 +1037,8 @@
                (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]