Vittal Krishnamurthy <Vittal.Krishnamurthy(a)ind.alcatel.com> wrote:
I use Viper on Xemacs. I was trying to extend the paren
matching
capabality to match #ifdef with its #endif. But since I am new to
lisp, I am finding it hard to do it. I was wondering if any of you
guys have a lisp code which can match #if, #ifdef , #ifndef with its
corresponding #endif. ( basically matching preprocessor directives)
There are a few ways. In hideif.el, there are functions called
"forward-ifdef", "backward-ifdef", "next-ifdef", etc.. I
happen to use
another package, which I wrote (and think is much simpler):
ftp://ftp.sonic.net/pub/users/darrylo/xemacs/matchif.el
Inside this small file, is the single function, "match-if". When run,
this function simply displays the location of the enclosing #ifdef,
#else, etc.. Unlike the function in hideif.el, it doesn't move the
point.
--
Darryl Okahata
darrylo(a)soco.agilent.com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Agilent Technologies, or
of the little green men that have been following him all day.