X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/6433819b3a3bed7bd6b803455e3617489c8fe9a8..58857dc01d4de5196f39f02afd12151ac4d0d349:/js2-imenu-extras.el diff --git a/js2-imenu-extras.el b/js2-imenu-extras.el index e68d9ff92..dfdedc8ee 100644 --- a/js2-imenu-extras.el +++ b/js2-imenu-extras.el @@ -1,292 +1,349 @@ -;;; js2-imenu-extras.el --- Imenu support for additional constructs - -;; Copyright (C) 2012-2013 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) - -(defconst 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 "\\_ +;; 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 "\\_