-;;; c++-mode.el --- C++ code editing commands for Emacs
-;;; Copyright (C) 1985, 1992 Free Software Foundation, Inc.
+;;; cplus-md.el --- C++ code editing commands for Emacs
+;;; Copyright (C) 1985, 1992, 1994 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; Fixed handling of "default:", where ":" was the last character in the
;; buffer. Fixed indentation of comments starting in column 0, and when
;; previous line contained more than one comment start string. Fixed
-;; handling of "friend class".
+;; handling of "friend".
;;
;; Aug 7, 1989; John Hagerman (hagerman@ece.cmu.edu):
;; Changed calculate-c++-indent to handle member initializations
(if c++-mode-syntax-table
()
(setq c++-mode-syntax-table (copy-syntax-table c-mode-syntax-table))
- (modify-syntax-entry ?/ ". 12" c++-mode-syntax-table)
- (modify-syntax-entry ?\n ">" c++-mode-syntax-table)
- (modify-syntax-entry ?\' "." c++-mode-syntax-table))
+ (modify-syntax-entry ?* ". 23b" c++-mode-syntax-table)
+ (modify-syntax-entry ?/ ". 124" c++-mode-syntax-table)
+ (modify-syntax-entry ?\n ">" c++-mode-syntax-table))
(defvar c++-continued-member-init-offset nil
"*Extra indent for continuation lines of member inits;
(defvar c++-member-init-indent 0
"*Indentation level of member initializations in function declarations.")
(defvar c++-friend-offset -4
- "*Offset of C++ friend class declarations relative to member declarations.")
+ "*Offset of C++ friend declarations relative to member declarations.")
(defvar c++-electric-colon t
"*If t, colon is an electric terminator.")
(defvar c++-empty-arglist-indent nil
left paren is indented this many extra spaces, instead of flush with the
left paren.
c++-friend-offset
- Offset of C++ friend class declarations relative to member declarations.
+ Offset of C++ friend declarations relative to member declarations.
c++-member-init-indent
Indentation level of member initializations in function declarations,
if they are on a separate line beginning with a colon.
(set (make-local-variable 'paragraph-separate) paragraph-start)
(set (make-local-variable 'paragraph-ignore-fill-prefix) t)
(set (make-local-variable 'require-final-newline) t)
- (set (make-local-variable 'parse-sexp-ignore-comments) nil)
+ (set (make-local-variable 'parse-sexp-ignore-comments) t)
(run-hooks 'c++-mode-hook)
(if c++-electric-colon
(define-key c++-mode-map ":" 'electric-c++-terminator)))
(setq indent (save-excursion
(c-backward-to-start-of-if)
(current-indentation))))
- ((looking-at "friend\[ \t]class[ \t]")
+ ((looking-at "friend\[ \t]")
(setq indent (+ indent c++-friend-offset)))
((= (following-char) ?})
(setq indent (- indent c-indent-level)))
"#\\|/\\*\\|//"
"\\|case[ \t]"
"\\|[a-zA-Z0-9_$]*:[^:]"
- "\\|friend[ \t]class[ \t]")))
+ "\\|friend[ \t]")))
;; Skip over comments and labels following openbrace.
(cond ((= (following-char) ?\#)
(forward-line 1))
((looking-at "/\\*")
(search-forward "*/" nil 'move))
- ((looking-at "//\\|friend[ \t]class[ \t]")
+ ((looking-at "//\\|friend[ \t]")
(forward-line 1))
(t
(re-search-forward ":[^:]" nil 'move))))
(forward-sexp 1)
(looking-at ":[^:]"))))
(setq this-indent (max 1 (+ this-indent c-label-offset))))
- (if (looking-at "friend[ \t]class[ \t]")
+ (if (looking-at "friend[ \t]")
(setq this-indent (+ this-indent c++-friend-offset)))
(if (= (following-char) ?\})
(setq this-indent (- this-indent c-indent-level)))
;;
;; ; overloadable operators
;; (op-sym1
-;; "[---+*/%^&|~!=<>]\\|[---+*/%^&|<>=!]=\\|<<=?\\|>>=?")
+;; "[-+*/%^&|~!=<>]\\|[-+*/%^&|<>=!]=\\|<<=?\\|>>=?")
;; (op-sym2
;; "&&\\|||\\|\\+\\+\\|--\\|()\\|\\[\\]")
;; (op-sym (concat "\\(" op-sym1 "\\|" op-sym2 "\\)"))
;; (beginning-of-line 1)))
;; (goto-char restore)))
-;;; c++-mode.el ends here
+;;; cplus-md.el ends here