aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/cc-mode.el52
1 files changed, 27 insertions, 25 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 6194092533a..69bf72b258e 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -596,6 +596,17 @@ Note that the style variables are always made local to the buffer."
596;; doing this on load. That since `add-to-list' prepends the value 596;; doing this on load. That since `add-to-list' prepends the value
597;; which could cause it to clobber user settings. Later emacsen have 597;; which could cause it to clobber user settings. Later emacsen have
598;; an append option, but it's not safe to use. 598;; an append option, but it's not safe to use.
599
600;; The the extension ".C" is associated to C++ while the lowercase
601;; variant goes to C. On case insensitive file systems, this means
602;; that ".c" files also might open C++ mode if the C++ entry comes
603;; first on `auto-mode-alist'. Thus we try to ensure that ".C" comes
604;; after ".c", and since `add-to-list' adds the entry first we have to
605;; add the ".C" entry first.
606;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(cc\\|hh\\)\\'" . c++-mode))
607;;;###autoload (add-to-list 'auto-mode-alist '("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode))
608;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(CC?\\|HH?\\)\\'" . c++-mode))
609
599;;;###autoload (add-to-list 'auto-mode-alist '("\\.[ch]\\'" . c-mode)) 610;;;###autoload (add-to-list 'auto-mode-alist '("\\.[ch]\\'" . c-mode))
600 611
601;; NB: The following two associate yacc and lex files to C Mode, which 612;; NB: The following two associate yacc and lex files to C Mode, which
@@ -613,7 +624,7 @@ Note that the style variables are always made local to the buffer."
613To submit a problem report, enter `\\[c-submit-bug-report]' from a 624To submit a problem report, enter `\\[c-submit-bug-report]' from a
614c-mode buffer. This automatically sets up a mail buffer with version 625c-mode buffer. This automatically sets up a mail buffer with version
615information already added. You just need to add a description of the 626information already added. You just need to add a description of the
616problem, including a reproducible test case and send the message. 627problem, including a reproducible test case, and send the message.
617 628
618To see what version of CC Mode you are running, enter `\\[c-version]'. 629To see what version of CC Mode you are running, enter `\\[c-version]'.
619 630
@@ -670,10 +681,6 @@ Key bindings:
670(easy-menu-define c-c++-menu c++-mode-map "C++ Mode Commands" 681(easy-menu-define c-c++-menu c++-mode-map "C++ Mode Commands"
671 (cons "C++" (c-lang-const c-mode-menu c++))) 682 (cons "C++" (c-lang-const c-mode-menu c++)))
672 683
673;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(cc\\|hh\\)\\'" . c++-mode))
674;;;###autoload (add-to-list 'auto-mode-alist '("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode))
675;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(CC?\\|HH?\\)\\'" . c++-mode))
676
677;;;###autoload 684;;;###autoload
678(defun c++-mode () 685(defun c++-mode ()
679 "Major mode for editing C++ code. 686 "Major mode for editing C++ code.
@@ -816,7 +823,7 @@ Key bindings:
816To submit a problem report, enter `\\[c-submit-bug-report]' from a 823To submit a problem report, enter `\\[c-submit-bug-report]' from a
817java-mode buffer. This automatically sets up a mail buffer with 824java-mode buffer. This automatically sets up a mail buffer with
818version information already added. You just need to add a description 825version information already added. You just need to add a description
819of the problem, including a reproducible test case and send the 826of the problem, including a reproducible test case, and send the
820message. 827message.
821 828
822To see what version of CC Mode you are running, enter `\\[c-version]'. 829To see what version of CC Mode you are running, enter `\\[c-version]'.
@@ -929,8 +936,8 @@ Key bindings:
929(easy-menu-define c-pike-menu pike-mode-map "Pike Mode Commands" 936(easy-menu-define c-pike-menu pike-mode-map "Pike Mode Commands"
930 (cons "Pike" (c-lang-const c-mode-menu pike))) 937 (cons "Pike" (c-lang-const c-mode-menu pike)))
931 938
932;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(pike\\|pmod\\(.in\\)?\\)\\'" . pike-mode)) 939;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(u?lpc\\|pike\\|pmod\\(.in\\)?\\)\\'" . pike-mode))
933;;;###autoload (add-to-list 'interpreter-mode-alist '(("pike" . pike-mode))) 940;;;###autoload (add-to-list 'interpreter-mode-alist '("pike" . pike-mode))
934 941
935;;;###autoload 942;;;###autoload
936(defun pike-mode () 943(defun pike-mode ()
@@ -969,18 +976,19 @@ Key bindings:
969;; Support for awk. This is purposely disabled for older (X)Emacsen which 976;; Support for awk. This is purposely disabled for older (X)Emacsen which
970;; don't support syntax-table properties. 977;; don't support syntax-table properties.
971 978
972(if (not (memq 'syntax-properties c-emacs-features)) 979;;;###autoload (add-to-list 'auto-mode-alist '("\\.awk\\'" . awk-mode))
973 (autoload 'awk-mode "awk-mode.el" "Major mode for editing AWK code. 980;;;###autoload (add-to-list 'interpreter-mode-alist '("awk" . awk-mode))
974To submit a problem report, enter `\\[c-submit-bug-report]' from an 981;;;###autoload (add-to-list 'interpreter-mode-alist '("mawk" . awk-mode))
975awk-mode buffer. This automatically sets up a mail buffer with version 982;;;###autoload (add-to-list 'interpreter-mode-alist '("nawk" . awk-mode))
976information already added. You just need to add a description of the 983;;;###autoload (add-to-list 'interpreter-mode-alist '("gawk" . awk-mode))
977problem, including a reproducible test case and send the message.
978 984
979To see what version of CC Mode you are running, enter `\\[c-version]'. 985;;; Autoload directives must be on the top level, so we construct an
986;;; autoload form instead.
987;;;###autoload (autoload 'awk-mode "cc-mode" "Major mode for editing AWK code.")
988
989(if (not (memq 'syntax-properties c-emacs-features))
990 (autoload 'awk-mode "awk-mode" "Major mode for editing AWK code." t)
980 991
981The hook `c-mode-common-hook' is run with no args at mode
982initialization, then `awk-mode-hook'.
983" t)
984 (defvar awk-mode-abbrev-table nil 992 (defvar awk-mode-abbrev-table nil
985 "Abbreviation table used in awk-mode buffers.") 993 "Abbreviation table used in awk-mode buffers.")
986 (c-define-abbrev-table 'awk-mode-abbrev-table 994 (c-define-abbrev-table 'awk-mode-abbrev-table
@@ -1007,18 +1015,12 @@ initialization, then `awk-mode-hook'.
1007 (easy-menu-define c-awk-menu awk-mode-map "AWK Mode Commands" 1015 (easy-menu-define c-awk-menu awk-mode-map "AWK Mode Commands"
1008 (cons "AWK" (c-lang-const c-mode-menu awk))) 1016 (cons "AWK" (c-lang-const c-mode-menu awk)))
1009 1017
1010;; In XEmacs >= 21.5 modes should add their own entries to
1011;; `auto-mode-alist' and `interpreter-mode-alist'.
1012;;;###autoload (add-to-list 'auto-mode-alist '("\\.awk\\'" . awk-mode))
1013;;;###autoload (add-to-list 'interpreter-mode-alist '(("awk" . awk-mode) ("mawk" . awk-mode) ("nawk" . awk-mode) ("gawk" . awk-mode)))
1014
1015;;;###autoload
1016 (defun awk-mode () 1018 (defun awk-mode ()
1017 "Major mode for editing AWK code. 1019 "Major mode for editing AWK code.
1018To submit a problem report, enter `\\[c-submit-bug-report]' from an 1020To submit a problem report, enter `\\[c-submit-bug-report]' from an
1019awk-mode buffer. This automatically sets up a mail buffer with version 1021awk-mode buffer. This automatically sets up a mail buffer with version
1020information already added. You just need to add a description of the 1022information already added. You just need to add a description of the
1021problem, including a reproducible test case and send the message. 1023problem, including a reproducible test case, and send the message.
1022 1024
1023To see what version of CC Mode you are running, enter `\\[c-version]'. 1025To see what version of CC Mode you are running, enter `\\[c-version]'.
1024 1026