all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* fontlock and imenu problems
@ 2003-02-13 20:19 Javier Oviedo
  2003-02-13 20:48 ` David Kastrup
  0 siblings, 1 reply; 7+ messages in thread
From: Javier Oviedo @ 2003-02-13 20:19 UTC (permalink / raw)


Hello all!

1. I am seeing that sometimes #define/#include and #ifdef/#else/etc. are not
fontified in some c-code that I am looking at. The issue seems to occur only
if the above do not begin in the column zero. There is some code that I must
browse that indents these, especially the #ifdef/etc, and I'd like to see
them fontified and usual. Any help?

2. In Imenu, if a function does not begin in column zero, then imenu does
not "see" it. Again, I am forced to browse other peoples code. Any help?

Thanks in advance.

Javier

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

* Re: fontlock and imenu problems
  2003-02-13 20:19 fontlock and imenu problems Javier Oviedo
@ 2003-02-13 20:48 ` David Kastrup
  2003-02-13 21:39   ` Javier Oviedo
  0 siblings, 1 reply; 7+ messages in thread
From: David Kastrup @ 2003-02-13 20:48 UTC (permalink / raw)


"Javier Oviedo" <email_joviedo@yahoo.com> writes:

> Hello all!
> 
> 1. I am seeing that sometimes #define/#include and #ifdef/#else/etc. are not
> fontified in some c-code that I am looking at. The issue seems to occur only
> if the above do not begin in the column zero. There is some code that I must
> browse that indents these, especially the #ifdef/etc, and I'd like to see
> them fontified and usual. Any help?

There is a reason:

Preprocessing directives are recognized in traditional C only when
their leading # appears in the first column. There can be no
whitespace between the beginning of the line and the #.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: fontlock and imenu problems
  2003-02-13 20:48 ` David Kastrup
@ 2003-02-13 21:39   ` Javier Oviedo
  2003-02-14 23:00     ` Benjamin Riefenstahl
  0 siblings, 1 reply; 7+ messages in thread
From: Javier Oviedo @ 2003-02-13 21:39 UTC (permalink / raw)


Is there any way around this for me? I cannot change the code since I am not
owner of it.

Thanks.
"David Kastrup" <dak@gnu.org> wrote in message
news:x5of5fvrdk.fsf@lola.goethe.zz...
> "Javier Oviedo" <email_joviedo@yahoo.com> writes:
>
> > Hello all!
> >
> > 1. I am seeing that sometimes #define/#include and #ifdef/#else/etc. are
not
> > fontified in some c-code that I am looking at. The issue seems to occur
only
> > if the above do not begin in the column zero. There is some code that I
must
> > browse that indents these, especially the #ifdef/etc, and I'd like to
see
> > them fontified and usual. Any help?
>
> There is a reason:
>
> Preprocessing directives are recognized in traditional C only when
> their leading # appears in the first column. There can be no
> whitespace between the beginning of the line and the #.
>
> --
> David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: fontlock and imenu problems
  2003-02-13 21:39   ` Javier Oviedo
@ 2003-02-14 23:00     ` Benjamin Riefenstahl
  2003-02-19 16:10       ` Javier Oviedo
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Riefenstahl @ 2003-02-14 23:00 UTC (permalink / raw)


Hi Javier,

"Javier Oviedo" <email_joviedo@yahoo.com> writes:

> Is there any way around this for me? I cannot change the code since
> I am not owner of it.

Have a look at c-font-lock-keywords to see how the current scheme is
setup and use font-lock-add-keywords to add modified versions of
expressions that match the preprocessor commands.

so long, benny

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

* Re: fontlock and imenu problems
  2003-02-14 23:00     ` Benjamin Riefenstahl
@ 2003-02-19 16:10       ` Javier Oviedo
  2003-02-19 16:50         ` Kai Großjohann
  2003-02-19 21:20         ` Benjamin Riefenstahl
  0 siblings, 2 replies; 7+ messages in thread
From: Javier Oviedo @ 2003-02-19 16:10 UTC (permalink / raw)


Thanks. How can I represent one or more spaces in the format that
c-font-lock-keywords would understand? Thanks.

"Benjamin Riefenstahl" <Benjamin.Riefenstahl@epost.de> wrote in message
news:m3u1f6qxgo.fsf@cicero.benny.turtle-trading.net...
> Hi Javier,
>
> "Javier Oviedo" <email_joviedo@yahoo.com> writes:
>
> > Is there any way around this for me? I cannot change the code since
> > I am not owner of it.
>
> Have a look at c-font-lock-keywords to see how the current scheme is
> setup and use font-lock-add-keywords to add modified versions of
> expressions that match the preprocessor commands.
>
> so long, benny

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

* Re: fontlock and imenu problems
  2003-02-19 16:10       ` Javier Oviedo
@ 2003-02-19 16:50         ` Kai Großjohann
  2003-02-19 21:20         ` Benjamin Riefenstahl
  1 sibling, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2003-02-19 16:50 UTC (permalink / raw)


"Javier Oviedo" <email_joviedo@yahoo.com> writes:

> Thanks. How can I represent one or more spaces in the format that
> c-font-lock-keywords would understand? Thanks.

I don't understand the question.  (re-search-forward "a b") is a Lisp
expression which searches for a, followed by space, followed by b.
Does this answer your question?
-- 
A turnip curses Elvis

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

* Re: fontlock and imenu problems
  2003-02-19 16:10       ` Javier Oviedo
  2003-02-19 16:50         ` Kai Großjohann
@ 2003-02-19 21:20         ` Benjamin Riefenstahl
  1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Riefenstahl @ 2003-02-19 21:20 UTC (permalink / raw)


Hi Javier,


"Javier Oviedo" <email_joviedo@yahoo.com> writes:
> Thanks. How can I represent one or more spaces in the format that
> c-font-lock-keywords would understand? Thanks.

c-font-lock-keywords uses regular expressions (regexps for short).  If
you don't know how regexps work, get some tutorial, e.g. any
beginner's Unix intro should have a section on them.  Or you can just
jump right in and read the Emacs regexp docs at

  C-h i g (emacs)regexps RET


Hope this helps, benny

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

end of thread, other threads:[~2003-02-19 21:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-13 20:19 fontlock and imenu problems Javier Oviedo
2003-02-13 20:48 ` David Kastrup
2003-02-13 21:39   ` Javier Oviedo
2003-02-14 23:00     ` Benjamin Riefenstahl
2003-02-19 16:10       ` Javier Oviedo
2003-02-19 16:50         ` Kai Großjohann
2003-02-19 21:20         ` Benjamin Riefenstahl

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.