X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=setup%2Femacsstuff.el;h=9f8764a9d9495d9196b335a403fea6b65facc458;hb=a3cc80e69cdad940bd67c706e40f7f749291496a;hp=cddd38c9043cf97be3f5160d1f5174d0bd147c75;hpb=32d555442b43d5849735ee64fb7f7bdde68c9c2e;p=emacs-init.git diff --git a/setup/emacsstuff.el b/setup/emacsstuff.el index cddd38c..9f8764a 100644 --- a/setup/emacsstuff.el +++ b/setup/emacsstuff.el @@ -36,3 +36,16 @@ (if match (message "compilation-error-regexp-alist-alist key: %s" match) (error "no error line at point")))))) + +(defun c++-mode-update-font-lock-keywords () + (font-lock-add-keywords + nil '(;; complete some fundamental keywords + ;; add the new C++11 keywords + ("\\<\\(alignof\\|alignas\\|constexpr\\|decltype\\|noexcept\\|nullptr\\|static_assert\\|thread_local\\|override\\|final\\)\\>" . font-lock-keyword-face) + ("\\<\\(char[0-9]+_t\\)\\>" . font-lock-keyword-face) + ;; hexadecimal numbers + ("\\<0[xX][0-9A-Fa-f]+\\>" . font-lock-constant-face) + ;; integer/float/scientific numbers + ("\\<[\\-+]*[0-9]*\\.?[0-9]+\\([ulUL]+\\|[eE][\\-+]?[0-9]+\\)?\\>" . font-lock-constant-face)))) + +(add-hook 'c++-mode-hook 'c++-mode-update-font-lock-keywords t)