Commit | Line | Data |
---|---|---|
74ea13c1 CY |
1 | ;; Test file for Emacs Lisp. |
2 | ;; Attempt to include as many aspects of Emacs Lisp as possible. | |
3 | ;; | |
4 | ||
5 | ;;; Require | |
6 | ;; | |
7 | (require 'semantic) | |
8 | (require 'eieio "../eieio") | |
9 | ||
10 | ;; tags encapsulated in eval-when-compile and eval-and-compile | |
11 | ;; should be expanded out into the outer environment. | |
12 | (eval-when-compile | |
13 | (require 'semantic-imenu) | |
14 | ) | |
15 | ||
16 | (eval-and-compile | |
17 | (defconst const-1 nil) | |
18 | (defun function-1 (arg) | |
19 | nil) | |
20 | ) | |
21 | ||
22 | ;;; Functions | |
23 | ;; | |
24 | (defun a-defun (arg1 arg2 &optional arg3) | |
25 | "doc a" | |
26 | nil) | |
27 | ||
28 | (defun a-defun-interactive (arg1 arg2 &optional arg3) | |
29 | "doc a that is a command" | |
30 | (interactive "R") | |
31 | nil) | |
32 | ||
33 | (defun* a-defun* (arg1 arg2 &optional arg3) | |
34 | "doc a*" | |
35 | nil) | |
36 | ||
37 | (defsubst a-defsubst (arg1 arg2 &optional arg3) | |
38 | "doc a-subst" | |
39 | nil) | |
40 | ||
41 | (defmacro a-defmacro (arg1 arg2 &optional arg3) | |
42 | "doc a-macro" | |
43 | nil) | |
44 | ||
45 | (define-overload a-overload (arg) | |
46 | "doc a-overload" | |
47 | nil) | |
48 | ||
49 | ;;; Methods | |
50 | ;; | |
51 | (defmethod a-method ((obj some-class) &optional arg2) | |
52 | "Doc String for a method." | |
53 | (call-next-method)) | |
54 | ||
55 | (defgeneric a-generic (arg1 arg2) | |
56 | "General description of a-generic.") | |
57 | ||
58 | ;;; Advice | |
59 | ;; | |
60 | (defadvice existing-function-to-advise (around test activate) | |
61 | "Do something special to this fcn." | |
62 | (ad-do-it)) | |
63 | ||
64 | ;;; Variables | |
65 | ;; | |
66 | (defvar a-defvar (cons 1 2) | |
67 | "Variable a") | |
68 | ||
69 | (defvar a-defvar-star (cons 1 2) | |
70 | "*User visible var a") | |
71 | ||
72 | (defconst a-defconst 'a "var doc const") | |
73 | ||
74 | (defcustom a-defcustom nil | |
75 | "*doc custom" | |
76 | :group 'a-defgroup | |
77 | :type 'boolean) | |
78 | ||
79 | (defface a-defface 'bold | |
80 | "A face that is bold.") | |
81 | ||
82 | (defimage ezimage-page-minus | |
83 | ((:type xpm :file "page-minus.xpm" :ascent center)) | |
84 | "Image used for open files with stuff in them.") | |
85 | ||
86 | ;;; Autoloads | |
87 | ;; | |
88 | (autoload (quote a-autoload) "somefile" | |
89 | "Non-interactive autoload." nil nil) | |
90 | ||
91 | (autoload (quote a-autoload-interactive) "somefile" | |
92 | "Interactive autoload." t nil) | |
93 | ||
94 | ||
95 | (defgroup a-defgroup nil | |
96 | "Group for `emacs-lisp' regression-test") | |
97 | ||
98 | ;;; Classes | |
99 | ;; | |
100 | (defclass a-class (a-parent) | |
101 | ((slot-1) | |
102 | (slot-2 :initarg :slot-2) | |
103 | (slot-3 :documentation "Doc about slot3") | |
104 | (slot-4 :type 'boolean) | |
105 | ) | |
106 | "Doc String for class.") | |
107 | ||
108 | (defclass a-class-abstract () | |
109 | nil | |
110 | "Doc string for abstract class." | |
111 | :abstract t) | |
112 | ||
113 | ;;; Structures | |
114 | ;; | |
115 | (defstruct (test-struct-1 :test 'equal) | |
116 | (slot-1 :equal 'eq) | |
117 | slot-2) | |
118 | ||
119 | (defstruct test-struct-2 | |
120 | slot-1 | |
121 | slot-2) | |
122 | ||
123 | ;;; Semantic specific macros | |
124 | ;; | |
125 | (define-lex a-lexer | |
126 | "Doc String" | |
127 | this | |
128 | that) | |
129 | ||
130 | (define-mode-local-override a-overriden-function | |
131 | emacs-lisp-mode (tag) | |
132 | "A function that is overloaded." | |
133 | nil) | |
134 | ||
135 | (defvar-mode-local emacs-lisp-mode a-mode-local-def | |
136 | "some value") | |
137 | ||
138 | ||
139 | ;;; Provide | |
140 | ;; | |
141 | (provide 'test) | |
3999968a MB |
142 | |
143 | ;; arch-tag: ecda6dd6-db71-4b28-aa47-6adc585dce06 |