]> git.eshelyaron.com Git - emacs.git/commitdiff
* imenu.el (imenu--generic-function): Ignore invisible definitions.
authorDrew Adams <drew.adams@oracle.com>
Thu, 12 Apr 2012 20:00:24 +0000 (22:00 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 12 Apr 2012 20:00:24 +0000 (22:00 +0200)
Fixes: debbugs:10123
lisp/ChangeLog
lisp/imenu.el

index 0e50a9e7ada4ae92d924ecbf85cbb0333dbba1ae..adddc5cd1f0d4faa21668340abe1b67394c5e5ed 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-12  Drew Adams  <drew.adams@oracle.com>
+
+       * imenu.el (imenu--generic-function): Ignore invisible definitions
+       (bug#10123).
+
 2012-04-12  Vivek Dasmohapatra  <vivek@etla.org>
 
        * hexl.el (hexl-bits): New variable.
index 5472f4246d1ec50c484f88a826321923bc26eccd..08e6338b39ed159d168786c752ad92eb7da2c877 100644 (file)
@@ -800,7 +800,17 @@ depending on PATTERNS."
              (goto-char (point-max))
              (while (and (if (functionp regexp)
                              (funcall regexp)
-                           (re-search-backward regexp nil t))
+                           (and
+                            (re-search-backward regexp nil t)
+                            ;; Do not count invisible definitions.
+                            (let ((invis (invisible-p (point))))
+                              (or (not invis)
+                                  (progn
+                                    (while (and invis
+                                                (not (bobp)))
+                                      (setq invis (not (re-search-backward
+                                                        regexp nil 'move))))
+                                    (not invis))))))
                          ;; Exit the loop if we get an empty match,
                          ;; because it means a bad regexp was specified.
                          (not (= (match-beginning 0) (match-end 0))))