From: "Drew Adams" <drew.adams@oracle.com>
To: <10123@debbugs.gnu.org>
Subject: bug#10123: 24.0.91; [PATCH] make Imenu ignore invisible definitions
Date: Wed, 23 Nov 2011 16:57:50 -0800 [thread overview]
Message-ID: <1380604F93A4406CB67F8E131E1F3FA7@us.oracle.com> (raw)
In-Reply-To: <CDCFC1B2A82F4E6BA8BE80E556BA8182@us.oracle.com>
[-- Attachment #1: Type: text/plain, Size: 213 bytes --]
Sorry; I sent the wrong patch. It needs to call `re-search-backward' with a
non-nil, non-t 3rd arg: (re-search-backward regexp nil 'MOVE), not
(re-search-backward regexp nil t). The attached patch should be OK.
[-- Attachment #2: imenu-2011-11-23b.patch --]
[-- Type: application/octet-stream, Size: 1495 bytes --]
diff -c -w "imenu.el" "imenupatched.el"
*** imenu.el Wed Nov 23 13:43:14 2011
--- imenu-patched.el Wed Nov 23 13:47:16 2011
***************
*** 800,806 ****
(goto-char (point-max))
(while (and (if (functionp regexp)
(funcall regexp)
! (re-search-backward regexp nil t))
;; Exit the loop if we get an empty match,
;; because it means a bad regexp was specified.
(not (= (match-beginning 0) (match-end 0))))
--- 800,813 ----
(goto-char (point-max))
(while (and (if (functionp regexp)
(funcall regexp)
! (and (re-search-backward regexp nil t)
! ;; Do not count invisible definitions.
! (let ((invis (get-text-property (point) 'invisible)))
! (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))))
Diff finished at Wed Nov 23 13:48:05
next prev parent reply other threads:[~2011-11-24 0:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 0:36 bug#10123: 24.0.91; [PATCH] make Imenu ignore invisible definitions Drew Adams
2011-11-24 0:57 ` Drew Adams [this message]
2011-11-24 16:46 ` Drew Adams
2012-04-12 20:01 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380604F93A4406CB67F8E131E1F3FA7@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=10123@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.