unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* font-lock in machine mode of gdba
@ 2004-10-17 15:29 Masatake YAMATO
  2004-10-17 16:55 ` Stefan Monnier
  2004-10-18  2:25 ` Nick Roberts
  0 siblings, 2 replies; 14+ messages in thread
From: Masatake YAMATO @ 2004-10-17 15:29 UTC (permalink / raw)


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  <jet@gyve.org>

	* 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 ()

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

end of thread, other threads:[~2004-10-23 23:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-17 15:29 font-lock in machine mode of gdba Masatake YAMATO
2004-10-17 16:55 ` Stefan Monnier
2004-10-18  2:14   ` Nick Roberts
2004-10-18  2:25 ` Nick Roberts
2004-10-19  2:26   ` Masatake YAMATO
2004-10-19 12:45     ` Stefan Monnier
2004-10-21 10:53       ` Nick Roberts
2004-10-19 13:28     ` Nick Roberts
2004-10-19 13:54       ` Stefan Monnier
2004-10-19 14:27         ` Masatake YAMATO
2004-10-19 16:38       ` Masatake YAMATO
2004-10-23 22:09         ` Nick Roberts
2004-10-23 23:49           ` Masatake YAMATO
2004-10-23 23:59             ` Nick Roberts

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).