unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <jet@gyve.org>
Subject: font-lock in machine mode of gdba
Date: Mon, 18 Oct 2004 00:29:30 +0900 (JST)	[thread overview]
Message-ID: <20041018.002930.45492341.jet@gyve.org> (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 ()

             reply	other threads:[~2004-10-17 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-17 15:29 Masatake YAMATO [this message]
2004-10-17 16:55 ` font-lock in machine mode of gdba 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041018.002930.45492341.jet@gyve.org \
    --to=jet@gyve.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).