comparison lisp/progmodes/cc-menus.el @ 24282:5b0864259a4b Release_5_25

Installed CC Mode 5.25.
author Barry A. Warsaw <barry@zope.org>
date Mon, 08 Feb 1999 16:53:18 +0000
parents 5683a1280521
children 69377a75bead
comparison
equal deleted inserted replaced
24281:d03b1e915af1 24282:5b0864259a4b
1 ;;; cc-menus.el --- imenu support for CC Mode 1 ;;; cc-menus.el --- imenu support for CC Mode
2 2
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc.
4 4
5 ;; Authors: 1992-1997 Barry A. Warsaw 5 ;; Authors: 1998 Barry A. Warsaw and Martin Stjernholm
6 ;; 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen 7 ;; 1987 Dave Detlefs and Stewart Clamen
7 ;; 1985 Richard M. Stallman 8 ;; 1985 Richard M. Stallman
8 ;; Maintainer: cc-mode-help@python.org 9 ;; Maintainer: bug-cc-mode@gnu.org
9 ;; Created: 22-Apr-1997 (split from cc-mode.el) 10 ;; Created: 22-Apr-1997 (split from cc-mode.el)
10 ;; Version: See cc-mode.el 11 ;; Version: See cc-mode.el
11 ;; Keywords: c languages oop 12 ;; Keywords: c languages oop
12 13
13 ;; This file is part of GNU Emacs. 14 ;; This file is part of GNU Emacs.
25 ;; You should have received a copy of the GNU General Public License 26 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 28 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA. 29 ;; Boston, MA 02111-1307, USA.
29 30
31 ;; Pull in Imenu when compiling, if it exists
32 (eval-when-compile
33 (condition-case nil
34 (require 'imenu)
35 (error nil)))
36
30 37
31 ;; imenu integration 38 ;; imenu integration
32 (eval-when-compile (require 'imenu))
33
34 (defvar cc-imenu-c-prototype-macro-regexp nil 39 (defvar cc-imenu-c-prototype-macro-regexp nil
35 "RE matching macro names used to conditionally specify function prototypes. 40 "RE matching macro names used to conditionally specify function prototypes.
36 41
37 For example: 42 For example:
38 43
115 ("Class" 120 ("Class"
116 (, (concat 121 (, (concat
117 "^" ; beginning of line is required 122 "^" ; beginning of line is required
118 "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a `template <...>' 123 "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a `template <...>'
119 "class[ \t]+" 124 "class[ \t]+"
120 "\\([a-zA-Z0-9_]+\\)" ; the string we want to get 125 "\\(" ; the string we want to get
126 "[a-zA-Z0-9_]+" ; class name
127 "\\(<[^>]+>\\)?" ; possibly explicitely specialized
128 "\\)"
121 "[ \t]*[:{]" 129 "[ \t]*[:{]"
122 )) 2))) 130 )) 2)))
123 "Imenu generic expression for C++ mode. See `imenu-generic-expression'.") 131 "Imenu generic expression for C++ mode. See `imenu-generic-expression'.")
124 132
125 (defvar cc-imenu-c-generic-expression 133 (defvar cc-imenu-c-generic-expression
135 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; type specs; there can be 143 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; type specs; there can be
136 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; more than 3 tokens, right? 144 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; more than 3 tokens, right?
137 "\\([A-Za-z0-9_-]+[ \t]*[[]?[]]?\\)" 145 "\\([A-Za-z0-9_-]+[ \t]*[[]?[]]?\\)"
138 "\\([ \t]\\)" 146 "\\([ \t]\\)"
139 "\\([A-Za-z0-9_-]+\\)" ; the string we want to get 147 "\\([A-Za-z0-9_-]+\\)" ; the string we want to get
140 "\\([ \t]*\\)(" 148 "\\([ \t]*\\)+("
141 "\\([][a-zA-Z,_1-9\n \t]*\\)" ; arguments 149 "\\([a-zA-Z,_1-9\n \t]*[[]?[]]?\\)*" ; arguments
142 ")[ \t]*" 150 ")[ \t]*"
143 ; "[^;(]" 151 ; "[^;(]"
144 "[,a-zA-Z_1-9\n \t]*{" 152 "[,a-zA-Z_1-9\n \t]*{"
145 )) 6))) 153 )) 6)))
146 "Imenu generic expression for Java mode. See `imenu-generic-expression'.") 154 "Imenu generic expression for Java mode. See `imenu-generic-expression'.")
305 ;; Does this emacs has buffer-substring-no-properties? 313 ;; Does this emacs has buffer-substring-no-properties?
306 ;; 314 ;;
307 (if (fboundp 'buffer-substring-no-properties) 315 (if (fboundp 'buffer-substring-no-properties)
308 'buffer-substring-no-properties 316 'buffer-substring-no-properties
309 'buffer-substring))) 317 'buffer-substring)))
310 (goto-char (point-max)) 318 (goto-char (point-max))
311 (imenu-progress-message stupid 0) 319 (imenu-progress-message stupid 0)
312 ;; 320 ;;
313 (while (re-search-backward cc-imenu-objc-generic-expression nil t) 321 (while (re-search-backward cc-imenu-objc-generic-expression nil t)
314 (imenu-progress-message stupid) 322 (imenu-progress-message stupid)
315 (setq langnum (if (match-beginning OBJC) 323 (setq langnum (if (match-beginning OBJC)
384 (setq toplist (cons (cons "C" clist) toplist))) 392 (setq toplist (cons (cons "C" clist) toplist)))
385 ;; 393 ;;
386 toplist 394 toplist
387 )) 395 ))
388 396
397 ;(defvar cc-imenu-pike-generic-expression
398 ; ())
399 ; FIXME: Please contribute one!
400
389 401
390 (provide 'cc-menus) 402 (provide 'cc-menus)
391 ;;; cc-menus.el ends here 403 ;;; cc-menus.el ends here