unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* font lock in gdb-script mode
@ 2003-07-23 13:18 Masatake YAMATO
  2003-07-23 13:32 ` Stefan Monnier
  2003-07-23 13:47 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: Masatake YAMATO @ 2003-07-23 13:18 UTC (permalink / raw


I've modified font lock related code in gdb-script-mode a bit.
Please, review my small patch.

2003-07-23  Masatake YAMATO  <jet@gyve.org>

	* progmodes/gud.el (gdb-script-font-lock-keywords): 
	Put `font-lock-function-name-face' on a symbol which includes
	`-' like `hook-run'. Put `font-lock-function-name-face' on
	a symbol after `document'. Put font-lock-variable-name-face 
	on a symbol starting with $.


Index: lisp/progmodes/gud.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gud.el,v
retrieving revision 1.3
diff -u -r1.3 gud.el
--- lisp/progmodes/gud.el	18 Jun 2003 23:26:28 -0000	1.3
+++ lisp/progmodes/gud.el	23 Jul 2003 13:10:51 -0000
@@ -2892,7 +2892,9 @@
     st))
 
 (defvar gdb-script-font-lock-keywords
-  '(("^define\\s-+\\(\\w+\\)" (1 font-lock-function-name-face))
+  '(("^define\\s-+\\(\\(\\w\\|-\\)+\\)" (1 font-lock-function-name-face))
+    ("^document\\s-+\\(\\(\\w\\|-\\)+\\)" (1 font-lock-function-name-face))
+    ("$\\(\\w+\\)" (1 font-lock-variable-name-face))
     ("^\\s-*\\([a-z]+\\)" (1 font-lock-keyword-face))))
 
 (defvar gdb-script-font-lock-syntactic-keywords

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

* Re: font lock in gdb-script mode
  2003-07-23 13:18 font lock in gdb-script mode Masatake YAMATO
@ 2003-07-23 13:32 ` Stefan Monnier
  2003-07-24 19:59   ` Richard Stallman
  2003-07-23 13:47 ` Andreas Schwab
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2003-07-23 13:32 UTC (permalink / raw
  Cc: emacs-devel

> I've modified font lock related code in gdb-script-mode a bit.
> Please, review my small patch.
> 
> 2003-07-23  Masatake YAMATO  <jet@gyve.org>
> 
> 	* progmodes/gud.el (gdb-script-font-lock-keywords): 
> 	Put `font-lock-function-name-face' on a symbol which includes
> 	`-' like `hook-run'. Put `font-lock-function-name-face' on
> 	a symbol after `document'. Put font-lock-variable-name-face 
> 	on a symbol starting with $.
> 
> 
> Index: lisp/progmodes/gud.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gud.el,v
> retrieving revision 1.3
> diff -u -r1.3 gud.el
> --- lisp/progmodes/gud.el	18 Jun 2003 23:26:28 -0000	1.3
> +++ lisp/progmodes/gud.el	23 Jul 2003 13:10:51 -0000
> @@ -2892,7 +2892,9 @@
>      st))
>  
>  (defvar gdb-script-font-lock-keywords
> -  '(("^define\\s-+\\(\\w+\\)" (1 font-lock-function-name-face))
> +  '(("^define\\s-+\\(\\(\\w\\|-\\)+\\)" (1 font-lock-function-name-face))

Looks good (maybe we should use \\s_ instead of -, tho).

> +    ("^document\\s-+\\(\\(\\w\\|-\\)+\\)" (1 font-lock-function-name-face))

I must say I consciously did not do it, because I liked the fact
that the function-name face was only put on the definition (I always
put the documentation right next to it, so highlighting it a second
time there is not helpful).

> +    ("$\\(\\w+\\)" (1 font-lock-variable-name-face))

Sounds good.


	Stefan

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

* Re: font lock in gdb-script mode
  2003-07-23 13:18 font lock in gdb-script mode Masatake YAMATO
  2003-07-23 13:32 ` Stefan Monnier
@ 2003-07-23 13:47 ` Andreas Schwab
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2003-07-23 13:47 UTC (permalink / raw
  Cc: emacs-devel

Masatake YAMATO <jet@gyve.org> writes:

|> +    ("$\\(\\w+\\)" (1 font-lock-variable-name-face))

Please quote $ explicitly instead of depending on its context sensitive
interpretation.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: font lock in gdb-script mode
  2003-07-23 13:32 ` Stefan Monnier
@ 2003-07-24 19:59   ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2003-07-24 19:59 UTC (permalink / raw
  Cc: jet, emacs-devel

Could you install the good parts of this patch?

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

end of thread, other threads:[~2003-07-24 19:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-23 13:18 font lock in gdb-script mode Masatake YAMATO
2003-07-23 13:32 ` Stefan Monnier
2003-07-24 19:59   ` Richard Stallman
2003-07-23 13:47 ` Andreas Schwab

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).