comparison lisp/obsolete/c-mode.el @ 41652:5223683cd329

Comment change.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Nov 2001 00:49:32 +0000
parents f1391a41ece3
children bd315b9fa3f0
comparison
equal deleted inserted replaced
41651:01caeff5df7a 41652:5223683cd329
242 "[ \t]*[:{]" 242 "[ \t]*[:{]"
243 ) 2) 243 ) 2)
244 ;; Example of generic expression for finding prototypes, structs, unions, enums. 244 ;; Example of generic expression for finding prototypes, structs, unions, enums.
245 ;; Uncomment if you want to find these too. It will be a bit slower gathering 245 ;; Uncomment if you want to find these too. It will be a bit slower gathering
246 ;; the indexes. 246 ;; the indexes.
247 ; ("Prototypes" 247 ;;; ("Prototypes"
248 ; (, 248 ;;; (,
249 ; (concat 249 ;;; (concat
250 ; "^" ; beginning of line is required 250 ;;; "^" ; beginning of line is required
251 ; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>" 251 ;;; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
252 ; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no 252 ;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no
253 ; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right? 253 ;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right?
254 254
255 ; "\\(" ; last type spec including */& 255 ;;; "\\(" ; last type spec including */&
256 ; "[a-zA-Z0-9_:]+" 256 ;;; "[a-zA-Z0-9_:]+"
257 ; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace 257 ;;; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace
258 ; "\\)?" ; if there is a last type spec 258 ;;; "\\)?" ; if there is a last type spec
259 ; "\\(" ; name; take that into the imenu entry 259 ;;; "\\(" ; name; take that into the imenu entry
260 ; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor... 260 ;;; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor...
261 ; ; (may not contain * because then 261 ;;; ; (may not contain * because then
262 ; ; "a::operator char*" would become "char*"!) 262 ;;; ; "a::operator char*" would become "char*"!)
263 ; "\\|" 263 ;;; "\\|"
264 ; "\\([a-zA-Z0-9_:~]*::\\)?operator" 264 ;;; "\\([a-zA-Z0-9_:~]*::\\)?operator"
265 ; "[^a-zA-Z1-9_][^(]*" ; ...or operator 265 ;;; "[^a-zA-Z1-9_][^(]*" ; ...or operator
266 ; " \\)" 266 ;;; " \\)"
267 ; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after 267 ;;; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after
268 ; ; the (...) Can't 268 ;;; ; the (...) Can't
269 ; ; catch cases with () inside the parentheses 269 ;;; ; catch cases with () inside the parentheses
270 ; ; surrounding the parameters 270 ;;; ; surrounding the parameters
271 ; ; (like "int foo(int a=bar());" 271 ;;; ; (like "int foo(int a=bar());"
272 ; )) 6) 272 ;;; )) 6)
273 ; ("Struct" 273 ;;; ("Struct"
274 ; (, (concat 274 ;;; (, (concat
275 ; "^" ; beginning of line is required 275 ;;; "^" ; beginning of line is required
276 ; "\\(static[ \t]+\\)?" ; there may be static or const. 276 ;;; "\\(static[ \t]+\\)?" ; there may be static or const.
277 ; "\\(const[ \t]+\\)?" 277 ;;; "\\(const[ \t]+\\)?"
278 ; "struct[ \t]+" 278 ;;; "struct[ \t]+"
279 ; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get 279 ;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get
280 ; "[ \t]*[{]" 280 ;;; "[ \t]*[{]"
281 ; )) 3) 281 ;;; )) 3)
282 ; ("Enum" 282 ;;; ("Enum"
283 ; (, (concat 283 ;;; (, (concat
284 ; "^" ; beginning of line is required 284 ;;; "^" ; beginning of line is required
285 ; "\\(static[ \t]+\\)?" ; there may be static or const. 285 ;;; "\\(static[ \t]+\\)?" ; there may be static or const.
286 ; "\\(const[ \t]+\\)?" 286 ;;; "\\(const[ \t]+\\)?"
287 ; "enum[ \t]+" 287 ;;; "enum[ \t]+"
288 ; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get 288 ;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get
289 ; "[ \t]*[{]" 289 ;;; "[ \t]*[{]"
290 ; )) 3) 290 ;;; )) 3)
291 ; ("Union" 291 ;;; ("Union"
292 ; (, (concat 292 ;;; (, (concat
293 ; "^" ; beginning of line is required 293 ;;; "^" ; beginning of line is required
294 ; "\\(static[ \t]+\\)?" ; there may be static or const. 294 ;;; "\\(static[ \t]+\\)?" ; there may be static or const.
295 ; "\\(const[ \t]+\\)?" 295 ;;; "\\(const[ \t]+\\)?"
296 ; "union[ \t]+" 296 ;;; "union[ \t]+"
297 ; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get 297 ;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get
298 ; "[ \t]*[{]" 298 ;;; "[ \t]*[{]"
299 ; )) 3) 299 ;;; )) 3)
300 ) 300 )
301 "Imenu generic expression for C mode. See `imenu-generic-expression'.") 301 "Imenu generic expression for C mode. See `imenu-generic-expression'.")
302 302
303 (defun c-mode () 303 (defun c-mode ()
304 "Major mode for editing C code. 304 "Major mode for editing C code.