| OLD | NEW |
| 1 ;;; gyp.el - font-lock-mode support for gyp files. | 1 ;;; gyp.el - font-lock-mode support for gyp files. |
| 2 | 2 |
| 3 ;; Copyright (c) 2012 Google Inc. All rights reserved. | 3 ;; Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 ;; Use of this source code is governed by a BSD-style license that can be | 4 ;; Use of this source code is governed by a BSD-style license that can be |
| 5 ;; found in the LICENSE file. | 5 ;; found in the LICENSE file. |
| 6 | 6 |
| 7 ;; Put this somewhere in your load-path and | 7 ;; Put this somewhere in your load-path and |
| 8 ;; (require 'gyp) | 8 ;; (require 'gyp) |
| 9 | 9 |
| 10 (require 'python) | 10 (require 'python) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 (defun gyp-set-indentation () | 36 (defun gyp-set-indentation () |
| 37 "Hook function to configure python indentation to suit gyp mode." | 37 "Hook function to configure python indentation to suit gyp mode." |
| 38 (setq python-continuation-offset 2 | 38 (setq python-continuation-offset 2 |
| 39 python-indent 2 | 39 python-indent 2 |
| 40 python-guess-indent nil)) | 40 python-guess-indent nil)) |
| 41 | 41 |
| 42 (add-hook 'gyp-mode-hook 'gyp-set-indentation) | 42 (add-hook 'gyp-mode-hook 'gyp-set-indentation) |
| 43 | 43 |
| 44 (add-to-list 'auto-mode-alist '("\\.gyp\\'" . gyp-mode)) | 44 (add-to-list 'auto-mode-alist '("\\.gyp\\'" . gyp-mode)) |
| 45 (add-to-list 'auto-mode-alist '("\\.gypi\\'" . gyp-mode)) | 45 (add-to-list 'auto-mode-alist '("\\.gypi\\'" . gyp-mode)) |
| 46 (add-to-list 'auto-mode-alist '("/\\.gclient\\'" . gyp-mode)) |
| 46 | 47 |
| 47 ;;; Font-lock support | 48 ;;; Font-lock support |
| 48 | 49 |
| 49 (defconst gyp-dependencies-regexp | 50 (defconst gyp-dependencies-regexp |
| 50 (regexp-opt (list "dependencies" "export_dependent_settings")) | 51 (regexp-opt (list "dependencies" "export_dependent_settings")) |
| 51 "Regular expression to introduce 'dependencies' section") | 52 "Regular expression to introduce 'dependencies' section") |
| 52 | 53 |
| 53 (defconst gyp-sources-regexp | 54 (defconst gyp-sources-regexp |
| 54 (regexp-opt (list "action" "files" "include_dirs" "includes" "inputs" | 55 (regexp-opt (list "action" "files" "include_dirs" "includes" "inputs" |
| 55 "libraries" "outputs" "sources")) | 56 "libraries" "outputs" "sources")) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 (list 2 'font-lock-variable-name-face t t) ; variables, conditions | 243 (list 2 'font-lock-variable-name-face t t) ; variables, conditions |
| 243 (list 3 'font-lock-constant-face t t) ; sources | 244 (list 3 'font-lock-constant-face t t) ; sources |
| 244 (list 4 'font-lock-preprocessor-face t t)) ; preprocessor | 245 (list 4 'font-lock-preprocessor-face t t)) ; preprocessor |
| 245 ;; Variable expansion | 246 ;; Variable expansion |
| 246 (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) | 247 (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) |
| 247 ;; Command expansion | 248 ;; Command expansion |
| 248 (list "<!@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) | 249 (list "<!@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) |
| 249 ))) | 250 ))) |
| 250 | 251 |
| 251 (provide 'gyp) | 252 (provide 'gyp) |
| OLD | NEW |