* Want to highlight function calls in c-mode
@ 2004-06-24 16:41 John
2004-06-25 18:19 ` Kevin Rodgers
0 siblings, 1 reply; 2+ messages in thread
From: John @ 2004-06-24 16:41 UTC (permalink / raw)
I am faced with a very hairy program and would greatly benefit from
having the actual function calls highlighted. I have not been able to
figure out how to do this however, nor have I located any mention of
anything that already does this.
Please help if you can.
Thanks All,
John Fierke
w o r k AT-SIGN myLastName DOTT COMM
PS - I relocated this to the bottom. I figured I shouldn't open with
it, but I still wanted to vent :
"OK...Google's interface ticks me off. I had a message all typed but
I chose to click their "Posing Style Guide" before I sent it -- POOF!
It completely Toasted everything I typed. They could at least warn me
or open the stupid thing in a different window. GRRRRRRRRRRRRRRRRR"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Want to highlight function calls in c-mode
2004-06-24 16:41 Want to highlight function calls in c-mode John
@ 2004-06-25 18:19 ` Kevin Rodgers
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2004-06-25 18:19 UTC (permalink / raw)
John wrote:
> I am faced with a very hairy program and would greatly benefit from
> having the actual function calls highlighted. I have not been able to
> figure out how to do this however, nor have I located any mention of
> anything that already does this.
>
> Please help if you can.
Here's what font-lock.el suggests:
;;; Adding patterns for modes that already support Font Lock:
;; Though Font Lock highlighting patterns already exist for many modes, it's
;; likely there's something that you want fontified that currently isn't, even
;; at the maximum fontification level. You can add highlighting patterns via
;; `font-lock-add-keywords'. For example, say in some C
;; header file you #define the token `and' to expand to `&&', etc., to make
;; your C code almost readable. In your ~/.emacs there could be:
;;
;; (font-lock-add-keywords 'c-mode '("\\<\\(and\\|or\\|not\\)\\>"))
;;
;; Some modes provide specific ways to modify patterns based on the values of
;; other variables. For example, additional C types can be specified via the
;; variable `c-font-lock-extra-types'.
;;; Adding patterns for modes that do not support Font Lock:
;; Not all modes support Font Lock mode. If you (as a user of the mode) add
;; patterns for a new mode, you must define in your ~/.emacs a variable or
;; variables that specify regexp fontification. Then, you should indicate to
;; Font Lock mode, via the mode hook setting `font-lock-defaults', exactly what
;; support is required. For example, say Foo mode should have the following
;; regexps fontified case-sensitively, and comments and strings should not be
;; fontified automagically. In your ~/.emacs there could be:
;;
;; (defvar foo-font-lock-keywords
;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face)
;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face))
;; "Default expressions to highlight in Foo mode.")
;;
;; (add-hook 'foo-mode-hook
;; (function (lambda ()
;; (make-local-variable 'font-lock-defaults)
;; (setq font-lock-defaults '(foo-font-lock-keywords t)))))
> PS - I relocated this to the bottom. I figured I shouldn't open with
> it, but I still wanted to vent :
>
> "OK...Google's interface ticks me off. I had a message all typed but
> I chose to click their "Posing Style Guide" before I sent it -- POOF!
> It completely Toasted everything I typed. They could at least warn me
> or open the stupid thing in a different window. GRRRRRRRRRRRRRRRRR"
Whenever I have to compose text for a web browser, I use Emacs and then
cut-and-paste it into the HTML form, to protect me from browser crashes
(which are much more frequent than emacs crashes). In fact, that's what
I'm doing right now, and I have a dedicated buffer for that purpose:
(pop-to-buffer (get-buffer-create "*Text*"))
(or (eq major-mode 'text-mode)
(text-mode))
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-25 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-24 16:41 Want to highlight function calls in c-mode John
2004-06-25 18:19 ` Kevin Rodgers
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).