Fix issues with deriving too much from c++-mode

This commit is contained in:
xeals 2019-07-06 21:47:59 +10:00
parent 424e721d64
commit f10cee0930

View File

@ -298,7 +298,8 @@ Each list item should be a regexp matching a single identifier."
;; syntactic context, and which therefore should trig reindentation
;; when they are completed.
'(("else" "else" c-electric-continued-statement 0)
("while" "while" c-electric-continued-statement 0)))
("while" "while" c-electric-continued-statement 0)
("catch" "catch" c-electric-continued-statement 0)))
(defvar cuda-mode-map (let ((map (c-make-inherited-keymap)))
;; Add bindings which are only useful for CUDA
@ -314,8 +315,7 @@ Each list item should be a regexp matching a single identifier."
(cons "CUDA" (c-lang-const c-mode-menu cuda)))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.cu\\'" . cuda-mode))
(add-to-list 'auto-mode-alist '("\\.cuh\\'" . cuda-mode))
(add-to-list 'auto-mode-alist '("\\.cuh?\\'" . cuda-mode))
;;;###autoload
(define-derived-mode cuda-mode prog-mode "CUDA" ()
@ -329,14 +329,12 @@ initialization, then `cuda-mode-hook'.
Key bindings:
\\{cuda-mode-map}"
(c-initialize-cc-mode t)
(set-syntax-table cuda-mode-syntax-table)
(setq local-abbrev-table cuda-mode-abbrev-table
abbrev-mode t)
(setq abbrev-mode t)
(use-local-map c-mode-map)
;; `c-init-language-vars' is a macro that is expanded at compile
;; time to a large `setq' with all the language variables and their
;; customized values for our language.
(c-init-language-vars-for 'cuda-mode)
(c-init-language-vars cuda-mode)
;; `c-common-init' initializes most of the components of a CC Mode
;; buffer, including setup of the mode menu, font-lock, etc.
;; There's also a lower level routine `c-basic-common-init' that