diff options
| author | Chong Yidong | 2009-09-20 21:06:41 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-09-20 21:06:41 +0000 |
| commit | 4d902e6f13f6bf5d304a0cbcff33e2780a825206 (patch) | |
| tree | 20c5dbf4febbaff55e22b4fa0e950cf552e88e70 /lisp/cedet/srecode/java.el | |
| parent | 70702e9b0ea781fb955c66320c935bc0a8e1d0f1 (diff) | |
| download | emacs-4d902e6f13f6bf5d304a0cbcff33e2780a825206.tar.gz emacs-4d902e6f13f6bf5d304a0cbcff33e2780a825206.zip | |
lisp/cedet/srecode.el:
lisp/cedet/srecode/*.el:
test/cedet/srecode-tests.el: New files
lisp/files.el (auto-mode-alist): Use srecode-template-mode for .srt files.
lisp/cedet/semantic/bovine/scm.el: Add local vars section for autoloading.
Diffstat (limited to 'lisp/cedet/srecode/java.el')
| -rw-r--r-- | lisp/cedet/srecode/java.el | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el new file mode 100644 index 00000000000..325cf215ee8 --- /dev/null +++ b/lisp/cedet/srecode/java.el | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | ;;; srecode-java.el --- Srecode Java support | ||
| 2 | |||
| 3 | ;; Copyright (C) 2009 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | ;; | ||
| 24 | ;; Special support for the Java language. | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | (require 'srecode/dictionary) | ||
| 29 | |||
| 30 | ;;;###autoload | ||
| 31 | (defun srecode-semantic-handle-:java (dict) | ||
| 32 | "Add macros into the dictionary DICT based on the current java file. | ||
| 33 | Adds the following: | ||
| 34 | FILENAME_AS_PACKAGE - file/dir converted into a java package name. | ||
| 35 | FILENAME_AS_CLASS - file converted to a Java class name." | ||
| 36 | ;; A symbol representing | ||
| 37 | (let* ((fsym (file-name-nondirectory (buffer-file-name))) | ||
| 38 | (fnox (file-name-sans-extension fsym)) | ||
| 39 | (dir (file-name-directory (buffer-file-name))) | ||
| 40 | (fpak fsym) | ||
| 41 | ) | ||
| 42 | (while (string-match "\\.\\| " fpak) | ||
| 43 | (setq fpak (replace-match "_" t t fpak))) | ||
| 44 | (if (string-match "src/" dir) | ||
| 45 | (setq dir (substring dir (match-end 0))) | ||
| 46 | (setq dir (file-name-nondirectory (directory-file-name dir)))) | ||
| 47 | (while (string-match "/" dir) | ||
| 48 | (setq dir (replace-match "_" t t dir))) | ||
| 49 | (srecode-dictionary-set-value dict "FILENAME_AS_PACKAGE" | ||
| 50 | (concat dir "." fpak)) | ||
| 51 | (srecode-dictionary-set-value dict "FILENAME_AS_CLASS" fnox) | ||
| 52 | )) | ||
| 53 | |||
| 54 | (provide 'srecode/java) | ||
| 55 | |||
| 56 | ;; Local variables: | ||
| 57 | ;; generated-autoload-file: "loaddefs.el" | ||
| 58 | ;; generated-autoload-feature: srecode/loaddefs | ||
| 59 | ;; generated-autoload-load-name: "srecode/java" | ||
| 60 | ;; End: | ||
| 61 | |||
| 62 | ;;; srecode/java.el ends here | ||