diff options
author | Yao Qi <yao@codesourcery.com> | 2012-04-29 07:20:43 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-04-29 07:20:43 +0000 |
commit | 5977971a97987fb6dcbbc93c045f3cad2b2a1e31 (patch) | |
tree | 68084afbf4487d8433aaf468673350f6c4a6deec /gdb/gdb-code-style.el | |
parent | 2746b0ef8d19af621cc96319fe26e14fc21b559d (diff) | |
download | gdb-5977971a97987fb6dcbbc93c045f3cad2b2a1e31.zip gdb-5977971a97987fb6dcbbc93c045f3cad2b2a1e31.tar.gz gdb-5977971a97987fb6dcbbc93c045f3cad2b2a1e31.tar.bz2 |
gdb:
* gdb-code-style.el: New hook gdb-markup-hook
and gdb-comment-hook.
Diffstat (limited to 'gdb/gdb-code-style.el')
-rw-r--r-- | gdb/gdb-code-style.el | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/gdb/gdb-code-style.el b/gdb/gdb-code-style.el index 5897831..28028e6 100644 --- a/gdb/gdb-code-style.el +++ b/gdb/gdb-code-style.el @@ -45,4 +45,33 @@ (add-hook 'c-mode-common-hook 'gdb-include-hook) -;;; gdb-code-style.el ends here
\ No newline at end of file +;; Check marker up. If the marker up is missing, like, +;; warning ("abc"); +;; The '(' and '"' will be highlight. +(defun gdb-markup-hook () + (font-lock-add-keywords + nil + '(("\\<\\(warning\\|error\\)[ ]*\\(\([^_]\\)" 2 font-lock-warning-face t)))) + +(add-hook 'c-mode-common-hook 'gdb-markup-hook) + +(defun gdb-comment-hook () + ;; A space should follow "/*", otherwise report a warning. + ;; If the comment is like: + ;; /*F. */ + ;; The 'F' will be highlight. + (font-lock-add-keywords + nil + '(("/\\*\\([^ ]\\).*\\*/" 1 font-lock-warning-face t))) + ;; Two spaces are needed between "." and "*/". Report warning if there + ;; is no space (".*/") or only one space (". */"). + ;; If the comment is like: + ;; /* ABC. */ or /* ABC.*/ + ;; the '.' is highlight. + (font-lock-add-keywords + nil + '(("\\<[[:ascii:]]*\\(\\.[ ]?\\)\\*/" 1 font-lock-warning-face t))) + ) +(add-hook 'c-mode-common-hook 'gdb-comment-hook) + +;;; gdb-code-style.el ends here |