;;; js2-imenu-extras.el --- Imenu support for additional constructs ;; Copyright (C) 2012-2014 Free Software Foundation, Inc. ;; Author: Dmitry Gutov ;; Keywords: languages, javascript, imenu ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Commentary: ;; This package adds Imenu support for additional framework constructs and ;; structural patterns to `js2-mode'. ;; Usage: ;; (add-hook 'js2-mode-hook 'js2-imenu-extras-mode) ;; To customize how it works: ;; M-x customize-group RET js2-imenu RET (eval-when-compile (require 'cl)) (require 'js2-mode) (defvar js2-imenu-extension-styles `((:framework jquery :call-re "\\_<\\(?:jQuery\\|\\$\\|_\\)\\.extend\\s-*(" :recorder js2-imenu-record-jquery-extend) (:framework jquery-ui :call-re "^\\s-*\\(?:jQuery\\|\\$\\)\\.widget\\s-*(" :recorder js2-imenu-record-string-declare) (:framework dojo :call-re "^\\s-*dojo.declare\\s-*(" :recorder js2-imenu-record-string-declare) (:framework backbone :call-re ,(concat "\\_<" js2-mode-identifier-re "\\.extend\\s-*(") :recorder js2-imenu-record-backbone-extend) (:framework enyo :call-re "\\_