annotate lisp/cedet/srecode/java.el @ 105709:e044a3c6a7e6

Allow the use of completion-tables. (pcomplete-std-complete): New command. (pcomplete-dirs-or-entries): Use a single call to pcomplete-entries. (pcomplete--here): Use a function for `form' rather than an expression, so it can be byte-compiled. (pcomplete-here, pcomplete-here*): Adjust accordingly. Add edebug declaration. (pcomplete-show-completions): Remove unused var `curbuf'. (pcomplete-do-complete, pcomplete-stub): Don't assume `completions' is a list of strings any more.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 22 Oct 2009 15:17:48 +0000
parents 7f4c7f5c0eba
children 83dde921cc1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104498
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; srecode-java.el --- Srecode Java support
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 ;; Copyright (C) 2009 Free Software Foundation, Inc.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Special support for the Java language.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;;; Code:
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 (require 'srecode/dictionary)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;;;###autoload
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 (defun srecode-semantic-handle-:java (dict)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 "Add macros into the dictionary DICT based on the current java file.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 Adds the following:
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 FILENAME_AS_PACKAGE - file/dir converted into a java package name.
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 FILENAME_AS_CLASS - file converted to a Java class name."
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 ;; A symbol representing
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 (let* ((fsym (file-name-nondirectory (buffer-file-name)))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 (fnox (file-name-sans-extension fsym))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 (dir (file-name-directory (buffer-file-name)))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 (fpak fsym)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 )
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 (while (string-match "\\.\\| " fpak)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 (setq fpak (replace-match "_" t t fpak)))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 (if (string-match "src/" dir)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 (setq dir (substring dir (match-end 0)))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 (setq dir (file-name-nondirectory (directory-file-name dir))))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 (while (string-match "/" dir)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 (setq dir (replace-match "_" t t dir)))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (srecode-dictionary-set-value dict "FILENAME_AS_PACKAGE"
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (concat dir "." fpak))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 (srecode-dictionary-set-value dict "FILENAME_AS_CLASS" fnox)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 ))
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 (provide 'srecode/java)
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 ;; Local variables:
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 ;; generated-autoload-file: "loaddefs.el"
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 ;; generated-autoload-feature: srecode/loaddefs
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 ;; generated-autoload-load-name: "srecode/java"
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 ;; End:
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61
105377
7f4c7f5c0eba Add arch tagline
Miles Bader <miles@gnu.org>
parents: 104498
diff changeset
62 ;; arch-tag: d796b86c-3a0e-457c-a346-9f1ccfdc5e2c
104498
41dc39934483 lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 ;;; srecode/java.el ends here