[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
font-lock in machine mode of gdba
From: |
Masatake YAMATO |
Subject: |
font-lock in machine mode of gdba |
Date: |
Mon, 18 Oct 2004 00:29:30 +0900 (JST) |
I've defined font-lock keywords for `gdb-assembler-mode'. Please,
review the patch. I'm afraid the it is too decorative.
2004-10-18 Masatake YAMATO <address@hidden>
* progmodes/gdb-ui.el (gdb-ann3): Define a key which toggles
source view and assembler view.
(gdb-assembler-font-lock-keywords): New font lock keywords
definition.
(gdb-assembler-mode): Use 'gdb-assembler-font-lock-keywords'.
Index: lisp/progmodes/gdb-ui.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.24
diff -u -r1.24 gdb-ui.el
--- lisp/progmodes/gdb-ui.el 6 Oct 2004 07:20:53 -0000 1.24
+++ lisp/progmodes/gdb-ui.el 17 Oct 2004 15:23:05 -0000
@@ -1939,6 +1947,17 @@
(suppress-keymap map)
map))
+(defconst gdb-assembler-font-lock-keywords
+ '(("\\$?0x*[0-9a-f]+" . font-lock-constant-face)
+ ("<\\([^+>]+\\)\\+[0-9]+>:"
+ 1 font-lock-function-name-face)
+ ("%\\sw+" . font-lock-variable-name-face)
+ ("^\\(Dump of assembler code for function\\) \\(.+\\):"
+ (1 font-lock-comment-face)
+ (2 font-lock-function-name-face))
+ ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
+ "Font lock keywords used in `gdb-assembler-mode'.")
+
(defun gdb-assembler-mode ()
"Major mode for viewing code assembler.
@@ -1951,6 +1970,9 @@
(setq fringes-outside-margins t)
(setq buffer-read-only t)
(use-local-map gdb-assembler-mode-map)
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults '(gdb-assembler-font-lock-keywords))
+ (unless font-lock-mode (font-lock-mode 1))
(gdb-invalidate-assembler))
(defun gdb-assembler-buffer-name ()
- font-lock in machine mode of gdba,
Masatake YAMATO <=
- Re: font-lock in machine mode of gdba, Stefan Monnier, 2004/10/17
- font-lock in machine mode of gdba, Nick Roberts, 2004/10/17
- Re: font-lock in machine mode of gdba, Masatake YAMATO, 2004/10/18
- Re: font-lock in machine mode of gdba, Stefan Monnier, 2004/10/19
- Re: font-lock in machine mode of gdba, Nick Roberts, 2004/10/21
- Re: font-lock in machine mode of gdba, Nick Roberts, 2004/10/19
- Re: font-lock in machine mode of gdba, Stefan Monnier, 2004/10/19
- Re: font-lock in machine mode of gdba, Masatake YAMATO, 2004/10/19
- Re: font-lock in machine mode of gdba, Masatake YAMATO, 2004/10/19