all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13871: Add new C++11 keywords to c++-mode
@ 2013-03-05  1:26 Michael Shields
  2014-11-18 16:48 ` Rüdiger Sonderfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Shields @ 2013-03-05  1:26 UTC (permalink / raw)
  To: 13871

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

This small patch adds c++-mode support for new C++11 keywords.

My employer, Google, has a copyright assignment on file.


2013-03-04  Michael Shields  <shields@msrl.com>

	* lisp/progmodes/cc-langs.el: Add support for new C++11 keywords
	"alignas", "alignof", "constexpr", "decltype", "nullptr", and
	"thread_local".

[-- Attachment #2: c++11.diff --]
[-- Type: application/octet-stream, Size: 1922 bytes --]

diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 0d5549e..a50152f 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -973,7 +973,8 @@ since CC Mode treats every identifier as an expression."
 
       ;; Unary.
       (prefix "++" "--" "+" "-" "!" "~"
-	      ,@(when (c-major-mode-is 'c++-mode) '("not" "compl"))
+	      ,@(when (c-major-mode-is 'c++-mode)
+                  '("not" "compl" "alignas" "alignof" "decltype"))
 	      ,@(when (c-major-mode-is '(c-mode c++-mode))
 		  '("*" "&" "sizeof" "??-"))
 	      ,@(when (c-major-mode-is 'objc-mode)
@@ -1676,7 +1677,7 @@ but they don't build a type of themselves.  Unlike the keywords on
 not the type face."
   t    nil
   c    '("const" "restrict" "volatile")
-  c++  '("const" "volatile" "throw")
+  c++  '("const" "constexpr" "throw" "volatile")
   objc '("const" "volatile"))
 
 (c-lang-defconst c-opt-type-modifier-key
@@ -1857,7 +1858,8 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
 will be handled."
   t    nil
   (c c++) '("auto" "extern" "inline" "register" "static")
-  c++  (append '("explicit" "friend" "mutable" "template" "using" "virtual")
+  c++  (append '("explicit" "friend" "mutable" "template" "thread_local" "using"
+                 "virtual")
 	       (c-lang-const c-modifier-kwds))
   objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static")
   ;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead.
@@ -2293,6 +2295,7 @@ This construct is \"<keyword> <expression> :\"."
   t       nil
   (c c++) '("NULL" ;; Not a keyword, but practically works as one.
 	    "false" "true")		; Defined in C99.
+  c++     '("NULL" "nullptr" "false" "true")
   objc    '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
   idl     '("TRUE" "FALSE")
   java    '("true" "false" "null") ; technically "literals", not keywords

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#13871: Add new C++11 keywords to c++-mode
  2013-03-05  1:26 bug#13871: Add new C++11 keywords to c++-mode Michael Shields
@ 2014-11-18 16:48 ` Rüdiger Sonderfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Rüdiger Sonderfeld @ 2014-11-18 16:48 UTC (permalink / raw)
  To: 13871-done

A similar patch has been merged into Emacs master

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0b37f903b62b29726644dbad330d2a0bf91d85d6






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-18 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05  1:26 bug#13871: Add new C++11 keywords to c++-mode Michael Shields
2014-11-18 16:48 ` Rüdiger Sonderfeld

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.