From: Chong Yidong Date: Sat, 28 May 2011 17:16:54 +0000 (-0400) Subject: Make CC modes inherit from prog-mode. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d43eaf2c3cfa8cc8b1272f75db5b705540307e2d;p=emacs.git Make CC modes inherit from prog-mode. * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode) (idl-mode, pike-mode, awk-mode): Inherit from prog-mode. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b55fb4bba2..88289fc1656 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-05-28 Chong Yidong + + * progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode) + (idl-mode, pike-mode, awk-mode): Inherit from prog-mode. + 2011-05-28 Stefan Monnier * minibuffer.el (completion--capf-wrapper): Check applicability before diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 1a2e0027ea7..3a5a643a2a8 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1174,7 +1174,7 @@ This does not load the font-lock package. Use after ;;;###autoload -(defun c-mode () +(define-derived-mode c-mode prog-mode "C" "Major mode for editing K&R and ANSI C code. To submit a problem report, enter `\\[c-submit-bug-report]' from a c-mode buffer. This automatically sets up a mail buffer with version @@ -1188,13 +1188,9 @@ initialization, then `c-mode-hook'. Key bindings: \\{c-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table c-mode-syntax-table) - (setq major-mode 'c-mode ; FIXME: Use define-derived-mode. - mode-name "C" - local-abbrev-table c-mode-abbrev-table + (setq local-abbrev-table c-mode-abbrev-table abbrev-mode t) (use-local-map c-mode-map) (c-init-language-vars-for 'c-mode) @@ -1236,7 +1232,7 @@ Key bindings: (cons "C++" (c-lang-const c-mode-menu c++))) ;;;###autoload -(defun c++-mode () +(define-derived-mode c++-mode prog-mode "C++" "Major mode for editing C++ code. To submit a problem report, enter `\\[c-submit-bug-report]' from a c++-mode buffer. This automatically sets up a mail buffer with @@ -1251,13 +1247,9 @@ initialization, then `c++-mode-hook'. Key bindings: \\{c++-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table c++-mode-syntax-table) - (setq major-mode 'c++-mode ; FIXME: Use define-derived-mode. - mode-name "C++" - local-abbrev-table c++-mode-abbrev-table + (setq local-abbrev-table c++-mode-abbrev-table abbrev-mode t) (use-local-map c++-mode-map) (c-init-language-vars-for 'c++-mode) @@ -1297,7 +1289,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.m\\'" . objc-mode)) ;;;###autoload -(defun objc-mode () +(define-derived-mode objc-mode prog-mode "ObjC" "Major mode for editing Objective C code. To submit a problem report, enter `\\[c-submit-bug-report]' from an objc-mode buffer. This automatically sets up a mail buffer with @@ -1312,13 +1304,9 @@ initialization, then `objc-mode-hook'. Key bindings: \\{objc-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table objc-mode-syntax-table) - (setq major-mode 'objc-mode ; FIXME: Use define-derived-mode. - mode-name "ObjC" - local-abbrev-table objc-mode-abbrev-table + (setq local-abbrev-table objc-mode-abbrev-table abbrev-mode t) (use-local-map objc-mode-map) (c-init-language-vars-for 'objc-mode) @@ -1367,7 +1355,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.java\\'" . java-mode)) ;;;###autoload -(defun java-mode () +(define-derived-mode java-mode prog-mode "Java" "Major mode for editing Java code. To submit a problem report, enter `\\[c-submit-bug-report]' from a java-mode buffer. This automatically sets up a mail buffer with @@ -1382,13 +1370,9 @@ initialization, then `java-mode-hook'. Key bindings: \\{java-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table java-mode-syntax-table) - (setq major-mode 'java-mode ; FIXME: Use define-derived-mode. - mode-name "Java" - local-abbrev-table java-mode-abbrev-table + (setq local-abbrev-table java-mode-abbrev-table abbrev-mode t) (use-local-map java-mode-map) (c-init-language-vars-for 'java-mode) @@ -1426,7 +1410,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.idl\\'" . idl-mode)) ;;;###autoload -(defun idl-mode () +(define-derived-mode idl-mode prog-mode "IDL" "Major mode for editing CORBA's IDL, PSDL and CIDL code. To submit a problem report, enter `\\[c-submit-bug-report]' from an idl-mode buffer. This automatically sets up a mail buffer with @@ -1441,13 +1425,9 @@ initialization, then `idl-mode-hook'. Key bindings: \\{idl-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table idl-mode-syntax-table) - (setq major-mode 'idl-mode ; FIXME: Use define-derived-mode. - mode-name "IDL" - local-abbrev-table idl-mode-abbrev-table) + (setq local-abbrev-table idl-mode-abbrev-table) (use-local-map idl-mode-map) (c-init-language-vars-for 'idl-mode) (c-common-init 'idl-mode) @@ -1487,7 +1467,7 @@ Key bindings: ;;;###autoload (add-to-list 'interpreter-mode-alist '("pike" . pike-mode)) ;;;###autoload -(defun pike-mode () +(define-derived-mode pike-mode prog-mode "Pike" "Major mode for editing Pike code. To submit a problem report, enter `\\[c-submit-bug-report]' from a pike-mode buffer. This automatically sets up a mail buffer with @@ -1502,13 +1482,9 @@ initialization, then `pike-mode-hook'. Key bindings: \\{pike-mode-map}" - (interactive) - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table pike-mode-syntax-table) - (setq major-mode 'pike-mode ; FIXME: Use define-derived-mode. - mode-name "Pike" - local-abbrev-table pike-mode-abbrev-table + (setq local-abbrev-table pike-mode-abbrev-table abbrev-mode t) (use-local-map pike-mode-map) (c-init-language-vars-for 'pike-mode) @@ -1561,7 +1537,8 @@ Key bindings: (defvar awk-mode-syntax-table) (declare-function c-awk-unstick-NL-prop "cc-awk" ()) -(defun awk-mode () +;;;###autoload +(define-derived-mode awk-mode prog-mode "AWK" "Major mode for editing AWK code. To submit a problem report, enter `\\[c-submit-bug-report]' from an awk-mode buffer. This automatically sets up a mail buffer with version @@ -1575,14 +1552,10 @@ initialization, then `awk-mode-hook'. Key bindings: \\{awk-mode-map}" - (interactive) (require 'cc-awk) ; Added 2003/6/10. - (kill-all-local-variables) (c-initialize-cc-mode t) (set-syntax-table awk-mode-syntax-table) - (setq major-mode 'awk-mode ; FIXME: Use define-derived-mode. - mode-name "AWK" - local-abbrev-table awk-mode-abbrev-table + (setq local-abbrev-table awk-mode-abbrev-table abbrev-mode t) (use-local-map awk-mode-map) (c-init-language-vars-for 'awk-mode)