+++
** There is a new macro `skip-unless' for skipping ERT tests. See the manual.
+** Imenu
+
+*** New option `imenu-generic-skip-comments-and-strings'.
+
\f
* New Modes and Packages in Emacs 24.4
+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
: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.
;; 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