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:
parent
740bcff0c1
commit
ee4f026188
4
etc/NEWS
4
etc/NEWS
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user