1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-02 11:21:42 +00:00

* lisp/imenu.el (imenu-generic-skip-comments-and-strings):

New option.
(imenu--generic-function): Use it.

Fixes: debbugs:15560
This commit is contained in:
Dmitry Gutov 2013-11-24 23:23:47 +02:00
parent 740bcff0c1
commit ee4f026188
3 changed files with 20 additions and 1 deletions

View File

@ -639,6 +639,10 @@ whether it is safe to use Bash's --noediting option. These days
+++
** There is a new macro `skip-unless' for skipping ERT tests. See the manual.
** Imenu
*** New option `imenu-generic-skip-comments-and-strings'.
* New Modes and Packages in Emacs 24.4

View File

@ -1,3 +1,9 @@
2013-11-24 Dmitry Gutov <dgutov@yandex.ru>
* imenu.el (imenu-generic-skip-comments-and-strings):
New option (Bug#15560).
(imenu--generic-function): Use it.
2013-11-24 Jorgen Schaefer <contact@jorgenschaefer.de>
* minibuffer.el (completion--in-region-1): Scroll the correct

View File

@ -185,6 +185,13 @@ with name concatenation."
:type 'string
:group 'imenu)
(defcustom imenu-generic-skip-comments-and-strings t
"When non-nil, ignore text inside comments and strings.
Only affects `imenu--generic-function'."
:type 'boolean
:group 'imenu
:version "24.4")
;;;###autoload
(defvar imenu-generic-expression nil
"List of definition matchers for creating an Imenu index.
@ -796,7 +803,9 @@ depending on PATTERNS."
;; starting with its title (or nil).
(menu (assoc menu-title index-alist)))
;; Insert the item unless it is already present.
(unless (member item (cdr menu))
(unless (or (member item (cdr menu))
(and imenu-generic-skip-comments-and-strings
(nth 8 (syntax-ppss))))
(setcdr menu
(cons item (cdr menu)))))
;; Go to the start of the match, to make sure we