;; This is actually the expression for C++ mode, but it's used for C too.
(defvar c-imenu-generic-expression
- (`
+ (`
((nil
- (,
+ (,
(concat
"^" ; beginning of line is required
"\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
"\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no
"\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right?
-
+
"\\(" ; last type spec including */&
"[a-zA-Z0-9_:]+"
"\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace
"\\)?" ; if there is a last type spec
"\\(" ; name; take that into the imenu entry
"[a-zA-Z0-9_:~]+" ; member function, ctor or dtor...
- ; (may not contain * because then
+ ; (may not contain * because then
; "a::operator char*" would become "char*"!)
"\\|"
"\\([a-zA-Z0-9_:~]*::\\)?operator"
; catch cases with () inside the parentheses
; surrounding the parameters
; (like "int foo(int a=bar()) {...}"
-
- )) 6)
- ("Class"
- (, (concat
+
+ )) 6)
+ ("Class"
+ (, (concat
"^" ; beginning of line is required
"\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
"class[ \t]+"
;; Uncomment if you want to find these too. It will be a bit slower gathering
;; the indexes.
; ("Prototypes"
-; (,
+; (,
; (concat
; "^" ; beginning of line is required
; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right?
-
+
; "\\(" ; last type spec including */&
; "[a-zA-Z0-9_:]+"
; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace
; "\\)?" ; if there is a last type spec
; "\\(" ; name; take that into the imenu entry
; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor...
-; ; (may not contain * because then
+; ; (may not contain * because then
; ; "a::operator char*" would become "char*"!)
; "\\|"
; "\\([a-zA-Z0-9_:~]*::\\)?operator"
; ; the (...) Can't
; ; catch cases with () inside the parentheses
; ; surrounding the parameters
-; ; (like "int foo(int a=bar());"
-; )) 6)
+; ; (like "int foo(int a=bar());"
+; )) 6)
; ("Struct"
; (, (concat
; "^" ; beginning of line is required
(paragraph-start
;; Lines containing just a comment start or just an end
;; should not be filled into paragraphs they are next to.
- (concat
+ (concat
paragraph-start
"\\|[ \t]*/\\*[ \t]*$\\|[ \t]*\\*/[ \t]*$\\|[ \t/*]*$"))
(paragraph-separate
(paragraph-start
;; Lines containing just a comment start or just an end
;; should not be filled into paragraphs they are next to.
- (concat
+ (concat
paragraph-start
"\\|[ \t]*/\\*[ \t]*$\\|[ \t]*\\*/[ \t]*$\\|[ \t/*]*$"))
(paragraph-separate
(if comment-start-place
(goto-char comment-start-place)
(search-backward "/*"))
- ;; Protect text before the comment start
- ;; by excluding it. Add spaces to bring back
+ ;; Protect text before the comment start
+ ;; by excluding it. Add spaces to bring back
;; proper indentation of that point.
(let ((column (current-column)))
(prog1 (point)
;; The first following code counts
;; if it is before the line we want to indent.
(and (< (point) indent-point)
- (-
+ (-
(if (> colon-line-end (point))
(- (current-indentation) c-label-offset)
(current-column))
(not (re-search-forward "[;{}]" end t)))))))
(re-search-backward "[;}]")
(forward-char 1))
- (error
+ (error
(let ((beg (point)))
(backward-up-list -1)
(let ((end (point)))
With no argument, inserts backslashes and aligns existing backslashes.
With an argument, deletes the backslashes.
-This function does not modify the last line of the region if the region ends
+This function does not modify the last line of the region if the region ends
right at the start of the following line; it does not modify blank lines
at the start of the region. So you can put the region around an entire macro
definition and conveniently use this command."
(setq count (+ count increment))))
(push-mark)
(goto-char new)))
+\f
+(provide 'c-mode)
;;; c-mode.el ends here