Mercurial > emacs
annotate lisp/cedet/srecode/java.el @ 112331:f6578f2bd119
Makefile.in: tidy up the building of lib
* Makefile.in (am--refresh): Mark as .PHONY.
(top_maintainer_clean): Don't remove lib/gnulib.mk m4/gnulib-cache.m4,
as they're not rebuilt unless you do a "make sync-from-gnulib"
and the former is needed for "configure".
(maintainer-clean): Don't recurse into lib, as "make bootstrap-clean"
has already removed lib/Makefile.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 17 Jan 2011 11:20:37 -0800 |
parents | ef719132ddfa |
children |
rev | line source |
---|---|
104498 | 1 ;;; srecode-java.el --- Srecode Java support |
2 | |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
3 ;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. |
104498 | 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-load-name: "srecode/java" | |
59 ;; End: | |
60 | |
61 ;;; srecode/java.el ends here |