summaryrefslogtreecommitdiff
path: root/gdb/gdb-code-style.el
diff options
context:
space:
mode:
authorqiyao <qiyao>2012-04-29 07:20:40 +0000
committerqiyao <qiyao>2012-04-29 07:20:40 +0000
commit1c69b540334ac77b256e39ac2ef79a64c539f193 (patch)
tree87fd6e09206d4c5e93349b51e18f0733d130e982 /gdb/gdb-code-style.el
parent83214202be96a1aaa9f7280a4bebbcb82fd0e7b6 (diff)
downloadgdb-1c69b540334ac77b256e39ac2ef79a64c539f193.tar.gz
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.el31
1 files changed, 30 insertions, 1 deletions
diff --git a/gdb/gdb-code-style.el b/gdb/gdb-code-style.el
index 58978312e94..28028e6aa34 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