comparison lisp/progmodes/cc-menus.el @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents edf295560b5a 04d2abb755d9
children 4b3d39451150
comparison
equal deleted inserted replaced
90260:0ca0d9181b5e 90261:7beb78bc1f8e
1 ;;; cc-menus.el --- imenu support for CC Mode 1 ;;; cc-menus.el --- imenu support for CC Mode
2 2
3 ;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software Foundation,
4 ;; Inc.
4 5
5 ;; Authors: 1998- Martin Stjernholm 6 ;; Authors: 1998- Martin Stjernholm
6 ;; 1992-1999 Barry A. Warsaw 7 ;; 1992-1999 Barry A. Warsaw
7 ;; 1987 Dave Detlefs and Stewart Clamen 8 ;; 1987 Dave Detlefs and Stewart Clamen
8 ;; 1985 Richard M. Stallman 9 ;; 1985 Richard M. Stallman
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;; GNU General Public License for more details. 25 ;; GNU General Public License for more details.
25 26
26 ;; You should have received a copy of the GNU General Public License 27 ;; You should have received a copy of the GNU General Public License
27 ;; along with GNU Emacs; see the file COPYING. If not, write to 28 ;; along with this program; see the file COPYING. If not, write to
28 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 29 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29 ;; Boston, MA 02110-1301, USA. 30 ;; Boston, MA 02110-1301, USA.
30 31
31 ;;; Commentary: 32 ;;; Commentary:
32 33
238 "Return the objc selector style string of METHOD. 239 "Return the objc selector style string of METHOD.
239 Example: 240 Example:
240 - perform: (SEL)aSelector withObject: object1 withObject: object2; /* METHOD */ 241 - perform: (SEL)aSelector withObject: object1 withObject: object2; /* METHOD */
241 => 242 =>
242 -perform:withObject:withObject:withObject: /* selector */" 243 -perform:withObject:withObject:withObject: /* selector */"
243 ;; This function does not do any hidden buffer changes.
244 (let ((return "") ; String to be returned 244 (let ((return "") ; String to be returned
245 (p 0) ; Current scanning position in METHOD 245 (p 0) ; Current scanning position in METHOD
246 (pmax (length method)) ; 246 (pmax (length method)) ;
247 char ; Current scanning target 247 char ; Current scanning target
248 (betweenparen 0) ; CHAR is in parentheses. 248 (betweenparen 0) ; CHAR is in parentheses.
279 (setq betweenparen (1- betweenparen))))) 279 (setq betweenparen (1- betweenparen)))))
280 return)) 280 return))
281 281
282 (defun cc-imenu-objc-remove-white-space (str) 282 (defun cc-imenu-objc-remove-white-space (str)
283 "Remove all spaces and tabs from STR." 283 "Remove all spaces and tabs from STR."
284 ;; This function does not do any hidden buffer changes.
285 (let ((return "") 284 (let ((return "")
286 (p 0) 285 (p 0)
287 (max (length str)) 286 (max (length str))
288 char) 287 char)
289 (while (< p max) 288 (while (< p max)
294 (setq return (concat return (char-to-string char))))) 293 (setq return (concat return (char-to-string char)))))
295 return)) 294 return))
296 295
297 (defun cc-imenu-objc-function () 296 (defun cc-imenu-objc-function ()
298 "imenu supports for objc-mode." 297 "imenu supports for objc-mode."
299 ;; This function does not do any hidden buffer changes.
300 (let (methodlist 298 (let (methodlist
301 clist 299 clist
302 ;; 300 ;;
303 ;; OBJC, Cnoreturn, Cgeneralfunc, Cproto are constants. 301 ;; OBJC, Cnoreturn, Cgeneralfunc, Cproto are constants.
304 ;; 302 ;;
413 ; ()) 411 ; ())
414 ; FIXME: Please contribute one! 412 ; FIXME: Please contribute one!
415 413
416 (defun cc-imenu-init (mode-generic-expression 414 (defun cc-imenu-init (mode-generic-expression
417 &optional mode-create-index-function) 415 &optional mode-create-index-function)
418 ;; This function does not do any hidden buffer changes.
419 (setq imenu-generic-expression mode-generic-expression 416 (setq imenu-generic-expression mode-generic-expression
420 imenu-case-fold-search nil) 417 imenu-case-fold-search nil)
421 (when mode-create-index-function 418 (when mode-create-index-function
422 (setq imenu-create-index-function mode-create-index-function))) 419 (setq imenu-create-index-function mode-create-index-function)))
423 420